Skip to content
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

Always use pep 517 when the 'wheel' package is absent #11871

Merged
merged 13 commits into from
Mar 27, 2023

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Mar 18, 2023

closes #8559

TODO

  • remove with_wheel fixture
  • check this test with colons in console scripts
  • check what to do with test_debian_egg_name_workaround

@sbidoul sbidoul added this to the 23.1 milestone Mar 18, 2023
@sbidoul sbidoul force-pushed the always-use-pep517-when-wheel-absent-sbi branch from 666f3e3 to ffcf590 Compare March 18, 2023 12:20
@sbidoul
Copy link
Member Author

sbidoul commented Mar 18, 2023

Lots of tests are failing, because they now try to install setuptools in an isolated env and they don't have access to it.

Let's see how it goes when we always install wheel in our test venvs.

@sbidoul sbidoul force-pushed the always-use-pep517-when-wheel-absent-sbi branch 2 times, most recently from 887d236 to b159aff Compare March 18, 2023 14:18
@sbidoul
Copy link
Member Author

sbidoul commented Mar 18, 2023

Alright, only test failing: test_uninstall_entry_point_colon_in_name. Apparently wheels don't support console scripts with a colon in their name while setup.py install did? Does anyone have insight to provide on this?

@sbidoul sbidoul force-pushed the always-use-pep517-when-wheel-absent-sbi branch from 30c0ad2 to d32afa6 Compare March 18, 2023 15:14
@sbidoul sbidoul mentioned this pull request Mar 18, 2023
1 task
@sztomi
Copy link

sztomi commented Mar 19, 2023

If it is now required for complete functionality, shouldn't pip explicitly depend on wheel?

@sbidoul
Copy link
Member Author

sbidoul commented Mar 19, 2023

If it is now required for complete functionality, shouldn't pip explicitly depend on wheel?

Actually, wheel is not required, just like setuptools is not required.

If you try to install a project that has a setup.py but no pyproject.toml in an environment that does not have setuptools or wheel, pip will create a temporary build environment, install the default build backend (i.e. setuptools) in it (and wheel too, because the setuptools requires wheel), build a wheel in that temporary environment, and install the wheel in your environment.

Unless you use --no-build-isolation, in which case you are responsible to install the build dependencies yourself.

@uranusjr
Copy link
Member

The spec says

The name may contain any characters except =, but it cannot start or end with any whitespace character, or start with [. For new entry points, it is recommended to use only letters, numbers, underscores, dots and dashes (regex [\w.-]+).

So wheel not supporting : is technically a bug (in the sense that it does not cover the spec), unless we change the spec to make the final sentence stronger than a recommendation.

@sbidoul
Copy link
Member Author

sbidoul commented Mar 19, 2023

Thanks for the investigation @uranusjr. I think I'll mark this test xfail.

@sbidoul
Copy link
Member Author

sbidoul commented Mar 19, 2023

Ok, I marked that last test about colons in console script names xfail.

I'm done with the setup.py install removal, but all PRs are currently red due to that pesky MacOS issue.

@sbidoul sbidoul added project: setuptools Related to setuptools type: deprecation Related to deprecation / removal. labels Mar 21, 2023
This test will become useless anyway when we remove setup.py install
support.
Adapt to the removal of the setup.py install code path.
wheel is now installed in our test venv by default.
console_script entrypoints declarations are stricter when
we don't use setup.py install.
We now look for "Building wheel" instead of "running setup.py install"
Run setup.py install manually since pip does not do it anymore.
We install wheel by default in our test env.
This was supported by setup.py install but not by our wheel
installation logic.
@pradyunsg pradyunsg force-pushed the always-use-pep517-when-wheel-absent-sbi branch from a6dc754 to 8f52335 Compare March 27, 2023 10:55
@pradyunsg
Copy link
Member

I've rebased this on the latest main, via the GitHub UI.

It would be annoying if you see an error about setuptools, install it,
and only be greeted by another error telling you to install wheel.
So we combine the two into one.
@sbidoul sbidoul merged commit 123e8a4 into pypa:main Mar 27, 2023
@sbidoul sbidoul deleted the always-use-pep517-when-wheel-absent-sbi branch March 27, 2023 14:21
@sbidoul
Copy link
Member Author

sbidoul commented Mar 27, 2023

Thanks for the review, folks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
project: setuptools Related to setuptools type: deprecation Related to deprecation / removal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate call to setup.py install when wheel is absent for source distributions without pyproject.toml
4 participants