Skip to content

Commit 1710f5e

Browse files
Backport PR #42304: DEPS: update setuptools min version (#42901)
Co-authored-by: Fangchen Li <[email protected]>
1 parent 4a61bf6 commit 1710f5e

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"}
@@ -96,6 +97,13 @@ def generate_pip_from_conda(
9697
)
9798
pip_content = header + "\n".join(pip_deps) + "\n"
9899

100+
# add setuptools to requirements-dev.txt
101+
meta = toml.load(pathlib.Path(conda_path.parent, "pyproject.toml"))
102+
for requirement in meta["build-system"]["requires"]:
103+
if "setuptools" in requirement:
104+
pip_content += requirement
105+
pip_content += "\n"
106+
99107
if compare:
100108
with pip_path.open() as file:
101109
return pip_content != file.read()

0 commit comments

Comments
 (0)