-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation issues when SETUPTOOLS_USE_DISTUTILS is local #2257
Comments
Thank you for reporting this. Yes, it's an issue that the current implementation requires that setuptools be imported before distutils. We're working on another hack that will make that ordering less important in many cases.
It's highly unlikely. If setuptools is imported first, it very early ensures that |
I made a sample project: https://github.com/matham/cython_demo_project. Master passes: https://github.com/matham/cython_demo_project/actions/runs/183666627. |
Thanks Matham for the simple repro. Using it, I was able to replicate the issue with a simple
From here, I'm hoping to trace the cause. |
Alright. I've figured out the issue, and it appears it's unrelated to monkey-patching (thank goodness) and is actually just a flaw in the fix for pypa/distutils#5. The flaw is that |
… spawn call does not simply fail to execute. Ref pypa/setuptools#2257.
I merged the distutils changes at c2fcb01 and cut 49.2.1 with the fixes. Please report back if that doesn't fix the issue properly. |
…on 49.2.1 Hugo van Kemenade (1): The PyPA has adopted the PSF code of conduct Jason R. Coombs (12): Add docs on porting from distutils. Revert "Render logo in the readme." Revert "Rename logo assets to remove project name and 'logo', which are implied by the context." Revert "Merge pull request #2229 from cajhne/logo001" Revert "Add banner to main docs page" Suppress ImportError for winreg as the module is only available on some platforms. Allows unit testing of module on non-Windows platforms. Add a unit test for testing spawn. Ref pypa/distutils#5. In TestSpawn.test_concurrent_safe, use CheckThread to ensure that the spawn call does not simply fail to execute. Ref pypa/setuptools#2257. In CCompiler, allow keyword arguments to be passed to spawn calls. Ref pypa/setuptools#2257 and pypa/distutils#5. In _msvccompiler.MSVCCompiler.spawn, use correct capitalization for PATH environment variable. Fixes failing test and fixes pypa/setuptools#2257. Add changelog. Ref #2257. Bump version: 49.2.0 → 49.2.1 Paul Ganssle (1): Remove issue templates
…0 to version 49.2.1 Hugo van Kemenade (1): The PyPA has adopted the PSF code of conduct Jason R. Coombs (12): Add docs on porting from distutils. Revert "Render logo in the readme." Revert "Rename logo assets to remove project name and 'logo', which are implied by the context." Revert "Merge pull request #2229 from cajhne/logo001" Revert "Add banner to main docs page" Suppress ImportError for winreg as the module is only available on some platforms. Allows unit testing of module on non-Windows platforms. Add a unit test for testing spawn. Ref pypa/distutils#5. In TestSpawn.test_concurrent_safe, use CheckThread to ensure that the spawn call does not simply fail to execute. Ref pypa/setuptools#2257. In CCompiler, allow keyword arguments to be passed to spawn calls. Ref pypa/setuptools#2257 and pypa/distutils#5. In _msvccompiler.MSVCCompiler.spawn, use correct capitalization for PATH environment variable. Fixes failing test and fixes pypa/setuptools#2257. Add changelog. Ref #2257. Bump version: 49.2.0 → 49.2.1 Paul Ganssle (1): Remove issue templates
https://github.com/pypa/setuptools/releases/tag/v49.6.0 https://github.com/pypa/setuptools/blob/master/CHANGES.rst * #2129: In pkg_resources, no longer detect any pathname ending in .egg as a Python egg. Now the path must be an unpacked egg or a zip file. * #2306: When running as a PEP 517 backend, setuptools does not try to install ``setup_requires`` itself. They are reported as build requirements for the frontend to install. * #2310: Updated vendored packaging version to 20.4. * #2300: Improve the ``safe_version`` function documentation * #2297: Once again, in stubs prefer exec_module to the deprecated load_module. * #2316: Removed warning when ``distutils`` is imported before ``setuptools`` when ``distutils`` replacement is not enabled. * #2259: Setuptools now provides a .pth file (except for editable installs of setuptools) to the target environment to ensure that when enabled, the setuptools-provided distutils is preferred before setuptools has been imported (and even if setuptools is never imported). Honors the SETUPTOOLS_USE_DISTUTILS environment variable. pypa/setuptools#2257: Fixed two flaws in distutils._msvccompiler.MSVCCompiler.spawn. instead of #10561 [ci skip-build-wheels]
After #2212 I tried setting
SETUPTOOLS_USE_DISTUTILS
to local, but ran into issues compiling.Setuptools version is
49.2.0
. The first issue was that I got the following error on my system:Interestingly, it only happened locally and not the on the CI (on the CI the subsequent error happened), I'm not sure why. So, I traced the issue to our
setup.py
looking as follow:I fixed it by importing
setuptools
beforedistutils
. That's where I ran into the second issue that I cannot fix. Here's the error:Locally I added the this beofre calling
super
:print(super().spawn)
and that printed<bound method CCompiler.spawn of <distutils._msvccompiler.MSVCCompiler object at 0x00000269AA79CE80>>
,Somehow it still used
distutils
version of_msvccompiler
. Is it possible that the usage of local distutils is patched too late afterdistutils._msvccompiler
is already imported?The text was updated successfully, but these errors were encountered: