Skip to content

Commit b1b12b9

Browse files
fangchenlisimonjayhawkins
authored andcommitted
Backport PR pandas-dev#42304: DEPS: update setuptools min version
1 parent 271f0d0 commit b1b12b9

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ repos:
110110
entry: python scripts/generate_pip_deps_from_conda.py
111111
files: ^(environment.yml|requirements-dev.txt)$
112112
pass_filenames: false
113-
additional_dependencies: [pyyaml]
113+
additional_dependencies: [pyyaml, toml]
114114
- id: sync-flake8-versions
115115
name: Check flake8 version is synced across flake8, yesqa, and environment.yml
116116
language: python

doc/source/development/contributing_environment.rst

+2-5
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,8 @@ Creating a Python environment (pip)
189189
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
190190

191191
If you aren't using conda for your development environment, follow these instructions.
192-
You'll need to have at least the :ref:`minimum Python version <install.version>` that pandas supports. If your Python version
193-
is 3.8.0 (or later), you might need to update your ``setuptools`` to version 42.0.0 (or later)
194-
in your development environment before installing the build dependencies::
195-
196-
pip install --upgrade setuptools
192+
You'll need to have at least the :ref:`minimum Python version <install.version>` that pandas supports.
193+
You also need to have ``setuptools`` 51.0.0 or later to build pandas.
197194

198195
**Unix**/**macOS with virtualenv**
199196

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Minimum requirements for the build system to execute.
33
# See https://github.com/scipy/scipy/pull/12940 for the AIX issue.
44
requires = [
5-
"setuptools>=38.6.0",
5+
"setuptools>=51.0.0",
66
"wheel",
77
"Cython>=0.29.21,<3", # Note: sync with setup.py
88
# Numpy requirements for different OS/architectures

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ natsort
8181
git+https://github.com/pydata/pydata-sphinx-theme.git@master
8282
numpydoc < 1.2
8383
pandas-dev-flaker==0.2.0
84+
setuptools>=51.0.0

scripts/generate_pip_deps_from_conda.py

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import re
1818
import sys
1919

20+
import toml
2021
import yaml
2122

2223
EXCLUDE = {"python", "c-compiler", "cxx-compiler"}
@@ -99,6 +100,13 @@ def main(conda_fname, pip_fname, compare=False):
99100
)
100101
pip_content = header + "\n".join(pip_deps) + "\n"
101102

103+
# add setuptools to requirements-dev.txt
104+
meta = toml.load(pathlib.Path(conda_path.parent, "pyproject.toml"))
105+
for requirement in meta["build-system"]["requires"]:
106+
if "setuptools" in requirement:
107+
pip_content += requirement
108+
pip_content += "\n"
109+
102110
if compare:
103111
with open(pip_fname) as pip_fd:
104112
return pip_content != pip_fd.read()

0 commit comments

Comments
 (0)