-
Notifications
You must be signed in to change notification settings - Fork 287
/
setup.py
127 lines (108 loc) · 4.27 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Always prefer setuptools over distutils
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# To use a consistent encoding
from codecs import open
from os import path
from sys import argv
from pyarmor.config import version
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'pyarmor', 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
pyarmor_data_files = [
'LICENSE', 'LICENSE-ZH',
'pyshield.key', 'pyshield.lic', 'public.key',
'product.key', 'license.tri', 'README.rst',
'protect_code.pt', 'protect_code2.pt', 'public_capsule.zip',
'plugins/README.md', 'plugins/check_ntp_time.py',
'examples/README.md', 'examples/README-ZH.md',
'examples/*.sh', 'examples/*.bat',
'examples/simple/*.py', 'examples/testmod/*.py',
'examples/testpkg/*.py', 'examples/testpkg/mypkg/*.py',
'examples/pybench/*.py', 'examples/pybench/package/*.py',
'examples/py2exe/*.py', 'examples/cx_Freeze/*.py',
'examples/helloworld/*.py',
]
platform_data_files = [
'platforms/windows/x86/_pytransform.dll',
'platforms/windows/x86_64/_pytransform.dll',
'platforms/linux/x86/_pytransform.so',
'platforms/linux/x86_64/_pytransform.so',
'platforms/darwin/x86_64/_pytransform.dylib',
]
if argv[1] == 'bdist_wheel':
for opt in argv[1:]:
if opt.startswith('--plat-name'):
name = opt.split('=')[1]
name = 'macosx_x86_64' if name.startswith('macosx_') else \
'linux_x86_64' if name == 'manylinux1_x86_64' else \
name
for i in range(len(platform_data_files)):
if platform_data_files[i].find(name) > -1:
platform_data_files[i] = \
platform_data_files[i].split('/')[-1]
break
break
setup(
name='pyarmor',
# Versions should comply with PEP 440:
# https://www.python.org/dev/peps/pep-0440/
version=version,
description='A tool used to obfuscate python scripts, bind obfuscated' \
' scripts to fixed machine or expire obfuscated scripts.',
long_description=long_description,
license='Free To Use But Restricted',
url='https://github.com/dashingsoft/pyarmor',
author='Jondy Zhao',
author_email='[email protected]',
# For a list of valid classifiers, see
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'Topic :: Utilities',
'Topic :: Security',
'Topic :: System :: Software Distribution',
# Pick your license as you wish
'License :: Free To Use But Restricted',
# Support platforms
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
# This field adds keywords for your project which will appear on the
# project page. What does your project relate to?
#
# Note that this is a string of words separated by whitespace, not a list.
keywords='protect obfuscate encrypt obfuscation distribute',
packages=['pyarmor', 'pyarmor.polyfills', 'pyarmor.helper', 'pyarmor.cli'],
package_dir={'pyarmor': 'pyarmor'},
package_data={
'pyarmor': pyarmor_data_files + platform_data_files,
'pyarmor.cli': ['default.cfg', 'public_capsule.zip', 'core.data.*'],
},
install_requires=[
'pyarmor.cli.core~=7.6.0'
],
entry_points={
'console_scripts': [
'pyarmor=pyarmor.pyarmor:main_entry_8',
'pyarmor-auth=pyarmor.cli.docker:main',
'pyarmor-7=pyarmor.pyarmor:main_entry',
'pyarmor-8=pyarmor.cli.__main__:main',
],
},
)