Skip to content

Backport PR #42304: DEPS: update setuptools min version #42901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ repos:
entry: python scripts/generate_pip_deps_from_conda.py
files: ^(environment.yml|requirements-dev.txt)$
pass_filenames: false
additional_dependencies: [pyyaml]
additional_dependencies: [pyyaml, toml]
- id: sync-flake8-versions
name: Check flake8 version is synced across flake8, yesqa, and environment.yml
language: python
Expand Down
7 changes: 2 additions & 5 deletions doc/source/development/contributing_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,8 @@ Creating a Python environment (pip)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you aren't using conda for your development environment, follow these instructions.
You'll need to have at least the :ref:`minimum Python version <install.version>` that pandas supports. If your Python version
is 3.8.0 (or later), you might need to update your ``setuptools`` to version 42.0.0 (or later)
in your development environment before installing the build dependencies::

pip install --upgrade setuptools
You'll need to have at least the :ref:`minimum Python version <install.version>` that pandas supports.
You also need to have ``setuptools`` 51.0.0 or later to build pandas.

**Unix**/**macOS with virtualenv**

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Minimum requirements for the build system to execute.
# See https://github.com/scipy/scipy/pull/12940 for the AIX issue.
requires = [
"setuptools>=38.6.0",
"setuptools>=51.0.0",
"wheel",
"Cython>=0.29.21,<3", # Note: sync with setup.py
# Numpy requirements for different OS/architectures
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ natsort
git+https://github.com/pydata/pydata-sphinx-theme.git@master
numpydoc < 1.2
pandas-dev-flaker==0.2.0
setuptools>=51.0.0
8 changes: 8 additions & 0 deletions scripts/generate_pip_deps_from_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import re
import sys

import toml
import yaml

EXCLUDE = {"python", "c-compiler", "cxx-compiler"}
Expand Down Expand Up @@ -96,6 +97,13 @@ def generate_pip_from_conda(
)
pip_content = header + "\n".join(pip_deps) + "\n"

# add setuptools to requirements-dev.txt
meta = toml.load(pathlib.Path(conda_path.parent, "pyproject.toml"))
for requirement in meta["build-system"]["requires"]:
if "setuptools" in requirement:
pip_content += requirement
pip_content += "\n"

if compare:
with pip_path.open() as file:
return pip_content != file.read()
Expand Down