-
Notifications
You must be signed in to change notification settings - Fork 2
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
Poetry install performance enhancement for low-resource environments #27
Conversation
f42038e
to
b0de042
Compare
69e085a
to
707a144
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for making this and backing all choices with data!
download_file_with_curl(url, str(archive)) | ||
return archive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
download_file_with_curl(url, str(archive)) | |
return archive | |
try: | |
download_file_with_curl(url, str(archive)) | |
return archive | |
except: | |
# If we failed to download with curl, give it another try with the local implementation | |
logging.exception('failed to download archive with curl. trying again') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh-oh, this wasn't addressed.
Co-authored-by: lhchavez <[email protected]>
…etry into th-test-modern-install
|
||
url = str(link) | ||
if os.getenv("POETRY_DOWNLOAD_WITH_CURL") == "1" and url.startswith("https://files.pythonhosted.org/"): | ||
if self.supports_fancy_output(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fancy!
download_file_with_curl(url, str(archive)) | ||
return archive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uh-oh, this wasn't addressed.
Why?
poetry install is slow for large libraries especially for free accounts. This PR should cut install time by ~50% on average.
Context:
Changes
.pythonlibs
(with pip use the--user
option andPYTHONUSERBASE
to do this), we made a change to wheel_installer.py that routes file writes to the userbase and usersite directories. This as flagged behindPOETRY_USE_USER_SITE
.POETRY_DOWNLOAD_WITH_CURL
and it is only activated for URLs startinghttps://files.pythonhosted.org/
, because otherwise it could be a private package repo that requires authentication.The plan is to turn on
POETRY_DOWNLOAD_WITH_CURL
andPOETRY_USE_USER_SITE
for all repls and turn offPOETRY_INSTALLER_PARALLEL
for free accounts (running install jobs in parallel hurts repls with only 1 cpu) via a wrapper script for poetry.Testing