Skip to content

Commit

Permalink
sagemathgh-36400: build/pkgs/setuptools_scm: Update to 8.0.4, add f…
Browse files Browse the repository at this point in the history
…ixes 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 sagemath#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 sagemath#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 sagemath#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
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36400
Reported by: Matthias Köppe
Reviewer(s): Dima Pasechnik, Tobias Diez
  • Loading branch information
Release Manager committed Oct 16, 2023
2 parents e5ba2a8 + 2dad61b commit 93580b8
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 8 deletions.
10 changes: 5 additions & 5 deletions build/pkgs/setuptools_scm/checksums.ini
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build/pkgs/setuptools_scm/dependencies
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion build/pkgs/setuptools_scm/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.5
8.0.4
1 change: 0 additions & 1 deletion build/pkgs/setuptools_scm/spkg-install.in

This file was deleted.

11 changes: 11 additions & 0 deletions pkgs/sage-conf/setup.py
Original file line number Diff line number Diff line change
@@ -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()
11 changes: 11 additions & 0 deletions pkgs/sage-conf_pypi/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,23 @@
import fnmatch

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.editable_wheel import editable_wheel as setuptools_editable_wheel
from setuptools.errors import SetupError


# 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):
Expand Down
10 changes: 10 additions & 0 deletions pkgs/sage-docbuild/setup.py
Original file line number Diff line number Diff line change
@@ -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()
10 changes: 10 additions & 0 deletions pkgs/sage-setup/setup.py
Original file line number Diff line number Diff line change
@@ -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()
11 changes: 11 additions & 0 deletions pkgs/sage-sws2rst/setup.py
Original file line number Diff line number Diff line change
@@ -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()
8 changes: 8 additions & 0 deletions src/sage/misc/cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,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")
Expand Down
10 changes: 10 additions & 0 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
# ########################################################
Expand Down

0 comments on commit 93580b8

Please sign in to comment.