Skip to content

Add support for PEP-610 editable packages (#12313) #12315

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hashstat
Copy link

@hashstat hashstat commented Mar 9, 2022

Description

Discover paths to editable packages by looking at direct_url.json files
-- installed by pip when the -e/--editable flag is used -- and add to
the package search paths.

Closes #12313

This PR adds paths defined in *.dist-info/direct_url.json files, where the appropriate keys exist (including editable set to true), to the list of paths discovered in .pth files.

Test Plan

Tests were added to ensure paths were found using the new functionality without breaking the old. The tests add two new test packages, one of them typed. The tests then ensure that the paths for the editable projects are found and that the typed package is detected as such, while the untyped package is rejected as untyped.

Another .dist-info directory was added for the foo package just to ensure that the new feature doesn't break with other direct reference packages.

I also tested this on the real-world package where I first discovered the issue.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Find paths to editable packages by looking at direct_url.json files --
installed by pip when the -e/--editable flag is used -- and add to the
package search paths.
@hashstat hashstat force-pushed the editable-packages-with-direct_url_json-file branch from 3656491 to 9e11f9d Compare June 2, 2022 22:15
@hauntsaninja hauntsaninja marked this pull request as draft August 6, 2022 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support finding "editable" type annotated packages made editable through direct_url.json
1 participant