-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fallback to pep517 if setup.py is present and setuptools cannot be imported #10717
Conversation
I'm inclined to agree with the suggestion @uranusjr made on Discourse - if there's no |
I'd argue that when the user explicitly used |
That combined basically means something like:
|
The “can’t do |
2af305c
to
7fb607b
Compare
elif use_pep517 is None: | ||
use_pep517 = has_pyproject | ||
use_pep517 = has_pyproject or not importlib.util.find_spec("setuptools") |
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.
Note that the setuptools check can be technically made much sooner in this function, but this way, it is avoided when not necessary. Not sure which approach is better.
FWIW, I was hoping to go down a different avenue here: dc217bb That presents a clearer error message instead of opting these projects into PEP 517. |
At least to me, opting to PEP 517 when setuptools is not installed sounds like a more user-friendly thing to do than erroring out (and gradually downloading a lesser and lesser version of the package only to error again and again). |
Yea... #10655 is annoying. It seems to me that there's reasonable agreement that we should stop backtracking on build failures, which combined with better presentation of build failures (I'll file this as a PR once #10703 merges) could be a more "complete" solution here; rather than needing to change this one special case? |
Even without backtracking, I still think that using PEP 517 when setuptools is not present is the nicer thing to do, but I won't fight you on that. A better error report and no backtracking makes this good enough for me. |
7fb607b
to
eb1c8f3
Compare
I was trying to solve the CI issues, but I ran into some test failures. I don't think they are caused by this PR, because I am getting the same failures when I run the tests on the main branch locally. If that's the case, I think PR is ready for review. |
Those are caused by #10742, don’t mind them. |
Is this ready to be merged, or do we need to change something? |
eb1c8f3
to
e7a790a
Compare
What si the next step here? |
Anyone else wants to take a look? If not I’m inclined to include this in the 22.1 release. |
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.
One minor point, but otherwise LGTM
So, use a long line or split the string literal? |
Ultimately whatever stops black whining about the layout, I don't really care 🙂 If I were writing this without regard for black, I'd use a long line. |
I added a commit to split the literal. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
0dfd5b8
to
7776a6d
Compare
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.
Ok with the concept and implementation LGTM. Does our test suite lend itself to adding a test case for this ?
This needs a rebase to fix CI. |
Thanks @hrnciar! Hopefully me short-circuiting the CI because of my lack of patience won't bite me (eg: because the linters were updated). :) |
This is WIP PR without any documentation or tests. I'd like to first know your opinion whether the idea is acceptable. Thank you.