Skip to content

Commit

Permalink
Support POETRY_HOME for install (#794)
Browse files Browse the repository at this point in the history
Allow the `POETRY_HOME` environment variable to be passed during installation to change the default installation directory of `~/.poetry`:

```
POETRY_HOME=/etc/poetry python get-poetry.py
```
  • Loading branch information
dcramer authored and kasteph committed Oct 10, 2019
1 parent 134aef1 commit 2966ab1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Added a `env use` command to control the Python version used by the project.
- Added a `env list` command to list the virtualenvs associated with the current project.
- Added a `env remove` command to delete virtualenvs associated with the current project.
- Added support for `POETRY_HOME` declaration within `get-poetry.py`.
- Added support for declaring a specific source for dependencies.
- Added support for disabling PyPI and making another repository the default one.
- Added support for declaring private repositories as secondary.
Expand Down
6 changes: 6 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ python get-poetry.py --uninstall
POETRY_UNINSTALL=1 python get-poetry.py
```

By default, Poetry is installed into the user's platform-specific home directory. If you wish to change this, you may define the `POETRY_HOME` environment variable:

```bash
POETRY_HOME=/etc/poetry python get-poetry.py
```

If you want to install prerelease versions, you can do so by passing `--preview` to `get-poetry.py`
or by using the `POETRY_PREVIEW` environment variable:

Expand Down
2 changes: 1 addition & 1 deletion get-poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def expanduser(path):


HOME = expanduser("~")
POETRY_HOME = os.path.join(HOME, ".poetry")
POETRY_HOME = os.environ.get("POETRY_HOME") or os.path.join(HOME, ".poetry")
POETRY_BIN = os.path.join(POETRY_HOME, "bin")
POETRY_ENV = os.path.join(POETRY_HOME, "env")
POETRY_LIB = os.path.join(POETRY_HOME, "lib")
Expand Down

0 comments on commit 2966ab1

Please sign in to comment.