Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9775 from uranusjr/new-resolver-direct-url-with-e…
…xtras Correctly resolve requirement requested both as non-extra URL and non-URL with extras
- Loading branch information
Showing
6 changed files
with
169 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
New resolver: When a requirement is requested both via a direct URL | ||
(``req @ URL``) and via version specifier with extras (``req[extra]``), the | ||
resolver will now be able to use the URL to correctly resolve the requirement | ||
with extras. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import re | ||
|
||
from pip._internal.models.direct_url import DIRECT_URL_METADATA_NAME, DirectUrl | ||
|
||
|
||
def get_created_direct_url(result, pkg): | ||
direct_url_metadata_re = re.compile( | ||
pkg + r"-[\d\.]+\.dist-info." + DIRECT_URL_METADATA_NAME + r"$" | ||
) | ||
for filename in result.files_created: | ||
if direct_url_metadata_re.search(filename): | ||
direct_url_path = result.test_env.base_path / filename | ||
with open(direct_url_path) as f: | ||
return DirectUrl.from_json(f.read()) | ||
return None |