-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
45 lines (37 loc) · 1.4 KB
/
setup.py
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
import pip
import subprocess
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def requirements():
return [str(ir.req) for ir in pip.req.parse_requirements('requirements.txt')]
def get_version():
try:
# pip-installed packages can get the version from the 'version.txt'
# file, since it is included in the package MANIFEST.
with open('version.txt', 'r') as f:
return f.read().strip()
except IOError:
# since 'version.txt' is .gitignored, running setup.py (install|develop)
# from a git repo requires a bit of bootstrapping. in this case, we use
# the raw .git tag as the version.
version = "0.1"
revision = subprocess.check_output(["git", "rev-list", "HEAD", "--count"])
sha = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"])
return '-'.join((version, revision, sha))
readme = open('README.rst').read()
setup(
name='pyhkdf',
version=get_version(),
description=("pyhkdf - a straight forward implementation of RFC 5869"
"HMAC-based Key Derivation Function (HKDF)"),
long_description=readme,
author="Mirko Dziadzka",
author_email="[email protected]",
url="https://github.com/MirkoDziadzka/pyhkdf",
package_dir = {'': 'src'},
py_modules = ['hkdf'],
install_requires=requirements(),
keywords='HKDF',
)