Skip to content

Commit 08e52ab

Browse files
committed
do not install cython as build dependency
1 parent 9cea8b6 commit 08e52ab

File tree

2 files changed

+1
-48
lines changed

2 files changed

+1
-48
lines changed

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
[build-system]
2-
requires = [
3-
# Also declared in requirements.txt, if updating here please also update there
4-
"Cython~=3.0.10",
5-
"setuptools >= 69.5.1",
6-
]
2+
requires = ["setuptools >= 69.5.1"]
73
build-backend = "setuptools.build_meta"
84

95
[project]

setup.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,6 @@
88

99
PYPY = hasattr(sys, "pypy_version_info")
1010

11-
12-
class NoCython(Exception):
13-
pass
14-
15-
16-
try:
17-
import Cython.Compiler.Main as cython_compiler
18-
19-
have_cython = True
20-
except ImportError:
21-
have_cython = False
22-
23-
24-
def cythonize(src):
25-
if not have_cython:
26-
raise Exception("Cython is required for building from checkout")
27-
sys.stderr.write(f"cythonize: {src!r}\n")
28-
cython_compiler.compile([src])
29-
30-
31-
def ensure_source(src):
32-
pyx = os.path.splitext(src)[0] + ".pyx"
33-
34-
if not os.path.exists(src) or have_cython and os.stat(src).st_mtime < os.stat(pyx).st_mtime:
35-
cythonize(pyx)
36-
37-
38-
class BuildExt(build_ext):
39-
def build_extension(self, ext):
40-
for src in ext.sources:
41-
ensure_source(src)
42-
return build_ext.build_extension(self, ext)
43-
44-
45-
# Cython is required for sdist
46-
class Sdist(sdist):
47-
def __init__(self, *args, **kwargs):
48-
cythonize("msgpack/_cmsgpack.pyx")
49-
sdist.__init__(self, *args, **kwargs)
50-
51-
5211
libraries = []
5312
macros = []
5413
ext_modules = []
@@ -69,9 +28,7 @@ def __init__(self, *args, **kwargs):
6928
)
7029
del libraries, macros
7130

72-
7331
setup(
74-
cmdclass={"build_ext": BuildExt, "sdist": Sdist},
7532
ext_modules=ext_modules,
7633
packages=["msgpack"],
7734
)

0 commit comments

Comments
 (0)