Skip to content

Use Local copy of poetry installer #553

@tomuben

Description

@tomuben

Summary

Local copy of poetry installer

Details

Add a local copy of the Python script from https://install.python-poetry.org in order to avoid failures of the python-environment action caused by connection failures to https://install.python-poetry.org.

Background & Context

There are many failures of the python-environment workflows this week, for example see here.

The following is a comment in the heading of the Python installer script from https://install.python-poetry.org

This script will install Poetry and its dependencies in an isolated fashion.

It will perform the following steps:
    * Create a new virtual environment using the built-in venv module, or the virtualenv zipapp if venv is unavailable.
      This will be created at a platform-specific path (or `$POETRY_HOME` if `$POETRY_HOME` is set:
        - `~/Library/Application Support/pypoetry` on macOS
        - `$XDG_DATA_HOME/pypoetry` on Linux/Unix (`$XDG_DATA_HOME` is `~/.local/share` if unset)
        - `%APPDATA%\pypoetry` on Windows
    * Update pip inside the virtual environment to avoid bugs in older versions.
    * Install the latest (or a given) version of Poetry inside this virtual environment using pip.
    * Install a `poetry` script into a platform-specific path (or `$POETRY_HOME/bin` if `$POETRY_HOME` is set):
        - `~/.local/bin` on Unix
        - `%APPDATA%\Python\Scripts` on Windows
    * Attempt to inform the user if they need to add this bin directory to their `$PATH`, as well as how to do so.
    * Upon failure, write an error log to `poetry-installer-error-<hash>.log and restore any previous environment.

This script performs minimal magic, and should be relatively stable. However, it is optimized for interactive developer
use and trivial pipelines. If you are considering using this script in production, you should consider manually-managed
installs, or use of pipx as alternatives to executing arbitrary, unversioned code from the internet. If you prefer this
script to alternatives, consider maintaining a local copy as part of your infrastructure.

For full documentation, visit https://python-poetry.org/docs/#installation.

=> The script is supposed to be "relatively stable" and recommend to use a local copy.

Examples

References

Task(s)

Metadata

Metadata

Assignees

Labels

refactoringCode improvement without behavior change

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions