-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
83 lines (71 loc) · 2.26 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
"""
Tell Python how to install and manage this library. Used implicitly by `pip`,
so don't remove!
"""
try:
from setuptools import setup, PEP420PackageFinder # or find_packages
except ImportError:
raise AssertionError('Cannot build library without setuptools!')
# Support custom commands, like writing out our requirements into
# a form that Snyk knows how to parse.
# TODO: if we adopt Pipenv, replace this with a line of bash:
# `pipenv lock -r > requirements.txt`
import shutil
from distutils.cmd import Command
class SnykSync(Command):
description = "Sync setup.py to requirements.txt to enable Snyk to run."
user_options = [
('output', 'o', 'Output file name (default: requirements.txt)'),
('backup', 'b', 'Backup file name (default: requirements_orig.txt)'),
]
def initialize_options(self):
self.output = 'requirements.txt'
self.backup = 'requirements_orig.txt'
def finalize_options(self):
pass
def run(self):
shutil.copyfile(self.output, self.backup)
with open(self.output, 'w', encoding='utf8') as reqs:
reqs.write('\n'.join(INSTALL_REQUIRES))
INSTALL_REQUIRES = [
'python-dotenv~=0.7.1',
'boto3==1.9.66',
'pyperclip==1.7.0',
'click==7.0',
'colorama==0.4.1',
]
TEST_REQUIRES = [
'flake8~=3.5.0',
'mock~=2.0.0',
'moto==1.3.1',
'pytest~=3.4.0',
'pytest-cov~=2.5.1',
'tox~=2.9.1',
'yapf~=0.21.0',
'bandit==1.5.1',
]
try:
import pypandoc
DESCRIPTION = pypandoc.convert('README.md', 'rst')
except (IOError, ImportError):
DESCRIPTION = "AWS SSM Parameter Store Management CLI"
DEPENDENCY_LINKS = []
setup(
name='enforcer',
version="1.0.1",
url='https://github.com/PotomacInnovation/enforcer',
license='Upside',
author="@PotomacInnovation/owners-sre",
description='AWS SSM Parameter Store Management CLI',
long_description=DESCRIPTION,
packages=PEP420PackageFinder.find(), # or find_packages()
include_package_data=True,
zip_safe=False,
platforms='any',
install_requires=INSTALL_REQUIRES,
test_requires=TEST_REQUIRES,
extras_require={'dev': TEST_REQUIRES},
dependency_links=DEPENDENCY_LINKS,
classifiers=[],
scripts=['bin/enforcer'],
cmdclass={'snyksync': SnykSync})