Skip to content

Commit e73e211

Browse files
author
Release Manager
committed
gh-36400: `build/pkgs/setuptools_scm`: Update to 8.0.4, add fixes for version 8 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> Version 8 needs some new workarounds when packages that do not use `setuptools_scm` are installed with `--no-build-isolation` in an environment with `setuptools_scm`. This is relevant in particular for conda, see #35593. `setuptools_scm` inserts itself into the build process of unsuspecting packages via entry points declared by setuptools. One gets a warning: - `[sage_conf-10.2.beta5] WARNING setuptools_scm._integration.setuptools pyproject.toml does not contain a tool.setuptools_scm section` (https://github.com/sagemath/sage/actions/r uns/6409373032/job/17400573034?pr=36400#step:8:3978) These warnings show up at build time, but also in runtime uses of Cython, where it causes doctest failures. Here we do the update (for no specific reason other than to be up to date) and implement the workarounds. <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36400 Reported by: Matthias Köppe Reviewer(s): Dima Pasechnik, Tobias Diez
2 parents f26c184 + 2dad61b commit e73e211

File tree

11 files changed

+78
-8
lines changed

11 files changed

+78
-8
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tarball=setuptools_scm-VERSION.tar.gz
2-
sha1=b8c9447fe6dfc44107c9cbd2fd82314aad3cb95e
3-
md5=0df4e7fd923e4983cd65786efaa0e0d0
4-
cksum=3196930290
5-
upstream_url=https://pypi.io/packages/source/s/setuptools_scm/setuptools_scm-VERSION.tar.gz
1+
tarball=setuptools_scm-VERSION-py3-none-any.whl
2+
sha1=cfde7254fe351b69cd4bf02e1b57e0b3c59aa9a6
3+
md5=4c054a609965886703ede26a4ba3206d
4+
cksum=1360813947
5+
upstream_url=https://pypi.io/packages/py3/s/setuptools_scm/setuptools_scm-VERSION-py3-none-any.whl
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
typing_extensions | setuptools pip wheel tomli packaging $(PYTHON)
1+
packaging setuptools tomli typing_extensions | pip $(PYTHON)
22

33
----------
44
All lines of this file are ignored except the first.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.5
1+
8.0.4

build/pkgs/setuptools_scm/spkg-install.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

pkgs/sage-conf/setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
from setuptools import setup
2+
from setuptools.dist import Distribution
3+
4+
# setuptools plugins considered harmful:
5+
# If build isolation is not in use and setuptools_scm is installed,
6+
# then its file_finders entry point is invoked, which we don't need.
7+
# And with setuptools_scm 8, we get more trouble:
8+
# LookupError: pyproject.toml does not contain a tool.setuptools_scm section
9+
# LookupError: setuptools-scm was unable to detect version ...
10+
# We just remove all handling of "setuptools.finalize_distribution_options" entry points.
11+
Distribution._removed = staticmethod(lambda ep: True)
12+
213
setup()

pkgs/sage-conf_pypi/setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@
66
import fnmatch
77

88
from setuptools import setup
9+
from setuptools.dist import Distribution
910
from distutils.command.build_scripts import build_scripts as distutils_build_scripts
1011
from setuptools.command.build_py import build_py as setuptools_build_py
1112
from setuptools.command.editable_wheel import editable_wheel as setuptools_editable_wheel
1213
from setuptools.errors import SetupError
1314

1415

16+
# setuptools plugins considered harmful:
17+
# If build isolation is not in use and setuptools_scm is installed,
18+
# then its file_finders entry point is invoked, which we don't need.
19+
# And with setuptools_scm 8, we get more trouble:
20+
# LookupError: pyproject.toml does not contain a tool.setuptools_scm section
21+
# LookupError: setuptools-scm was unable to detect version ...
22+
# We just remove all handling of "setuptools.finalize_distribution_options" entry points.
23+
Distribution._removed = staticmethod(lambda ep: True)
24+
25+
1526
class build_py(setuptools_build_py):
1627

1728
def run(self):

pkgs/sage-docbuild/setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#!/usr/bin/env python
22

33
from setuptools import setup
4+
from setuptools.dist import Distribution
5+
6+
# setuptools plugins considered harmful:
7+
# If build isolation is not in use and setuptools_scm is installed,
8+
# then its file_finders entry point is invoked, which we don't need.
9+
# And with setuptools_scm 8, we get more trouble:
10+
# LookupError: pyproject.toml does not contain a tool.setuptools_scm section
11+
# LookupError: setuptools-scm was unable to detect version ...
12+
# We just remove all handling of "setuptools.finalize_distribution_options" entry points.
13+
Distribution._removed = staticmethod(lambda ep: True)
414

515
setup()

pkgs/sage-setup/setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#!/usr/bin/env python
22

33
from setuptools import setup
4+
from setuptools.dist import Distribution
5+
6+
# setuptools plugins considered harmful:
7+
# If build isolation is not in use and setuptools_scm is installed,
8+
# then its file_finders entry point is invoked, which we don't need.
9+
# And with setuptools_scm 8, we get more trouble:
10+
# LookupError: pyproject.toml does not contain a tool.setuptools_scm section
11+
# LookupError: setuptools-scm was unable to detect version ...
12+
# We just remove all handling of "setuptools.finalize_distribution_options" entry points.
13+
Distribution._removed = staticmethod(lambda ep: True)
414

515
setup()

pkgs/sage-sws2rst/setup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
from setuptools import setup
2+
from setuptools.dist import Distribution
3+
4+
# setuptools plugins considered harmful:
5+
# If build isolation is not in use and setuptools_scm is installed,
6+
# then its file_finders entry point is invoked, which we don't need.
7+
# And with setuptools_scm 8, we get more trouble:
8+
# LookupError: pyproject.toml does not contain a tool.setuptools_scm section
9+
# LookupError: setuptools-scm was unable to detect version ...
10+
# We just remove all handling of "setuptools.finalize_distribution_options" entry points.
11+
Distribution._removed = staticmethod(lambda ep: True)
12+
213
setup()

src/sage/misc/cython.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,14 @@ def cython(filename, verbose=0, compile_message=False,
422422

423423
# This emulates running "setup.py build" with the correct options
424424
dist = Distribution()
425+
# setuptools plugins considered harmful:
426+
# If build isolation is not in use and setuptools_scm is installed,
427+
# then its file_finders entry point is invoked, which we don't need.
428+
# And with setuptools_scm 8, we get more trouble:
429+
# LookupError: pyproject.toml does not contain a tool.setuptools_scm section
430+
# LookupError: setuptools-scm was unable to detect version ...
431+
# We just remove all handling of "setuptools.finalize_distribution_options" entry points.
432+
dist._removed = staticmethod(lambda ep: True)
425433
dist.ext_modules = [ext]
426434
dist.include_dirs = includes
427435
buildcmd = dist.get_command_obj("build")

0 commit comments

Comments
 (0)