Skip to content

Commit

Permalink
src/sage/misc/cython.py: Fix the workaround for setuptools_scm in the…
Browse files Browse the repository at this point in the history
… runtime env
  • Loading branch information
mkoeppe committed Oct 26, 2023
1 parent 07a2afd commit 8272fe5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sage/misc/cython.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,20 @@ def cython(filename, verbose=0, compile_message=False,
os.curdir)

# 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)
class Distribution_no_finalize_distribution_options(Distribution):
@staticmethod
def _removed(ep):
return True

dist = Distribution_no_finalize_distribution_options()
dist.ext_modules = [ext]
dist.include_dirs = includes
buildcmd = dist.get_command_obj("build")
Expand Down

0 comments on commit 8272fe5

Please sign in to comment.