summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-09-08 13:22:28 -0600
committerGitHub <noreply@github.com>2019-09-08 13:22:28 -0600
commitee2b11976c647c74fe875bb14aa5e45625f8e555 (patch)
treec284f1f056f970001375614b3cb046cbfcfbd2db
parent3fea61fcbe8d1f9a71c4ddf2fee827e73396bb4f (diff)
parentd630d96598f1b7ea044d60bea8cd2b87778f072a (diff)
downloadnumpy-ee2b11976c647c74fe875bb14aa5e45625f8e555.tar.gz
Merge pull request #14453 from rgommers/no-cython-in-sdist
BLD: remove generated Cython files from sdist
-rw-r--r--MANIFEST.in1
-rw-r--r--pyproject.toml6
-rwxr-xr-xsetup.py4
-rwxr-xr-xtools/cythonize.py1
4 files changed, 9 insertions, 3 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index dbe55da53..dad55176d 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -5,6 +5,7 @@
# Avoid using MANIFEST.in for that.
#
include MANIFEST.in
+include pyproject.toml
include pytest.ini
include *.txt
include README.md
diff --git a/pyproject.toml b/pyproject.toml
index 949e12c9e..4439ed229 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,10 @@
[build-system]
# Minimum requirements for the build system to execute.
-requires = ["setuptools", "wheel", "cython"] # PEP 508 specification
+requires = [
+ "setuptools",
+ "wheel",
+ "Cython>=0.29.13", # Note: keep in sync with tools/cythonize.py
+]
[tool.towncrier]
diff --git a/setup.py b/setup.py
index f9ea81696..640105ed0 100755
--- a/setup.py
+++ b/setup.py
@@ -422,8 +422,8 @@ def setup_package():
if run_build:
from numpy.distutils.core import setup
cwd = os.path.abspath(os.path.dirname(__file__))
- if not os.path.exists(os.path.join(cwd, 'PKG-INFO')):
- # Generate Cython sources, unless building from source release
+ if not 'sdist' in sys.argv:
+ # Generate Cython sources, unless we're generating an sdist
generate_cython()
metadata['configuration'] = configuration
diff --git a/tools/cythonize.py b/tools/cythonize.py
index d41c3270b..5bea2d4ec 100755
--- a/tools/cythonize.py
+++ b/tools/cythonize.py
@@ -71,6 +71,7 @@ def process_pyx(fromfile, tofile):
# Cython 0.29.13 is required for Python 3.8 and there are
# other fixes in the 0.29 series that are needed even for earlier
# Python versions.
+ # Note: keep in sync with that in pyproject.toml
required_version = LooseVersion('0.29.13')
if LooseVersion(cython_version) < required_version: