-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup.py
90 lines (67 loc) · 2.02 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env python
# coding: utf8
import os
import setuptools
import sys
sys.path.append(os.path.dirname(__file__))
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))
# The directories in which the packages can be found
PACKAGE_DIR = {
'truepy': 'lib/truepy'}
REQUIREMENTS = [
'cryptography >=1.0',
'pycryptodome >=3.9.4']
def setup(**kwargs):
global INFO, README, CHANGES, PACKAGE_DATA, PACKAGE_DIR
setuptools.setup(
name='truepy',
version='.'.join(str(i) for i in INFO['version']),
description='A Python library to create TrueLicense license files.',
long_description=README + '\n\n' + CHANGES,
install_requires=REQUIREMENTS,
setup_requires=REQUIREMENTS,
author=INFO['author'],
author_email='[email protected]',
url='https://github.com/moses-palmer/truepy',
packages=setuptools.find_packages(
os.path.join(
os.path.dirname(__file__),
'lib')),
package_dir=PACKAGE_DIR,
zip_safe=True,
test_suite='tests',
license='GPLv3',
platforms=['linux', 'windows'],
classifiers=[],
**kwargs)
# Read globals from truepy._info without loading it
INFO = {}
with open(os.path.join(
os.path.dirname(__file__),
'lib',
'truepy',
'_info.py')) as f:
for line in f:
try:
name, value = (i.strip() for i in line.split('='))
if name.startswith('__') and name.endswith('__'):
INFO[name[2:-2]] = eval(value)
except ValueError:
pass
try:
# Read README
with open(os.path.join(
os.path.dirname(__file__),
'README.rst')) as f:
README = f.read()
# Read CHANGES
with open(os.path.join(
os.path.dirname(__file__),
'CHANGES.rst')) as f:
CHANGES = f.read()
except IOError:
README = ''
CHANGES = ''
# Arguments passed to setup
setup_arguments = {}
setup(**setup_arguments)