-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Implement a new bootstrapping method #3706
Conversation
4251ea4
to
e1dcdf1
Compare
e2d63d0
to
43db06d
Compare
43db06d
to
99d3ae5
Compare
3a80f16
to
8a506ec
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.
Over all looks great. Couple of suggestions.
One comment on the virtual environment creation options to ensure some resilience for the installation. Otherwise good to go.
@@ -17,42 +17,76 @@ The [complete documentation](https://python-poetry.org/docs/) is available on th | |||
## Installation | |||
|
|||
Poetry provides a custom installer that will install `poetry` isolated | |||
from the rest of your system by vendorizing its dependencies. This is the | |||
recommended way of installing `poetry`. | |||
from the rest of your system. |
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.
Not a blocker, but should we link to our documentation here instead of maintaining duplication information here? Might be good for the brevity of the README as well.
I tried this script and it failed C:\Users\User> (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/8a506eceb90e7b7d1bc1cd837d303c32e8b03bec/install-poetry.py
-UseBasicParsing).Content | python -
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
C:\Users\User\AppData\Roaming\Python\Scripts
You can uninstall at any time by executing this script with the --uninstall opti
on,
and these changes will be reverted.
Installing Poetry (1.1.5)
Installing Poetry (1.1.5): Creating environment
Traceback (most recent call last):
File "<stdin>", line 808, in <module>
File "<stdin>", line 804, in main
File "<stdin>", line 417, in run
File "<stdin>", line 439, in install
File "<stdin>", line 503, in make_env
ModuleNotFoundError: No module named 'virtualenv' It's a fresh install of Python 3.8 if that matters, it doesn't even have pip installed. EDIT: installing pip fixed that. |
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.
Spun out the improvement regarding virtualenv bootstrapping to https://github.com/python-poetry/poetry/issues/3843
Otherwise looks good to me.
@sdispater this should be good to go after a rebase and conflict resolution. |
8a506ec
to
90b2b9e
Compare
python-poetry/poetry#3706 python-poetry/poetry#3870 python-poetry/poetry#4056 Poetry has a new install script, added in python-poetry/poetry#3706. The old get-poetry.py install script is not compatible with Python 3.10, so the new install-poetry.py script will be used. Docker builds and GitHub Actions workflows will be updated to use `POETRY_HOME=/opt/poetry` consistently. As of Poetry 1.1.7, there may be complications in Docker when using install-poetry.py without venvs (`POETRY_VIRTUALENVS_CREATE=false`). While installing dependencies, the following error is frequently seen: ```text OSError Could not find a suitable TLS CA certificate bundle, invalid path: /opt/poetry/venv/lib/python3.9/site-packages/certifi/cacert.pem at /opt/poetry/venv/lib/python3.9/site-packages/requests/adapters.py:227 in cert_verify ``` Poetry may be incorrectly attempting to read from its virtualenv if it's not respecting `POETRY_VIRTUALENVS_CREATE` (python-poetry/poetry#3870). Downstream steps also do not respect `POETRY_VIRTUALENVS_CREATE`, so the application does not run.
python-poetry/poetry#3706 Poetry has a new install script, install-poetry.py, which alters the requirements for adding Poetry to `$PATH`. One simple way to add Poetry to `$PATH` is to `export PATH=$HOME/.local/bin:$PATH`, which adds the ~/.local/bin directory (it's also used by pipx, so it's a good option) to `$PATH`, then `export POETRY_HOME=$HOME/.local`, which tells Poetry to install itself into the ~/.local/bin directory.
python-poetry/poetry#3706 python-poetry/poetry#3870 python-poetry/poetry#4056 Poetry has a new install script, added in python-poetry/poetry#3706. The old get-poetry.py install script is not compatible with Python 3.10. This commit will update the GitHub Actions workflow to use the new install-poetry.py script, with `POETRY_HOME=/opt/poetry` for consistent installs independent of user account, and will also update the workflow to use a virtualenv and run commands with `poetry run` to avoid issues with `POETRY_VIRTUALENVS_CREATE=false`. As of Poetry 1.1.7, there may be complications with install-poetry.py run without venvs (`POETRY_VIRTUALENVS_CREATE=false`). An error is seen: ```text OSError Could not find a suitable TLS CA certificate bundle, invalid path: /opt/poetry/venv/lib/python3.9/site-packages/certifi/cacert.pem at /opt/poetry/venv/lib/python3.9/site-packages/requests/adapters.py:227 in cert_verify ``` Poetry may be incorrectly attempting to read from its virtualenv if it's not respecting `POETRY_VIRTUALENVS_CREATE` (python-poetry/poetry#3870). Downstream steps also do not respect `POETRY_VIRTUALENVS_CREATE`, so the application does not run. To avoid these issues, `poetry run` can be prepended to commands to prompt Poetry to use its virtualenv. Additionally, Poetry errors out with a `JSONDecodeError` when attempting to install packages with Python 3.10 (python-poetry/poetry#4210). Python 3.10 support will be postponed until Poetry is compatible.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This method introduces a new script
install-poetry.py
which implements a new way to bootstrap Poetry. The advantages of this new method are:poetry
script.poetry
script.As to what the script actually does:
%APPDATA%\\pypoetry
on Windows~/Library/Application Support/pypoetry
on MacOS${XDG_DATA_HOME}/pypoetry
(or~/.local/share/pypoetry
if it's not set) on UNIX systems${POETRY_HOME}
if it's set.poetry
script in the Python user directory (or${POETRY_HOME/bin}
ifPOETRY_HOME
is set).Resolves: #3534
Resolves: #2030
Resolves: #3819
Resolves: #3828
Resolves: #3187
Pull Request Check List