-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove pip subprocesses, replace with unearth
- Loading branch information
Showing
22 changed files
with
675 additions
and
898 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
groups: | ||
actions-infrastructure: | ||
patterns: | ||
- actions/* |
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 |
---|---|---|
@@ -1,2 +1,11 @@ | ||
"""Display dependency tree of Python distribution""" | ||
from johnnydep.lib import * | ||
from types import SimpleNamespace | ||
|
||
|
||
config = SimpleNamespace( | ||
env=None, | ||
index_url=None, | ||
extra_index_url=None, | ||
) | ||
|
||
from .lib import * |
This file was deleted.
Oops, something went wrong.
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,41 @@ | ||
from urllib.parse import urlparse | ||
from urllib.request import build_opener | ||
from urllib.request import HTTPBasicAuthHandler | ||
from urllib.request import HTTPPasswordMgrWithDefaultRealm | ||
|
||
from structlog import get_logger | ||
|
||
|
||
log = get_logger(__name__) | ||
|
||
|
||
def _urlretrieve(url, f, data=None, auth=None): | ||
if auth is None: | ||
opener = build_opener() | ||
else: | ||
# https://docs.python.org/3/howto/urllib2.html#id5 | ||
password_mgr = HTTPPasswordMgrWithDefaultRealm() | ||
username, password = auth | ||
top_level_url = urlparse(url).netloc | ||
password_mgr.add_password(None, top_level_url, username, password) | ||
handler = HTTPBasicAuthHandler(password_mgr) | ||
opener = build_opener(handler) | ||
res = opener.open(url, data=data) | ||
log.debug("resp info", url=url, headers=res.info()) | ||
f.write(res.read()) | ||
f.flush() | ||
|
||
|
||
def download_dist(url, f, index_url, extra_index_url): | ||
auth = None | ||
if index_url: | ||
parsed = urlparse(index_url) | ||
if parsed.username and parsed.password and parsed.hostname == urlparse(url).hostname: | ||
# handling private PyPI credentials in index_url | ||
auth = (parsed.username, parsed.password) | ||
if extra_index_url: | ||
parsed = urlparse(extra_index_url) | ||
if parsed.username and parsed.password and parsed.hostname == urlparse(url).hostname: | ||
# handling private PyPI credentials in extra_index_url | ||
auth = (parsed.username, parsed.password) | ||
_urlretrieve(url, f, auth=auth) |
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
Oops, something went wrong.