From f2cbf4e93afe07a80c4546bdfa47ab52de9c80f9 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Fri, 20 Nov 2020 16:46:27 -0600 Subject: [PATCH] BLD: set inplace in setup.cfg (#37973) --- Dockerfile | 2 +- Makefile | 2 +- azure-pipelines.yml | 2 +- ci/azure/windows.yml | 2 +- ci/setup_env.sh | 2 +- doc/source/development/contributing.rst | 10 +++++----- pandas/__init__.py | 2 +- setup.cfg | 3 +++ 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index b8aff5d671dcf..5d7a2b9e6b743 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,5 +43,5 @@ RUN conda env update -n base -f "$pandas_home/environment.yml" # Build C extensions and pandas RUN cd "$pandas_home" \ - && python setup.py build_ext --inplace -j 4 \ + && python setup.py build_ext -j 4 \ && python -m pip install -e . diff --git a/Makefile b/Makefile index 4f71df51de360..2c968234749f5 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ clean_pyc: -find . -name '*.py[co]' -exec rm {} \; build: clean_pyc - python setup.py build_ext --inplace + python setup.py build_ext lint-diff: git diff upstream/master --name-only -- "*.py" | xargs flake8 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b1091ea7f60e4..c49742095e1d8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,7 +40,7 @@ jobs: . ~/virtualenvs/pandas-dev/bin/activate && \ python -m pip install --no-deps -U pip wheel setuptools && \ pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \ - python setup.py build_ext -q -i -j2 && \ + python setup.py build_ext -q -j2 && \ python -m pip install --no-build-isolation -e . && \ pytest -m 'not slow and not network and not clipboard' pandas --junitxml=test-data.xml" displayName: 'Run 32-bit manylinux2014 Docker Build / Tests' diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index 601a834d6306a..e510f4115b25f 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -34,7 +34,7 @@ jobs: - bash: | source activate pandas-dev conda list - python setup.py build_ext -q -i -j 4 + python setup.py build_ext -q -j 4 python -m pip install --no-build-isolation -e . displayName: 'Build' diff --git a/ci/setup_env.sh b/ci/setup_env.sh index 8984fa2d9a9be..78951c9def7cb 100755 --- a/ci/setup_env.sh +++ b/ci/setup_env.sh @@ -131,7 +131,7 @@ conda list pandas # Make sure any error below is reported as such echo "[Build extensions]" -python setup.py build_ext -q -i -j2 +python setup.py build_ext -q -j2 echo "[Updating pip]" python -m pip install --no-deps -U pip wheel setuptools diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 41b2b7405fcb5..ced0554c51fdf 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -183,7 +183,7 @@ See https://www.jetbrains.com/help/pycharm/docker.html for details. Note that you might need to rebuild the C extensions if/when you merge with upstream/master using:: - python setup.py build_ext --inplace -j 4 + python setup.py build_ext -j 4 .. _contributing.dev_c: @@ -268,7 +268,7 @@ We'll now kick off a three-step process: source activate pandas-dev # Build and install pandas - python setup.py build_ext --inplace -j 4 + python setup.py build_ext -j 4 python -m pip install -e . --no-build-isolation --no-use-pep517 At this point you should be able to import pandas from your locally built version:: @@ -315,7 +315,7 @@ You'll need to have at least Python 3.6.1 installed on your system. python -m pip install -r requirements-dev.txt # Build and install pandas - python setup.py build_ext --inplace -j 4 + python setup.py build_ext -j 4 python -m pip install -e . --no-build-isolation --no-use-pep517 **Unix**/**macOS with pyenv** @@ -339,7 +339,7 @@ Consult the docs for setting up pyenv `here `__. python -m pip install -r requirements-dev.txt # Build and install pandas - python setup.py build_ext --inplace -j 4 + python setup.py build_ext -j 4 python -m pip install -e . --no-build-isolation --no-use-pep517 **Windows** @@ -365,7 +365,7 @@ should already exist. python -m pip install -r requirements-dev.txt # Build and install pandas - python setup.py build_ext --inplace -j 4 + python setup.py build_ext -j 4 python -m pip install -e . --no-build-isolation --no-use-pep517 Creating a branch diff --git a/pandas/__init__.py b/pandas/__init__.py index cf7ae2505b72d..b9b7d5d064855 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -33,7 +33,7 @@ raise ImportError( f"C extension: {module} not built. If you want to import " "pandas from the source directory, you may need to run " - "'python setup.py build_ext --inplace --force' to build the C extensions first." + "'python setup.py build_ext --force' to build the C extensions first." ) from e from pandas._config import ( diff --git a/setup.cfg b/setup.cfg index c83a83d599f6c..10c7137dc2f86 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,7 @@ +[build_ext] +inplace = 1 + # See the docstring in versioneer.py for instructions. Note that you must # re-run 'versioneer.py setup' after changing this section, and commit the # resulting files.