Experimental: Use setuptools-scm

Closes: #58
This commit is contained in:
Brian May 2016-01-13 17:30:38 +11:00
parent aab973f12e
commit 1e82571b3d
3 changed files with 17 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
sshuttle/version.py
*.pyc *.pyc
*~ *~
*.8 *.8

View File

@ -19,12 +19,20 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
with open('VERSION.txt', 'r') as f:
version = f.readline().strip() def version_scheme(version):
from setuptools_scm.version import guess_next_dev_version
version = guess_next_dev_version(version)
return version.lstrip("v")
setup( setup(
name="sshuttle", name="sshuttle",
version=version, use_scm_version={
'write_to': "sshuttle/version.py",
'version_scheme': version_scheme,
},
setup_requires=['setuptools_scm'],
# version=version,
url='https://github.com/sshuttle/sshuttle', url='https://github.com/sshuttle/sshuttle',
author='Brian May', author='Brian May',
author_email='brian@linuxpenguins.xyz', author_email='brian@linuxpenguins.xyz',

View File

@ -126,6 +126,7 @@ r,remote= ssh hostname (and optional username) of remote sshuttle server
x,exclude= exclude this subnet (can be used more than once) x,exclude= exclude this subnet (can be used more than once)
X,exclude-from= exclude the subnets in a file (whitespace separated) X,exclude-from= exclude the subnets in a file (whitespace separated)
v,verbose increase debug message verbosity v,verbose increase debug message verbosity
V,version print the sshuttle version number and exit
e,ssh-cmd= the command to use to connect to the remote [ssh] e,ssh-cmd= the command to use to connect to the remote [ssh]
seed-hosts= with -H, use these hostnames for initial scan (comma-separated) seed-hosts= with -H, use these hostnames for initial scan (comma-separated)
no-latency-control sacrifice latency to improve bandwidth benchmarks no-latency-control sacrifice latency to improve bandwidth benchmarks
@ -142,6 +143,10 @@ hostwatch (internal use only)
o = options.Options(optspec) o = options.Options(optspec)
(opt, flags, extra) = o.parse(sys.argv[1:]) (opt, flags, extra) = o.parse(sys.argv[1:])
if opt.version:
from sshuttle.version import version
print(version)
exit(0)
if opt.daemon: if opt.daemon:
opt.syslog = 1 opt.syslog = 1
if opt.wrap: if opt.wrap: