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 building packages with backend-path in pyproject.toml #7394

Merged
merged 7 commits into from
Nov 25, 2019

Conversation

takluyver
Copy link
Member

All that's needed is passing the field from pyproject.toml through to Pep517HookCaller.

Closes gh-6599

@uranusjr
Copy link
Member

Would this be a good chance to refactor the return value into a named tuple? An optional two-tuple is kind of OK, but I’m starting to feel a tiny bit uncomfortable to read Optional[Tuple[List[str], str, List[str]]]..

@takluyver
Copy link
Member Author

Sounds reasonable. Shall I call it BuildsystemDetails?

@uranusjr
Copy link
Member

I’m thinking BuildSystemDetail is probably better (capital S) since build-system is two words in pyproject.toml. Otherwise LGTM.

@takluyver
Copy link
Member Author

Was detail (singular) a deliberate change? I was following PackageDetails elsewhere in the code to prefer the plural.

Copy link
Member

@chrahunt chrahunt left a comment

Choose a reason for hiding this comment

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

A few minor comments. I think it's okay that we're leaning a bit on pep517 for the more thorough testing of this feature, but I would add an integration test or two (for a local project using backend-path and a dependency) since there's going to be a lot of change in the coming months in InstallRequirement.

src/pip/_internal/pyproject.py Show resolved Hide resolved
tests/functional/test_pep517.py Outdated Show resolved Hide resolved
tests/functional/test_pep517.py Outdated Show resolved Hide resolved
@takluyver
Copy link
Member Author

I added a test which uses a local backend and an external dependency together.

@chrahunt
Copy link
Member

For the additional test I was thinking more along the lines of invoking pip as a sub-process to install a pep517 project, similar to this test, and then validating that the install succeeded via the in-tree backend. The backend could write a file (path provided via environment variable) to be checked in the test and then delegate to the equivalent functions in setuptools.build_meta.

This helps us guard against regressions caused anywhere else in the currently tangled interactions between InstallRequirement and the classes and functions that operate on it.

@takluyver
Copy link
Member Author

I've added a higher-level test as @chrahunt requested, but I've left the namedtuple in place for the moment. I'll change it again if it looks like there's a consensus for another option.

@pfmoore pfmoore merged commit 4f6a965 into pypa:master Nov 25, 2019
@pfmoore
Copy link
Member

pfmoore commented Nov 25, 2019

Thanks for addressing this issue @takluyver!

@takluyver takluyver deleted the i6599 branch November 26, 2019 09:07
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 26, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BackendUnavailable when specifying backend-path
5 participants