-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
101 lines (91 loc) · 2.89 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
91
92
93
94
95
96
97
98
99
100
101
import glob
import os
import sys
from distutils.core import setup
from typing import List
def get_version(filename):
import ast
version = None
with open(filename) as f:
for line in f:
if line.startswith('__version__'):
version = ast.parse(line).body[0].value.s
break
else:
raise ValueError('No version found in %r.' % filename)
if version is None:
raise ValueError(filename)
return version
def _get_all_files(parent: str, child: str) -> List[str]:
path = os.path.abspath(os.path.join(parent, child))
hidden = glob.glob(os.path.join(path, ".**"), recursive=True)
nonhidden = glob.glob(os.path.join(path, "**"), recursive=True)
items = hidden + nonhidden
files = filter(os.path.isfile, items)
files = list(map(lambda p: os.path.relpath(p, parent), files))
return files
def get_decorator_files() -> List[str]:
this_file = os.path.abspath(__file__)
cpk_dir = os.path.join(os.path.dirname(this_file), "include", "cpk")
return _get_all_files(cpk_dir, "decorator")
if sys.version_info < (3, 10):
msg = 'cpk works with Python 3.10 and later.\nDetected %s.' % str(sys.version)
sys.exit(msg)
lib_version = get_version(filename='include/cpk/__init__.py')
setup(
name='cpk',
packages=[
'cpk',
'cpk.adapters',
'cpk.cli',
'cpk.cli.commands',
'cpk.cli.commands.machine',
'cpk.cli.commands.endpoint',
'cpk.utils'
],
package_dir={
'cpk': 'include/cpk'
},
package_data={
"cpk": [
"schemas/*/*.json",
*get_decorator_files(),
],
},
version=lib_version,
license='MIT',
description='Toolkit that standardize the way code in a project is structured and packaged '
'for maximum portability, readability and maintainability.',
author='Andrea F. Daniele',
author_email='[email protected]',
url='https://github.com/afdaniele/cpk',
download_url='https://github.com/afdaniele/cpk/tarball/{}'.format(lib_version),
zip_safe=False,
include_package_data=True,
keywords=['code', 'container', 'containerization', 'package', 'toolkit', 'docker'],
install_requires=[
'requests',
'pytimeparse',
'dacite',
'jsonschema',
'termcolor',
'pyyaml',
'sshconf',
'cryptography',
'questionary',
'dockertown==0.2.4',
'mergedeep'
],
scripts=[
'include/cpk/bin/cpk'
],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
)