-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
75 lines (64 loc) · 2.47 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
import os.path
import re
import sys
from setuptools import setup, Extension
from distutils.command.install import INSTALL_SCHEMES
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
setsc = Extension("guppy.sets.setsc", [
"src/sets/sets.c",
"src/sets/bitset.c",
"src/sets/nodeset.c"
])
heapyc = Extension("guppy.heapy.heapyc", [
'src/heapy/heapyc.c',
'src/heapy/stdtypes.c'
])
def doit():
if sys.version_info.major < 3:
print('''\
setup.py: Error: This guppy package only supports Python 3.
You can find the original Python 2 version, Guppy-PE, here:
http://guppy-pe.sourceforge.net/''', file=sys.stderr)
sys.exit(1)
if sys.implementation.name != 'cpython':
print('''\
setup.py: Warning: This guppy package only supports CPython.
Compilation failure expected, but continuting anyways...''', file=sys.stderr)
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as f:
long_description = f.read()
with open('guppy/_version.py', 'r') as versionfile:
version = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]$',
versionfile.read(), re.M)
version = version.group(1)
setup(name="guppy3",
version=version,
description="Guppy 3 -- Guppy-PE ported to Python 3",
long_description=long_description,
long_description_content_type='text/markdown',
author="YiFei Zhu",
author_email="zhuyifei1999@gmail.com",
url="https://github.com/zhuyifei1999/guppy3/",
license='MIT',
packages=[
"guppy",
"guppy.etc",
"guppy.gsl",
"guppy.heapy",
"guppy.heapy.test",
"guppy.sets",
],
ext_modules=[setsc, heapyc],
python_requires='>=3.8',
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: C",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Topic :: Software Development :: Debuggers",
"Environment :: Console",
"Intended Audience :: Developers",
])
doit()