Skip to content
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

Respect $POETRY_HOME if set #128

Merged
merged 2 commits into from
Aug 4, 2023
Merged

Respect $POETRY_HOME if set #128

merged 2 commits into from
Aug 4, 2023

Conversation

mahmoudhossam
Copy link
Contributor

Closes #127

@sondrelg
Copy link
Member

Have you tested this on your project @mahmoudhossam? If you replace snok/install-poetry@v1 with mahmoudhossam/install-poetry@44a56c8b4d9b7199fd3b34e1ec73b8679b4281c0 it should run from your fork.

Would be helpful to know before moving forward.

@miigotu
Copy link
Collaborator

miigotu commented Jul 15, 2023

This looks good to me.

@mahmoudhossam
Copy link
Contributor Author

Have you tested this on your project @mahmoudhossam? If you replace snok/install-poetry@v1 with mahmoudhossam/install-poetry@44a56c8b4d9b7199fd3b34e1ec73b8679b4281c0 it should run from your fork.

Would be helpful to know before moving forward.

Good idea, I'll test it and get back to you next week.

@mahmoudhossam
Copy link
Contributor Author

So it didn't work, trying it out in a private project and testing with act still doesn't work

Using the action like this:

- name: Install poetry
        uses: mahmoudhossam/install-poetry@44a56c8b4d9b7199fd3b34e1ec73b8679b4281c0
        env:
          POETRY_HOME: /usr

Results in this output:

[API/test] ⭐ Run Main Install poetry
[API/test]   🐳  docker cp src=/Users/mahmoud/.cache/act/mahmoudhossam-install-poetry@44a56c8b4d9b7199fd3b34e1ec73b8679b4281c0/ dst=/var/run/act/actions/mahmoudhossam-install-poetry@44a56c8b4d9b7199fd3b34e1ec73b8679b4281c0/
[API/test] ⭐ Run Main Install and configure Poetry
[API/test]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/4-composite-0.sh] user= workdir=
|
| Setting Poetry installation path as /root/.local
|
| Installing Poetry 👷
|
| 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:
|
| /root/.local/bin
|
| You can uninstall at any time by executing this script with the --uninstall option,
| and these changes will be reverted.
|
  Installing Poetry (1.5.1): Done
|
| Poetry (1.5.1) is installed now. Great!
|
| To get started you need Poetry's bin directory (/root/.local/bin) in your `PATH`
| environment variable.
|
| Add `export PATH="/root/.local/bin:$PATH"` to your shell configuration file.
|
| Alternatively, you can call Poetry explicitly with `/root/.local/bin/poetry`.
|
| You can test that everything is set up by executing:
|
| `poetry --version`
|
|
| Installation completed. Configuring settings 🛠
|
| Done ✅
|
| If you are creating a venv in your project, you can activate it by running 'source .venv/bin/activate'. If you're running this in an OS matrix, you can use 'source $VENV' instead, as an OS agnostic option
[API/test]   ✅  Success - Main Install and configure Poetry

Not sure how to debug this since my bash-fu isn't that great.

@sondrelg Any ideas?

@sondrelg
Copy link
Member

Testing this locally:

# test.sh

INSTALL_PATH="${POETRY_HOME:-$HOME/.local}"

echo "$INSTALL_PATH"

that syntax seems to work on ubuntu

❯ POETRY_HOME=some_path ./test.sh
some_path

❯ ./test.sh                      
/home/sondrelg/.local

@sondrelg
Copy link
Member

This looks good to me 👍 I'm unfortunately going away for two weeks for summer, so I'm a little hesitant to release this now in case it breaks anything. I'll be back to release in ~12 days.

In the meantime, if you @miigotu want to do it, feel free 🙂

@sondrelg
Copy link
Member

sondrelg commented Aug 4, 2023

Sorry for the delay, and thanks for the contribution! I'll try to get this released shortly 🥳

@sondrelg sondrelg merged commit 20bc4d3 into snok:main Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not respect POETRY_HOME
3 participants