Skip to content

Commit 9dc6de3

Browse files
BLD: Add pyproject.toml (#28374)
Closes #28341
1 parent a880e42 commit 9dc6de3

File tree

10 files changed

+46
-20
lines changed

10 files changed

+46
-20
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dist
5757
# wheel files
5858
*.whl
5959
**/wheelhouse/*
60+
pip-wheel-metadata
6061
# coverage
6162
.coverage
6263
coverage.xml

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include LICENSE
33
include RELEASE.md
44
include README.md
55
include setup.py
6+
include pyproject.toml
67

78
graft doc
89
prune doc/build

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ black:
1818
black . --exclude '(asv_bench/env|\.egg|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|setup.py)'
1919

2020
develop: build
21-
python setup.py develop
21+
python -m pip install --no-build-isolation -e .
2222

2323
doc:
2424
-rm -rf doc/build doc/source/generated

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,17 @@ python setup.py install
188188

189189
or for installing in [development mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs):
190190

191+
191192
```sh
192-
python setup.py develop
193+
python -m pip install --no-build-isolation -e .
193194
```
194195

195-
Alternatively, you can use `pip` if you want all the dependencies pulled
196-
in automatically (the `-e` option is for installing it in [development
197-
mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs)):
196+
If you have `make`, you can also use `make develop` to run the same command.
197+
198+
or alternatively
198199

199200
```sh
200-
pip install -e .
201+
python setup.py develop
201202
```
202203

203204
See the full instructions for [installing from source](https://pandas.pydata.org/pandas-docs/stable/install.html#installing-from-source).

ci/incremental/build.cmd

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/build.cmd
22

3-
@rem Build numba extensions without silencing compile errors
4-
python setup.py build_ext -q --inplace
3+
@rem Build extensions
4+
python setup.py build_ext -q -i
55

6-
@rem Install pandas locally
7-
python -m pip install -e .
6+
@rem Install pandas
7+
python -m pip install --no-build-isolation -e .
88

99
if %errorlevel% neq 0 exit /b %errorlevel%

ci/setup_env.sh

+14-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,20 @@ conda list pandas
115115

116116
# Make sure any error below is reported as such
117117

118-
echo "Build extensions and install pandas"
119-
python setup.py build_ext -q --inplace
120-
python -m pip install -e .
118+
echo "[Build extensions]"
119+
python setup.py build_ext -q -i
120+
121+
# XXX: Some of our environments end up with old verisons of pip (10.x)
122+
# Adding a new enough verison of pip to the requirements explodes the
123+
# solve time. Just using pip to update itself.
124+
# - py35_macos
125+
# - py35_compat
126+
# - py36_32bit
127+
echo "[Updating pip]"
128+
python -m pip install --no-deps -U pip wheel setuptools
129+
130+
echo "[Install pandas]"
131+
python -m pip install --no-build-isolation -e .
121132

122133
echo
123134
echo "conda list"

doc/source/development/contributing.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ We'll now kick off a three-step process:
208208
209209
# Build and install pandas
210210
python setup.py build_ext --inplace -j 4
211-
python -m pip install -e .
211+
python -m pip install -e --no-build-isolation .
212212
213213
At this point you should be able to import pandas from your locally built version::
214214

@@ -252,7 +252,7 @@ You'll need to have at least python3.5 installed on your system.
252252
253253
# Build and install pandas
254254
python setup.py build_ext --inplace -j 4
255-
python -m pip install -e .
255+
python -m pip install -e --no-build-isolation .
256256
257257
Creating a branch
258258
-----------------

doc/source/whatsnew/v1.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ Sparse
227227
Build Changes
228228
^^^^^^^^^^^^^
229229
- Fixed pyqt development dependency issue because of different pyqt package name in conda and PyPI (:issue:`26838`)
230+
- Added a `pyproject.toml <https://www.python.org/dev/peps/pep-0517/>`_ file (:issue:`20775`)
230231

231232

232233
ExtensionArray

pyproject.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[build-system]
2+
# Minimum requirements for the build system to execute.
3+
# See https://github.com/scipy/scipy/pull/10431 for the AIX issue.
4+
requires = [
5+
"setuptools",
6+
"wheel",
7+
"Cython>=0.29.13", # Note: sync with setup.py
8+
"numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'",
9+
"numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'",
10+
"numpy==1.14.5; python_version>='3.7' and platform_system!='AIX'",
11+
"numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'",
12+
"numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'",
13+
"numpy==1.16.0; python_version>='3.7' and platform_system=='AIX'",
14+
]

setup.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def is_platform_mac():
3232

3333

3434
min_numpy_ver = "1.13.3"
35-
min_cython_ver = "0.29.13"
35+
min_cython_ver = "0.29.13" # note: sync with pyproject.toml
3636

3737
setuptools_kwargs = {
3838
"install_requires": [
@@ -528,10 +528,7 @@ def maybe_cythonize(extensions, *args, **kwargs):
528528
# Avoid running cythonize on `python setup.py clean`
529529
# See https://github.com/cython/cython/issues/1495
530530
return extensions
531-
if not cython:
532-
# Avoid trying to look up numpy when installing from sdist
533-
# https://github.com/pandas-dev/pandas/issues/25193
534-
# TODO: See if this can be removed after pyproject.toml added.
531+
elif "sdist" in sys.argv:
535532
return extensions
536533

537534
numpy_incl = pkg_resources.resource_filename("numpy", "core/include")

0 commit comments

Comments
 (0)