forked from dashingsoft/pyarmor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
142 lines (122 loc) · 5.02 KB
/
setup.py
File metadata and controls
142 lines (122 loc) · 5.02 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# 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 src.config import version
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'src', 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
pyarmor_data_files = [
'pyshield.key', 'pyshield.lic', 'public.key',
'product.key', 'license.tri', 'README.rst',
'protect_code.pt',
'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',
]
if path.exists(path.join('src', 'platforms', 'windows32')):
platform_data_files = [
'platforms/windows32/_pytransform.dll',
'platforms/windows64/_pytransform.dll',
'platforms/linux32/_pytransform.so',
'platforms/linux64/_pytransform.so',
'platforms/darwin64/_pytransform.dylib',
]
else:
platform_data_files = [
'platforms/win32/_pytransform.dll',
'platforms/win_amd64/_pytransform.dll',
'platforms/linux_i386/_pytransform.so',
'platforms/linux_x86_64/_pytransform.so',
'platforms/macosx_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
# def _build_file_list(d):
# return [d + '/' + x for x in listdir(d) if path.isfile(x)]
# other_data_files = [
# ('docs', ['docs/user-guide.md', 'docs/rationale.md']),
# ('examples/simple', _build_file_list('docs/examples/simple')),
# ('examples/py2exe', _build_file_list('docs/examples/py2exe')),
# ('examples/pybench', _build_file_list('docs/examples/pybench')),
# ('examples/pybench/package', _build_file_list('docs/examples/pybench/package')),
# ('examples/odoo', _build_file_list('docs/examples/odoo')),
# ('examples/odoo/weblogin', _build_file_list('docs/examples/odoo/weblogin')),
# ('examples/odoo/weblogin2', _build_file_list('docs/examples/odoo/weblogin2')),]
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,
url='https://github.com/dashingsoft/pyarmor',
author='Jondy Zhao',
author_email='jondy.zhao@gmail.com',
# 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.webui'],
package_dir={'pyarmor': 'src'},
package_data={
'pyarmor': pyarmor_data_files + platform_data_files,
'pyarmor.webui': ['css/*.css', 'js/*.js', '*.html', '*.js',
'manager.*'],
},
# data_files=other_data_files,
entry_points={
'console_scripts': [
'pyarmor=pyarmor.pyarmor:main_entry',
'pyarmor-webui=pyarmor.webui.server:main',
],
},
)