From 8361771801e3c37c0546a5c948f9e8b5dd1582c0 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 4 Oct 2023 10:01:02 -0700 Subject: [PATCH 1/4] build/pkgs/setuptools_scm: Update to 8.0.4, change to wheel package --- build/pkgs/setuptools_scm/checksums.ini | 10 +++++----- build/pkgs/setuptools_scm/dependencies | 2 +- build/pkgs/setuptools_scm/package-version.txt | 2 +- build/pkgs/setuptools_scm/spkg-install.in | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 build/pkgs/setuptools_scm/spkg-install.in diff --git a/build/pkgs/setuptools_scm/checksums.ini b/build/pkgs/setuptools_scm/checksums.ini index d4c9ee1a391..fd10a17aea2 100644 --- a/build/pkgs/setuptools_scm/checksums.ini +++ b/build/pkgs/setuptools_scm/checksums.ini @@ -1,5 +1,5 @@ -tarball=setuptools_scm-VERSION.tar.gz -sha1=b8c9447fe6dfc44107c9cbd2fd82314aad3cb95e -md5=0df4e7fd923e4983cd65786efaa0e0d0 -cksum=3196930290 -upstream_url=https://pypi.io/packages/source/s/setuptools_scm/setuptools_scm-VERSION.tar.gz +tarball=setuptools_scm-VERSION-py3-none-any.whl +sha1=cfde7254fe351b69cd4bf02e1b57e0b3c59aa9a6 +md5=4c054a609965886703ede26a4ba3206d +cksum=1360813947 +upstream_url=https://pypi.io/packages/py3/s/setuptools_scm/setuptools_scm-VERSION-py3-none-any.whl diff --git a/build/pkgs/setuptools_scm/dependencies b/build/pkgs/setuptools_scm/dependencies index 7dd3b6e8f6e..e8117f8900b 100644 --- a/build/pkgs/setuptools_scm/dependencies +++ b/build/pkgs/setuptools_scm/dependencies @@ -1,4 +1,4 @@ - typing_extensions | setuptools pip wheel tomli packaging $(PYTHON) +packaging setuptools tomli typing_extensions | pip $(PYTHON) ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/setuptools_scm/package-version.txt b/build/pkgs/setuptools_scm/package-version.txt index 2be8aeb6b14..50c496d20c6 100644 --- a/build/pkgs/setuptools_scm/package-version.txt +++ b/build/pkgs/setuptools_scm/package-version.txt @@ -1 +1 @@ -7.0.5 +8.0.4 diff --git a/build/pkgs/setuptools_scm/spkg-install.in b/build/pkgs/setuptools_scm/spkg-install.in deleted file mode 100644 index deba1bb42bb..00000000000 --- a/build/pkgs/setuptools_scm/spkg-install.in +++ /dev/null @@ -1 +0,0 @@ -cd src && sdh_pip_install . From f65ae6b45fd517ab0180e77eb0e92e3ce500803c Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 3 Oct 2023 17:50:42 -0700 Subject: [PATCH 2/4] Add more workarounds for setuptools_scm + --no-build-isolation --- src/setup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/setup.py b/src/setup.py index f0dd4054bb7..0f28b20d6dc 100755 --- a/src/setup.py +++ b/src/setup.py @@ -11,6 +11,7 @@ import sys import time from setuptools import setup, find_namespace_packages +from setuptools.dist import Distribution from distutils import log import multiprocessing.pool @@ -33,6 +34,15 @@ import multiprocessing multiprocessing.set_start_method('fork', force=True) +# setuptools plugins considered harmful: +# If build isolation is not in use and setuptools_scm is installed, +# then its file_finders entry point is invoked, which we don't need. +# And with setuptools_scm 8, we get more trouble: +# LookupError: pyproject.toml does not contain a tool.setuptools_scm section +# LookupError: setuptools-scm was unable to detect version ... +# We just remove all handling of "setuptools.finalize_distribution_options" entry points. +Distribution._removed = staticmethod(lambda ep: True) + # ######################################################## # ## Set source directory # ######################################################## From 063896851ce74540bb0279baf6c58c92170c541a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 4 Oct 2023 13:58:57 -0700 Subject: [PATCH 3/4] src/sage/misc/cython.py: Suppress a warning caused by setuptools_scm 8 --- src/sage/misc/cython.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py index 347b2e896d8..a33f9c361d5 100644 --- a/src/sage/misc/cython.py +++ b/src/sage/misc/cython.py @@ -415,6 +415,14 @@ def cython(filename, verbose=0, compile_message=False, # This emulates running "setup.py build" with the correct options dist = Distribution() + # setuptools plugins considered harmful: + # If build isolation is not in use and setuptools_scm is installed, + # then its file_finders entry point is invoked, which we don't need. + # And with setuptools_scm 8, we get more trouble: + # LookupError: pyproject.toml does not contain a tool.setuptools_scm section + # LookupError: setuptools-scm was unable to detect version ... + # We just remove all handling of "setuptools.finalize_distribution_options" entry points. + dist._removed = staticmethod(lambda ep: True) dist.ext_modules = [ext] dist.include_dirs = includes buildcmd = dist.get_command_obj("build") From 114a610bd241d44740534ec3c9d17d43c244983b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 4 Oct 2023 15:15:21 -0700 Subject: [PATCH 4/4] pkgs/sage-*: Add setuptools_scm workaround to setup.py --- pkgs/sage-conf/setup.py | 11 +++++++++++ pkgs/sage-conf_pypi/setup.py | 11 +++++++++++ pkgs/sage-docbuild/setup.py | 10 ++++++++++ pkgs/sage-setup/setup.py | 10 ++++++++++ pkgs/sage-sws2rst/setup.py | 11 +++++++++++ 5 files changed, 53 insertions(+) diff --git a/pkgs/sage-conf/setup.py b/pkgs/sage-conf/setup.py index 8bf1ba938af..afa05966816 100644 --- a/pkgs/sage-conf/setup.py +++ b/pkgs/sage-conf/setup.py @@ -1,2 +1,13 @@ from setuptools import setup +from setuptools.dist import Distribution + +# setuptools plugins considered harmful: +# If build isolation is not in use and setuptools_scm is installed, +# then its file_finders entry point is invoked, which we don't need. +# And with setuptools_scm 8, we get more trouble: +# LookupError: pyproject.toml does not contain a tool.setuptools_scm section +# LookupError: setuptools-scm was unable to detect version ... +# We just remove all handling of "setuptools.finalize_distribution_options" entry points. +Distribution._removed = staticmethod(lambda ep: True) + setup() diff --git a/pkgs/sage-conf_pypi/setup.py b/pkgs/sage-conf_pypi/setup.py index a689f4d617b..9ebe45c12fe 100644 --- a/pkgs/sage-conf_pypi/setup.py +++ b/pkgs/sage-conf_pypi/setup.py @@ -5,12 +5,23 @@ import platform from setuptools import setup +from setuptools.dist import Distribution from distutils.command.build_scripts import build_scripts as distutils_build_scripts from setuptools.command.build_py import build_py as setuptools_build_py from setuptools.command.egg_info import egg_info as setuptools_egg_info from distutils.errors import (DistutilsSetupError, DistutilsModuleError, DistutilsOptionError) +# setuptools plugins considered harmful: +# If build isolation is not in use and setuptools_scm is installed, +# then its file_finders entry point is invoked, which we don't need. +# And with setuptools_scm 8, we get more trouble: +# LookupError: pyproject.toml does not contain a tool.setuptools_scm section +# LookupError: setuptools-scm was unable to detect version ... +# We just remove all handling of "setuptools.finalize_distribution_options" entry points. +Distribution._removed = staticmethod(lambda ep: True) + + class build_py(setuptools_build_py): def run(self): diff --git a/pkgs/sage-docbuild/setup.py b/pkgs/sage-docbuild/setup.py index beda28e8216..cd42da33ffe 100644 --- a/pkgs/sage-docbuild/setup.py +++ b/pkgs/sage-docbuild/setup.py @@ -1,5 +1,15 @@ #!/usr/bin/env python from setuptools import setup +from setuptools.dist import Distribution + +# setuptools plugins considered harmful: +# If build isolation is not in use and setuptools_scm is installed, +# then its file_finders entry point is invoked, which we don't need. +# And with setuptools_scm 8, we get more trouble: +# LookupError: pyproject.toml does not contain a tool.setuptools_scm section +# LookupError: setuptools-scm was unable to detect version ... +# We just remove all handling of "setuptools.finalize_distribution_options" entry points. +Distribution._removed = staticmethod(lambda ep: True) setup() diff --git a/pkgs/sage-setup/setup.py b/pkgs/sage-setup/setup.py index beda28e8216..cd42da33ffe 100644 --- a/pkgs/sage-setup/setup.py +++ b/pkgs/sage-setup/setup.py @@ -1,5 +1,15 @@ #!/usr/bin/env python from setuptools import setup +from setuptools.dist import Distribution + +# setuptools plugins considered harmful: +# If build isolation is not in use and setuptools_scm is installed, +# then its file_finders entry point is invoked, which we don't need. +# And with setuptools_scm 8, we get more trouble: +# LookupError: pyproject.toml does not contain a tool.setuptools_scm section +# LookupError: setuptools-scm was unable to detect version ... +# We just remove all handling of "setuptools.finalize_distribution_options" entry points. +Distribution._removed = staticmethod(lambda ep: True) setup() diff --git a/pkgs/sage-sws2rst/setup.py b/pkgs/sage-sws2rst/setup.py index 8bf1ba938af..afa05966816 100644 --- a/pkgs/sage-sws2rst/setup.py +++ b/pkgs/sage-sws2rst/setup.py @@ -1,2 +1,13 @@ from setuptools import setup +from setuptools.dist import Distribution + +# setuptools plugins considered harmful: +# If build isolation is not in use and setuptools_scm is installed, +# then its file_finders entry point is invoked, which we don't need. +# And with setuptools_scm 8, we get more trouble: +# LookupError: pyproject.toml does not contain a tool.setuptools_scm section +# LookupError: setuptools-scm was unable to detect version ... +# We just remove all handling of "setuptools.finalize_distribution_options" entry points. +Distribution._removed = staticmethod(lambda ep: True) + setup()