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

Add support to install poetry plugins #53

Closed
pbk0 opened this issue Sep 19, 2021 · 7 comments · Fixed by #155
Closed

Add support to install poetry plugins #53

pbk0 opened this issue Sep 19, 2021 · 7 comments · Fixed by #155

Comments

@pbk0
Copy link

pbk0 commented Sep 19, 2021

Poetry 1.2+ will now support plugins. It will be a good idea to support installing plugins if the poetry version is 1.2+.
That is by adding the below lines to the main.sh script:

<...>
plugins=$7
<...>
poetry plugin add $plugins
<...>
@sondrelg
Copy link
Member

Thanks for bringing this up @pbk0 👏

I just have a few questions, in case you already know:

  • What happens when you run poetry plugin add <plugin>? Does it make changes to the lockfile or does it start a process separate from the normal poetry install?
  • How can I test plugin installation locally? I tried this, without luck:
❯ poetry self update --preview            
Updating Poetry to 1.2.0a2

Updating dependencies
Resolving dependencies... (4.3s)

Package operations: 0 installs, 1 update, 0 removals

  - Updating charset-normalizer (2.0.5 -> 2.0.6)

Updating the poetry script

Poetry (1.2.0a2) is installed now. Great!

❯ poetry plugin add poetry-version-plugin
The command "plugin" is not defined.

@pbk0
Copy link
Author

pbk0 commented Sep 19, 2021

Can you make sure if you have multiple poetry installations? (try which/where poetry)
Also, I am assuming the poetry installation is isolated. I faced some issues with stale poetry installations. So maybe clean things up and then try installing 1.2.0a2
Below script might be useful

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > get-poetry.py
python get-poetry.py --uninstall
rm get-poetry.py

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py > install-poetry.py
python install-poetry.py --uninstall
python install-poetry.py --version 1.2.0a2
rm install-poetry.py

poetry --version

BTW the plugin gets installed in isolation alongside isolated poetry installation and it does not mess up with local installations lockfile.

How can I test plugin installation locally? I tried this, without luck:

If I am correct this can happen only if poetry is installed via pip instead of install-poetry.py script

@sondrelg
Copy link
Member

sondrelg commented Sep 19, 2021

I think you were right about dual installations, got it to work now 👍

So the solution would just be something like specifying:

- uses: snok/install-poetry@v1
  with:
    version: 1.2.0a2
    plugins: |
        poetry-plugin-a
        poetry-plugin-b

or

- uses: snok/install-poetry@v1
  with:
    version: 1.2.0a2
    plugins: poetry-plugin-a, poetry-plugin-b

or

- uses: snok/install-poetry@v1
  with:
    version: 1.2.0a2
    plugins: poetry-plugin-a poetry-plugin-b

Where the plugins inputs should be parsed as a list, and installed in main.sh by running poetry plugin add {parsed list}?

That sounds doable 👍

Would you be interested in creating a PR for this @pbk0?

@pbk0
Copy link
Author

pbk0 commented Sep 19, 2021

Yes, it's doable. I will try and send you PR. Anyways the plugins are a new feature and don't expect it to stabilize soon.

@pbk0 pbk0 closed this as completed Sep 19, 2021
@connortann
Copy link
Contributor

May I ask about the status of this feature? I see the issue was closed, but I'm not sure if the feature was implemented.

PS - thanks for creating this plugin. I'm a recent convert to the Poetry ecosystem, it's awesome.

@sondrelg
Copy link
Member

sondrelg commented Feb 4, 2022

The feature was not implemented, so re-opening 👍 I don't have time to implement this currently, but a PR is very welcome 🙂

@sondrelg sondrelg reopened this Feb 4, 2022
@connortann
Copy link
Contributor

connortann commented Feb 4, 2022

I'd be happy to attempt a PR!

Quick question: what is the purpose of main.sh, should that be updated too? It appears to duplicate the installation script in action.yml , and I'm not sure if/how it gets invoked.

EDIT: Ah, it's explained in scripts/README.md . So, looks like just action.yml should be updated with new features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants