Skip to content

Commit 6df2d64

Browse files
committed
Remove setup.py develop command (#6424)
* Remove setup.py develop command. * Protect from setuptools>=80 incompatibility. * Relocate What's New entry.
1 parent a6b4b19 commit 6df2d64

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

benchmarks/asv_delegated.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ def _prep_env_override(self, env_parent_dir: Path) -> Path:
4141
# The project checkout.
4242
build_dir = Path(self._build_root) / self._repo_subdir
4343

44+
# Older iterations of setup.py are incompatible with setuptools>=80.
45+
# (Most dependencies are protected by lock-files, but build
46+
# dependencies in pyproject.toml are independent).
47+
setup_py = build_dir / "setup.py"
48+
pyproject = build_dir / "pyproject.toml"
49+
if setup_py.is_file() and "setuptools.command.develop" in setup_py.read_text():
50+
with pyproject.open("r+") as file_write:
51+
lines = file_write.readlines()
52+
for i, line in enumerate(lines):
53+
if line == "requires = [\n":
54+
next_line = lines[i + 1]
55+
indent = next_line[: len(next_line) - len(next_line.lstrip())]
56+
57+
lines.insert(i + 1, f'{indent}"setuptools<80",\n')
58+
break
59+
file_write.seek(0)
60+
file_write.writelines(lines)
61+
4462
class Mode(enum.Enum):
4563
"""The scenarios where the correct env setup script is known."""
4664

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from setuptools import Command, setup
77
from setuptools.command.build_py import build_py
8-
from setuptools.command.develop import develop
98

109

1110
class BaseCommand(Command):
@@ -49,8 +48,7 @@ def finalize_options(self):
4948
cmd.finalize_options(self)
5049

5150
if not hasattr(self, "editable_mode") or self.editable_mode is None:
52-
# Default to editable i.e., applicable to "std_names" and
53-
# and "develop" commands.
51+
# Default to editable i.e., applicable to "std_names".
5452
self.editable_mode = True
5553

5654
def run(self):
@@ -76,7 +74,6 @@ def run(self):
7674

7775

7876
custom_commands = {
79-
"develop": custom_command(develop),
8077
"build_py": custom_command(build_py),
8178
"std_names": custom_command(BaseCommand, help="generate CF standard names"),
8279
}

0 commit comments

Comments
 (0)