forked from fabioz/PyDev.Debugger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
176 lines (142 loc) · 5.22 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
r'''
Full setup, used to distribute the debugger backend to PyPi.
Note that this is mostly so that users can do:
pip install pydevd
in a machine for doing remote-debugging, as a local installation with the IDE should have
everything already distributed.
Reference on wheels:
https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
http://lucumr.pocoo.org/2014/1/27/python-on-wheels/
Another (no wheels): https://jamie.curle.io/blog/my-first-experience-adding-package-pypi/
New version: change version and then:
rm dist/pydevd*
C:\tools\Miniconda32\Scripts\activate py27_32
python setup.py sdist bdist_wheel
deactivate
dir dist
C:\tools\Miniconda32\Scripts\activate py34_32
python setup.py sdist bdist_wheel
deactivate
dir dist
C:\tools\Miniconda32\Scripts\activate py35_32
python setup.py sdist bdist_wheel
deactivate
dir dist
C:\tools\Miniconda32\Scripts\activate py36_32
python setup.py sdist bdist_wheel
deactivate
dir dist
C:\tools\Miniconda\Scripts\activate py27_64
python setup.py sdist bdist_wheel
deactivate
dir dist
C:\tools\Miniconda\Scripts\activate py34_64
python setup.py sdist bdist_wheel
deactivate
dir dist
C:\tools\Miniconda\Scripts\activate py35_64
python setup.py sdist bdist_wheel
deactivate
dir dist
C:\tools\Miniconda\Scripts\activate py36_64
python setup.py sdist bdist_wheel
deactivate
dir dist
twine upload dist/pydevd*
git tag pydev_debugger_1_1_1 -a -m "PyDev.Debugger 1.1.1"
git push --tags
'''
from setuptools import setup
from setuptools.dist import Distribution
from distutils.extension import Extension
import os
class BinaryDistribution(Distribution):
def is_pure(self):
return False
data_files = []
def accept_file(f):
f = f.lower()
for ext in '.py .dll .so .dylib .txt .cpp .h .bat .c .sh .md .txt'.split():
if f.endswith(ext):
return True
return f in ['readme', 'makefile']
data_files.append(('pydevd_attach_to_process', [os.path.join('pydevd_attach_to_process', f) for f in os.listdir('pydevd_attach_to_process') if accept_file(f)]))
for root, dirs, files in os.walk("pydevd_attach_to_process"):
for d in dirs:
data_files.append((os.path.join(root, d), [os.path.join(root, d, f) for f in os.listdir(os.path.join(root, d)) if accept_file(f)]))
import pydevd
version = pydevd.__version__
args = dict(
name='pydevd',
version=version,
description = 'PyDev.Debugger (used in PyDev and PyCharm)',
author='Fabio Zadrozny and others',
url='https://github.com/fabioz/PyDev.Debugger/',
license='EPL (Eclipse Public License)',
packages=[
'_pydev_bundle',
'_pydev_imps',
'_pydev_runfiles',
'_pydevd_bundle',
'_pydevd_frame_eval',
'pydev_ipython',
# 'pydev_sitecustomize', -- Not actually a package (not added)
# 'pydevd_attach_to_process', -- Not actually a package (included in MANIFEST.in)
'pydevd_concurrency_analyser',
'pydevd_plugins',
'pydevd_plugins.extensions',
],
py_modules=[
# 'interpreterInfo', -- Not needed for debugger
# 'pycompletionserver', -- Not needed for debugger
'pydev_app_engine_debug_startup',
# 'pydev_coverage', -- Not needed for debugger
# 'pydev_pysrc', -- Not needed for debugger
'pydev_run_in_console',
'pydevconsole',
'pydevd_file_utils',
'pydevd',
'pydevd_tracing',
# 'runfiles', -- Not needed for debugger
'setup_cython', # Distributed to clients. See: https://github.com/fabioz/PyDev.Debugger/issues/102
# 'setup', -- Should not be included as a module
],
classifiers=[
'Development Status :: 6 - Mature',
'Environment :: Console',
'Intended Audience :: Developers',
# It seems that the license is not recognized by Pypi, so, not categorizing it for now.
# https://bitbucket.org/pypa/pypi/issues/369/the-eclipse-public-license-superseeded
# 'License :: OSI Approved :: Eclipse Public License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: Software Development :: Debuggers',
],
entry_points={
'console_scripts':[
'pydevd = pydevd:main',
],
},
data_files=data_files,
keywords=['pydev', 'pydevd', 'pydev.debugger'],
include_package_data=True,
zip_safe=False,
)
import sys
try:
args_with_binaries = args.copy()
args_with_binaries.update(dict(
distclass=BinaryDistribution,
ext_modules=[
# In this setup, don't even try to compile with cython, just go with the .c file which should've
# been properly generated from a tested version.
Extension('_pydevd_bundle.pydevd_cython', ["_pydevd_bundle/pydevd_cython.c",])
]
))
setup(**args_with_binaries)
except:
# Compile failed: just setup without compiling cython deps.
setup(**args)
sys.stdout.write('Plain-python version of pydevd installed (cython speedups not available).\n')