This repository was archived by the owner on Nov 9, 2020. It is now read-only.
forked from dlenski/vpn-slice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·50 lines (42 loc) · 1.88 KB
/
setup.py
File metadata and controls
executable file
·50 lines (42 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
import sys, os, re, subprocess as sp
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.version_info < (3,3):
sys.exit("Python 3.3+ is required; you are using %s" % sys.version)
########################################
# Based on this recipe, adapted for Python 3, Git 2.8.x, and PEP-440 version identifiers
# http://blogs.nopcode.org/brainstorm/2013/05/20/pragmatic-python-versioning-via-setuptools-and-git-tags/
# https://www.python.org/dev/peps/pep-0440/#version-scheme
# Fetch version from git tags, and write to version.py.
# Also, when git is not available (PyPi package), use stored version.py.
version_py = os.path.join(os.path.dirname(__file__), 'vpn_slice', 'version.py')
try:
version_git = sp.check_output(["git", "describe", "--tags", "--dirty=_dirty"]).strip().decode('ascii')
final, dev, blob, dirty = re.match(r'v?((?:\d+\.)*\d+)(?:-(\d+)-(g[a-z0-9]+))?(_dirty)?', version_git).groups()
version_pep = final+('.dev%s+%s'%(dev,blob) if dev else '')+(dirty if dirty else '')
except:
d = {}
with open(version_py, 'r') as fh:
exec(fh.read(), d)
version_pep = d['__version__']
else:
with open(version_py, 'w') as fh:
print("# Do not edit this file; versioning is governed by git tags")
print('__version__="%s"' % version_pep)
########################################
setup(name="vpn_slice",
version="0.1",
description=("vpnc-script replacement for easy split-tunnel VPN setup"),
long_description=open('README.md').read(),
author="Daniel Lenski",
author_email="dlenski@gmail.com",
install_requires=[],
license='GPL v3 or later',
url="https://github.com/dlenski/vpn-slice",
packages=["vpn_slice"],
include_package_data = True,
entry_points={ 'console_scripts': [ 'vpn-slice=vpn_slice.main:main' ] }
)