Skip to content

Commit 8272fe5

Browse files
author
Matthias Koeppe
committed
src/sage/misc/cython.py: Fix the workaround for setuptools_scm in the runtime env
1 parent 07a2afd commit 8272fe5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/sage/misc/cython.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,20 @@ def cython(filename, verbose=0, compile_message=False,
421421
os.curdir)
422422

423423
# This emulates running "setup.py build" with the correct options
424-
dist = Distribution()
424+
#
425425
# setuptools plugins considered harmful:
426426
# If build isolation is not in use and setuptools_scm is installed,
427427
# then its file_finders entry point is invoked, which we don't need.
428428
# And with setuptools_scm 8, we get more trouble:
429429
# LookupError: pyproject.toml does not contain a tool.setuptools_scm section
430430
# LookupError: setuptools-scm was unable to detect version ...
431431
# We just remove all handling of "setuptools.finalize_distribution_options" entry points.
432-
dist._removed = staticmethod(lambda ep: True)
432+
class Distribution_no_finalize_distribution_options(Distribution):
433+
@staticmethod
434+
def _removed(ep):
435+
return True
436+
437+
dist = Distribution_no_finalize_distribution_options()
433438
dist.ext_modules = [ext]
434439
dist.include_dirs = includes
435440
buildcmd = dist.get_command_obj("build")

0 commit comments

Comments
 (0)