python-poetry / python-poetry/install.python-poetry.org
Installation of poetry in default location for macOS not working for framework builds
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 255
- Forks
- 65
- Ø Merge
- 2 Std. 48 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
After poetry installation, poetry is not a recognized command.
I am running python 3.11 on macOS. I inspected the installation code and I see the following function:
def bin_dir(version: Optional[str] = None) -> Path:
if os.getenv("POETRY_HOME"):
return Path(os.getenv("POETRY_HOME"), "bin").expanduser()
user_base = site.getuserbase()
if WINDOWS:
bin_dir = os.path.join(user_base, "Scripts")
else:
bin_dir = os.path.join(user_base, "bin")
return Path(bin_dir)
It seems like site.getuserbase() resolves to ~/Library/Python/3.11. That is not part of my PATH and therefore I get poetry: command not found.
Since I am configuring poetry with github-actions, I ended up doing the following:
python -c "import os, site; print(os.path.join(site.getuserbase(), 'bin'))" >> $GITHUB_PATH
I was just wondering if site-packages is the best default location for poetry and I presented an example on how sometimes poetry is not installed by default in a location included by PATH. Usually the decision is to install it in /usr/bin or /usr/local/bin.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Funktion bin_dir des Installers und reproduziere das Verhalten von Python 3.11 unter macOS, bei dem site.getuserbase() ~/Library/Python/3.11 zurückgibt. Vergleiche den resultierenden bin-Pfad mit der PATH-Behandlung im Installationsablauf und dem Workaround in GitHub Actions. Erledigt ist die Aufgabe, wenn die Standardinstallation entweder in PATH liegt oder die beabsichtigte PATH-Einrichtung klar definiert und getestet ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- github-actions, macos, python
- Bereich
- cli, devops, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100