diff --git a/.gitignore b/.gitignore index e85da9c9b976b..6c3c275c48fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ dist # wheel files *.whl **/wheelhouse/* +pip-wheel-metadata # coverage .coverage coverage.xml diff --git a/MANIFEST.in b/MANIFEST.in index b417b8890fa24..d82e64d0a68b8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,6 +3,7 @@ include LICENSE include RELEASE.md include README.md include setup.py +include pyproject.toml graft doc prune doc/build diff --git a/Makefile b/Makefile index 9e69eb7922925..27a2c3682de9c 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 3cde98d3145f2..d5e71fc4740cf 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/ci/incremental/build.cmd b/ci/incremental/build.cmd index 2cce38c03f406..b61b59e287299 100644 --- a/ci/incremental/build.cmd +++ b/ci/incremental/build.cmd @@ -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% diff --git a/ci/setup_env.sh b/ci/setup_env.sh index 88742e0483c7e..382491a947488 100755 --- a/ci/setup_env.sh +++ b/ci/setup_env.sh @@ -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" diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 21fb1baf7db34..c66ae5e4bc36f 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -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:: @@ -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 ----------------- diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 2913d88fcd15f..5b9e3a7dbad06 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -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 `_ file (:issue:`20775`) ExtensionArray diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000..2ec4739c2f7f8 --- /dev/null +++ b/pyproject.toml @@ -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'", +] diff --git a/setup.py b/setup.py index 60e3f7ff78a10..493254e5329bf 100755 --- a/setup.py +++ b/setup.py @@ -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": [ @@ -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")