File tree 3 files changed +26
-6
lines changed
3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,24 @@ def _prep_env_override(self, env_parent_dir: Path) -> Path:
41
41
# The project checkout.
42
42
build_dir = Path (self ._build_root ) / self ._repo_subdir
43
43
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
+
44
62
class Mode (enum .Enum ):
45
63
"""The scenarios where the correct env setup script is known."""
46
64
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ This document explains the changes made to Iris for this release
36
36
🐛 Bugs Fixed
37
37
=============
38
38
39
- #. N/A
39
+ #. `@trexfeathers `_ removed the custom ``setup.py develop `` command, since
40
+ Setuptools are deprecating ``develop ``; developers should instead
41
+ use ``pip install -e . ``. See `Running setuptools commands `_ for more.
42
+ (:pull: `6424 `)
40
43
41
44
42
45
💣 Incompatible Changes
@@ -85,4 +88,6 @@ This document explains the changes made to Iris for this release
85
88
86
89
87
90
.. comment
88
- Whatsnew resources in alphabetical order:
91
+ Whatsnew resources in alphabetical order:
92
+
93
+ .. _Running setuptools commands : https://setuptools.pypa.io/en/latest/deprecated/commands.html
Original file line number Diff line number Diff line change 5
5
6
6
from setuptools import Command , setup
7
7
from setuptools .command .build_py import build_py
8
- from setuptools .command .develop import develop
9
8
10
9
11
10
class BaseCommand (Command ):
@@ -49,8 +48,7 @@ def finalize_options(self):
49
48
cmd .finalize_options (self )
50
49
51
50
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".
54
52
self .editable_mode = True
55
53
56
54
def run (self ):
@@ -76,7 +74,6 @@ def run(self):
76
74
77
75
78
76
custom_commands = {
79
- "develop" : custom_command (develop ),
80
77
"build_py" : custom_command (build_py ),
81
78
"std_names" : custom_command (BaseCommand , help = "generate CF standard names" ),
82
79
}
You can’t perform that action at this time.
0 commit comments