Skip to content

BLD: remove generated Cython files from sdist#14453

Merged
charris merged 1 commit intonumpy:masterfrom
rgommers:no-cython-in-sdist
Sep 8, 2019
Merged

BLD: remove generated Cython files from sdist#14453
charris merged 1 commit intonumpy:masterfrom
rgommers:no-cython-in-sdist

Conversation

@rgommers
Copy link
Copy Markdown
Member

@rgommers rgommers commented Sep 8, 2019

Rationale: it has happened multiple times in the recent past that users
needed to use a more recent Cython than was used to generate the sdist
of the most recent release available on PyPI (e.g. for building with
a not-yet-released version of Python for which a Cython fix just
landed). The dependency specification and packaging tools have matured
to the point where it should be fine to require Cython to be installed.
Also, we have wheels (and conda-forge packages) for Windows, Linux and
macOS, so this change won't be visible at all to the average user.

Closes gh-13790, closes gh-14403

Also adds pyproject.toml to MANIFEST.in, it was missing.

Another note: this is not in setup_requires on purpose. For one because generate_cython runs before setup(**metadata) is invoked. For another, because if anyone runs python setup.py install they can simply deal with any error if they get it. And using setup_requires would invoke easy_install in some cases, which isn't nice anyway.

Rationale: it has happened multiple times in the recent past that users
needed to use a more recent Cython than was used to generate the sdist
of the most recent release available on PyPI (e.g. for building with
a not-yet-released version of Python for which a Cython fix just
landed).  The dependency specification and packaging tools have matured
to the point where it should be fine to require Cython to be installed.
Also, we have wheels (and conda-forge packages) for Windows, Linux and
macOS, so this change won't be visible at all to the average user.

Closes numpygh-13790

Also adds pyproject.toml to MANIFEST.in, it was missing.
@charris
Copy link
Copy Markdown
Member

charris commented Sep 8, 2019

LGTM. Note that SciPy parses the required version of cython out of the pyproject file, we could do the same, but let's add that later.

Thanks Ralf.

@rgommers rgommers deleted the no-cython-in-sdist branch September 8, 2019 19:23
@rgommers
Copy link
Copy Markdown
Member Author

rgommers commented Sep 8, 2019

Note that SciPy parses the required version of cython out of the pyproject file, we could do the same, but let's add that later.

I figured that for a one-liner it's much more trouble than it's worth, easier to simply add a comment to keep two places in sync.

SciPy actually needs *_requires in setup.py, so it's different there.

pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Dec 22, 2025
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Dec 22, 2025
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Dec 22, 2025
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Dec 22, 2025
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Dec 23, 2025
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Jan 6, 2026
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Jan 6, 2026
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
pyuxiang added a commit to s-fifteen-instruments/pyS15 that referenced this pull request Jan 6, 2026
Cythonizing pulls compatible CPython headers for compilation, and doing
this prematurely is likely to cause issues when building wheels in
environments without said headers, e.g. when building 'manylinux' wheels
with 'cibuildwheel' across different Python versions. This is actually
addressed in numpy [1] and pandas [2], with the same concerns of CPython
version mismatch with the generated Cythonized files in sdist.

This reintroduces Cython compilation to fix this issue, at the expense
of increased compilation burden during manual installation (from
source), but now allows for wheels to be built cleanly.

[1]: numpy/numpy#14453
[2]: pandas-dev/pandas#28341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error trying to install in CPython 3.8.0b4 cant install on python 3.8b1 on windows

2 participants