Skip to content
This repository was archived by the owner on Mar 2, 2022. It is now read-only.

Commit 92abe44

Browse files
committed
Start versioning, bump to 0.1.0
* Move version to module * replace version in setup.py * replace version in scanner
1 parent 2b25b6a commit 92abe44

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

bwscanner/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.1.0'

bwscanner/scanner.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
from bwscanner.logger import setup_logging, log
1010
from bwscanner.measurement import BwScan
1111
from bwscanner.aggregate import write_aggregate_data
12-
13-
14-
BWSCAN_VERSION = '0.0.1'
12+
from bwscanner import __version__
1513

1614

1715
class ScanInstance(object):
@@ -43,7 +41,7 @@ def __repr__(self):
4341
help='Launch Tor or try to connect to an existing Tor instance.')
4442
@click.option('--circuit-build-timeout', default=20,
4543
help='Option passed when launching Tor.')
46-
@click.version_option(BWSCAN_VERSION)
44+
@click.version_option(__version__)
4745
@click.pass_context
4846
def cli(ctx, data_dir, loglevel, logfile, launch_tor, circuit_build_timeout):
4947
"""

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
import os.path
12
from setuptools import setup, find_packages
23

3-
__version__ = '0.0.1'
4+
5+
def get_version():
6+
with open(os.path.join("bwscanner", "__init__.py")) as f:
7+
for line in f:
8+
if "__version__" in line.strip():
9+
version = line.split("=", 1)[1].strip().strip('"')
10+
return version
11+
12+
13+
__version__ = get_version()
414
__author__ = 'aagbsn'
515
__contact__ = 'aagbsn@torproject.org'
616
__url__ = 'https://github.com/TheTorProject/bwscanner' # TODO: publish this
717
__license__ = 'GPL'
818
__copyright__ = ''
919

20+
1021
setup(name='bwscanner', # TODO: pick a better name
1122
version=__version__,
1223
description='Tor Bandwidth Scanner',

0 commit comments

Comments
 (0)