-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Drop support for py3.6; introduce test_distutils, refactor hpy.devel, fix setuptools integration #338
Conversation
… and installing hpy modules work
…erride other commands
…y test, create one at the beginning and clone it muliple times. This is much faster
… universal ABI module. Also, introduce a @monkeypatch decorator which is a much nicer way to monkey-patch bdist_egg.write_stub
…nal AssertionError
All the logic was to replace has_ext_modules with our own version, we our version is the very same code as the distutils' one. I'm not even sure whether it was ever necessary, because distutils does not seem to have changed since py3.7 at least. So, I think that this is safe to remove, but I hope it's not a Chesterton's fence.
@hodgestar btw, maybe you have an opinion about be42806? |
For each subcommand (e.g. It's possible that this was only needed for the old distutils from outside setuptools? This stuff is so twisty it's hard to remember anything for more than a few seconds. |
… this from CI and hope it works
…with the old version of setuptools
yes, I understood this part of the logic. But my point is that we were substituding def build_has_ext_modules(self):
return self.distribution.has_ext_modules() and this is the one in CPython's distutils: in 3.6.0 was already identical: The default implementation works out of the box with hpy because it delegates to
Could be, but according to Maybe there was a random version of setuptools for which this change was necessary? Anyway, I wondered whether I was missing anything obvious and/or non-obvious-but-that-you-could-remember, but apart from that I'm pretty sure that the current logic works, because all the tests (old and new) are passing :). Also, the branch is ready to be merged IMHO. |
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.
Thanks, @antocuni . Good to see a PR from you again 🙂
if resource.endswith(".hpy.so"): | ||
log.info("stub file already created for %s", resource) | ||
return | ||
write_stub.super(resource, pyfile) |
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.
When building NumPy/HPy and doing rm -rf build
before python3 setup.py --hpy-abi=universal build_ext -if
(or when building the first time), then it fails with:
error: [Errno 2] No such file or directory: 'build/lib.macosx-12.3-x86_64-3.8-pydebug/numpy/core/_multiarray_umath.py'
This is because the parent dir build/lib.macosx-12.3-x86_64-3.8-pydebug/numpy/core
does not yet exist.
Could we maybe create the parent dir of the stub here (if it does not exist)?
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.
I don't understand. This is a new bug, or an existing one?
Not controversial. 3.6 is EOL. |
…ng on here. Also, put the string '3.7' so that it's easier to grep when we will want to drop support for it
I wanted to fix #322, but then I realized that it was more involved than expected, because depending on which version of setuptools you use, you might end up monkey-patching either the stdlib distutils or the setuptools vendored distutils.
To better understand the various problems and to aid the refactoring, I introduced
test_distutils.py
: some of the logic was already tested bytest_pof.sh
, but eventually we should migrate all the tests to test_distutils.py, IMHO.