Skip to content

Commit

Permalink
BLD: Add pyproject.toml (#28374)
Browse files Browse the repository at this point in the history
Closes #28341
  • Loading branch information
TomAugspurger authored Sep 13, 2019
1 parent a880e42 commit 9dc6de3
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dist
# wheel files
*.whl
**/wheelhouse/*
pip-wheel-metadata
# coverage
.coverage
coverage.xml
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include LICENSE
include RELEASE.md
include README.md
include setup.py
include pyproject.toml

graft doc
prune doc/build
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ black:
black . --exclude '(asv_bench/env|\.egg|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|setup.py)'

develop: build
python setup.py develop
python -m pip install --no-build-isolation -e .

doc:
-rm -rf doc/build doc/source/generated
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,17 @@ python setup.py install

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


```sh
python setup.py develop
python -m pip install --no-build-isolation -e .
```

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

or alternatively

```sh
pip install -e .
python setup.py develop
```

See the full instructions for [installing from source](https://pandas.pydata.org/pandas-docs/stable/install.html#installing-from-source).
Expand Down
8 changes: 4 additions & 4 deletions ci/incremental/build.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/build.cmd

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

@rem Install pandas locally
python -m pip install -e .
@rem Install pandas
python -m pip install --no-build-isolation -e .

if %errorlevel% neq 0 exit /b %errorlevel%
17 changes: 14 additions & 3 deletions ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,20 @@ conda list pandas

# Make sure any error below is reported as such

echo "Build extensions and install pandas"
python setup.py build_ext -q --inplace
python -m pip install -e .
echo "[Build extensions]"
python setup.py build_ext -q -i

# XXX: Some of our environments end up with old verisons of pip (10.x)
# Adding a new enough verison of pip to the requirements explodes the
# solve time. Just using pip to update itself.
# - py35_macos
# - py35_compat
# - py36_32bit
echo "[Updating pip]"
python -m pip install --no-deps -U pip wheel setuptools

echo "[Install pandas]"
python -m pip install --no-build-isolation -e .

echo
echo "conda list"
Expand Down
4 changes: 2 additions & 2 deletions doc/source/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ We'll now kick off a three-step process:
# Build and install pandas
python setup.py build_ext --inplace -j 4
python -m pip install -e .
python -m pip install -e --no-build-isolation .
At this point you should be able to import pandas from your locally built version::

Expand Down Expand Up @@ -252,7 +252,7 @@ You'll need to have at least python3.5 installed on your system.
# Build and install pandas
python setup.py build_ext --inplace -j 4
python -m pip install -e .
python -m pip install -e --no-build-isolation .
Creating a branch
-----------------
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ Sparse
Build Changes
^^^^^^^^^^^^^
- Fixed pyqt development dependency issue because of different pyqt package name in conda and PyPI (:issue:`26838`)
- Added a `pyproject.toml <https://www.python.org/dev/peps/pep-0517/>`_ file (:issue:`20775`)


ExtensionArray
Expand Down
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[build-system]
# Minimum requirements for the build system to execute.
# See https://github.com/scipy/scipy/pull/10431 for the AIX issue.
requires = [
"setuptools",
"wheel",
"Cython>=0.29.13", # Note: sync with setup.py
"numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'",
"numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'",
"numpy==1.14.5; python_version>='3.7' and platform_system!='AIX'",
"numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'",
"numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'",
"numpy==1.16.0; python_version>='3.7' and platform_system=='AIX'",
]
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def is_platform_mac():


min_numpy_ver = "1.13.3"
min_cython_ver = "0.29.13"
min_cython_ver = "0.29.13" # note: sync with pyproject.toml

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

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

0 comments on commit 9dc6de3

Please sign in to comment.