-
-
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
Expose a subset of distutils C-compiler interface as public API #3445
Conversation
The tests from It can be anything very simple, as long as it exercises the required APIs, just to make sure there is no regression in the future. |
I believe that works for me (pyzmq). Before I refactored things in zeromq/pyzmq#1632, I also called |
@minrk turns out I think I don't actually need to re-export the |
thanks @abravalheri, I've added a first minimal test, let me know if you think anything more is needed |
56e0384
to
4ea7a36
Compare
I don't need CCompiler, really just |
Ok thank you both for your quick responses. Failures look unrelated (at least to my untrained eye), so let's updraft this |
4ea7a36
to
f6436cd
Compare
Thank you very much @neutrinoceros. I will prefer to leave the review/final decision on this one to Jason, maybe he has something different in mind. |
f6436cd
to
5f3a097
Compare
Seeing that CI is working correctly for all other PRs I'll take that back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing that CI is working correctly for all other PRs I'll take that back.
I was able to fix my own test, but the remaining issues are hard to decipher for me, any help would be appreciated
I did some tests here and it would seem that just importing customize_compiler
changes some global state. Any other test following test_ccompiler
that depends on a different aspect of the global state may break.
I believe that we can counteract this with 2 measures:
- Be lazy about importing
disutils.sysconfig
- Try to force
distutils.sysconfig
to be executed again if any of the following tests depends on it.
I added some code changes suggestions with this in mind, but just as a starting point. Please feel free to further iterate on them, or completely ignore the suggestions.
Co-authored-by: Anderson Bravalheri <[email protected]>
Co-authored-by: Anderson Bravalheri <[email protected]>
Ok, so now we only see 2 flake8 errors. I suppose you can get rid of them with |
Thanks. I appreciate all the work here, but I'm going to suggest we not simply expose these names until we understand better the use-cases driving these names. Currently, the names are exposed under |
AFAIC you can close this if there's nothing you wish to keep from it. I don't mind that this solution isn't retained, and will happily settle for any other :) |
Summary of changes
Re-expose a subset of distutils C-compiler interface as
setuptools.ccompiler
, as suggested by @abravalheri.I went with the most conservative approach and exposed only the components I know are needed downstream.
I'll happily add more of them on request (ping @minrk), or expose the whole
distutils.ccompiler
module if prefered by maintainers.Closes #2806
I'm not sure what kind of tests this would require. Would it suffice to check that these names are defined ?
Pull Request Checklist
changelog.d/
].(See [documentation][PR docs] for details)