poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Ensure writable paths are used for wheel installer

Open abn opened this issue 1 year ago • 0 comments

This change fixes an issue where when system environment is used as a destination for wheel installation as a user without access to system site packages, installation fails with permission error.

Functionally, this now follows the same behaviour as when a package is installed to user site.

Resolves: #8408

podman run --rm -i --entrypoint bash docker.io/apache/airflow:2.7.1-python3.11 <<EOF
set -xe
python -m pip install --disable-pip-version-check -q pipx
pipx install https://api.github.com/repos/abn/poetry/tarball/fix-system-env-installer-paths
export POETRY_VIRTUALENVS_CREATE=false
poetry new demo
pushd demo
poetry add cowsay
pip show cowsay
EOF
console.log

+ python -m pip install --disable-pip-version-check -q pipx
+ pipx install https://api.github.com/repos/abn/poetry/tarball/fix-system-env-installer-paths
creating virtual environment...
creating shared libraries...
upgrading shared libraries...
determining package name from 'https://api.github.com/repos/abn/poetry/tarball/fix-system-env-installer-paths'...
creating virtual environment...
installing poetry from spec 'https://api.github.com/repos/abn/poetry/tarball/fix-system-env-installer-paths'...
  installed package poetry 1.8.0.dev0, installed using Python 3.11.5
  These apps are now globally available
    - poetry
done! ✨ 🌟 ✨
+ export POETRY_VIRTUALENVS_CREATE=false
+ POETRY_VIRTUALENVS_CREATE=false
+ poetry new demo
Created package demo in demo
+ pushd demo
/opt/airflow/demo /opt/airflow
+ poetry add cowsay
Skipping virtualenv creation, as specified in config file.
Using version ^6.1 for cowsay

Updating dependencies
Resolving dependencies...

Package operations: 1 install, 0 updates, 0 removals

  - Installing cowsay (6.1)

Writing lock file
+ pip show cowsay
Name: cowsay
Version: 6.1
Summary: The famous cowsay for GNU/Linux is now available for python
Home-page: https://github.com/VaasuDevanS/cowsay-python
Author: Vaasudevan Srinivasan
Author-email: [email protected]
License: GNU-GPL
Location: /home/airflow/.local/lib/python3.11/site-packages
Requires: 
Required-by: 

abn avatar Feb 25 '24 02:02 abn