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

Fix pip install --pre for packages with dependencies defined in pyproject.toml and setup.py #10692

Merged
merged 5 commits into from
Jul 10, 2022

Conversation

t20100
Copy link
Contributor

@t20100 t20100 commented Nov 29, 2021

This PR makes pip install --pre works when a build dependency defined both in setup.py and pyproject.toml is available as a pre-release by allowing pre-releases during check_requirements.

closes #10222

news/10222.bugfix.rst Outdated Show resolved Hide resolved
news/10222.bugfix.rst Outdated Show resolved Hide resolved
Comment on lines +806 to +816
pyproject_path.write_text(
"[build-system]\n"
f'requires = ["setuptools", "wheel", "{depends_package}"]\n'
'build-backend = "setuptools.build_meta"\n'
)
setup_py_path = local_dir.joinpath("setup.py")
setup_py_path.write_text(
"from setuptools import setup\n"
f"setup(name='dummy', setup_requires=['{depends_package}'])\n"
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, these should likely be two separate test cases, one for each config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue arises when build dependencies are both declared in setup.py and pyproject.toml, else it is fine.
Maybe that's a case that's not supported, but it worked until v21.2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh huh interesting. I guess there’s some conflict with pip and setuptools’s build dependency population logic.

Copy link
Member

@DiddiLeija DiddiLeija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good! Well done @t20100!

Would you like to rebase this PR, so we can merge easier?

@t20100
Copy link
Contributor Author

t20100 commented Dec 6, 2021

Sure, I just rebased to main.

@EwoutH
Copy link

EwoutH commented May 31, 2022

Any update on this effort? I would very much like this feature!

@uranusjr uranusjr added this to the 22.2 milestone Jun 1, 2022
@uranusjr
Copy link
Member

uranusjr commented Jun 1, 2022

Leaving this open in case someone else wants to raise some issues, but otherwise this goes to 22.2.

@sbidoul sbidoul merged commit 99818e1 into pypa:main Jul 10, 2022
@t20100 t20100 deleted the fix-install-pre branch July 11, 2022 07:08
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing from source with --pre fails under specific condition with pip 21.2.1
5 participants