-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Fix isolated build helper scripts #1629
Conversation
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.
.
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.
Requires tests 👍 The changelog is added via towncrier not directly, see example.rst.
Ah shoot, I'll remove CHANGELOG edit and use towncrier. Also will figure out CI issue. |
src/tox/helper/build_isolated.py
Outdated
@@ -4,7 +4,7 @@ | |||
backend_spec = sys.argv[2] | |||
backend_obj = sys.argv[3] if len(sys.argv) >= 4 else None | |||
|
|||
backend = __import__(backend_spec, fromlist=[None]) | |||
backend = __import__(backend_spec) |
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.
this should be fromlist=['_trash']
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.
👍 - Though also I think the "right" answer on Python 3.3 and above is to use importlib.import_module
. So I'll split this into two branches, so that this __import__
branch can be removed once support for old Python versions is removed.
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 disagree, please just use __import__
, no need to involve a separate module to do exactly the same thing
As for adding tests, I'd appreciate any suggestions on how a testing strategy could be established here. The "problem case" which this PR fixes is when the backend_spec is just a base package, e.g. no submodule:
I'm not aware of any PEP 517 backends other than As such - any advice on suitable testing strategy here? |
For tests you can provide an inline back end and define that to not have that part. There's another pr open for that you could check it out. By the way Ive tried maturin last week and liked it 🙏 |
I've reverted to just use
\o/ glad to hear! |
Test successfully added and lint fixed. I think this might be good to go? |
Fixes #1344
The PEP 517 isolated build uses these helper scripts, but they invoke the
__import__
builtin incorrectly.