-
Notifications
You must be signed in to change notification settings - Fork 53
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
install-poetry breaks with Poetry 1.2.0 #89
Comments
Would you mind sharing your workflow configuration (just the install-poetry step)? I don't think it breaks the action. AFAICT lockfiles generated by < 1.2 are incompatible with 1.2 and vice versa, so if your lockfile was generated with - uses: snok/install-poetry@v1
with:
version: 1.1.14 Should work, while - uses: snok/install-poetry@v1 Will not. Does that make sense, or do you think it's broken for 1.2 with 1.2 lockfiles? |
Hello :) |
Ah yes. And I see you've specified latest as the version. Does it work if you change it to 1.1.14? |
Yes |
Ok great. If you want to use 1.2.0 in your github actions run you first need to upgrade Poetry to 1.2.0 locally, then run |
Hello. You got it. Sorry I should not have cut the Github Actions output: the error we get is |
I see. That's unfortunate if that's the case. I'm not able to look at this right now, but PRs are welcome 👍 |
No worries. I will make a PR if I manage to find out what broke. Let's not close this issue as I assume many people will come here to report the issue. |
Also seeing this issue 👍 |
#90 edit:// this seems to fix it - there was a trailing |
I added two comments in the PR, but would be good to get your take too @deronnax. I tried updating two projects to Poetry version 1.2.0, and neither one had any problems running the action. Just to understand what is broken, what is different between these two workflows and yours? |
Discussion continued in #90 |
@sondrelg no clue, our workflow is pretty standard, my bet is that it's all related to the dropping of Python 3.6 from Poetry 1.2.0. We will pin the Poetry version and wait until we move to the next python version to see if it reproduces, which I bet it won't. In between, thank you very much for your time |
To avoid the brownout, add the following to the poetry install step until you upgrade to 1.2.0
|
Projects are dropping python3.6 because it is no longer considered secure as |
I guess you gotta make sure to have
More on --> https://github.com/python-poetry/poetry/blob/master/pyproject.toml#L47 |
Same issue here, but only with Here is the link to the yml file: https://github.com/Musaefendic/icao-emissions/blob/96d41895570a1aefe21cab13f32f906f44d6f6ab/.github/workflows/tests.yml
did I set up my .yml wrong? |
@Musaefendic is it your intention not using |
good catch! It is an error after several unsuccessful attempts. ✅ windows-latest and ubuntu-latest i got the same error:
|
I wonder if your action is caching a really old version 1, and it's not using the newest version. Maybe try You can also try activating it manually |
@Musaefendic also, restore venv cache BEFORE installing poetry. |
And if it still doesn't work I'd start with this after installing poetry - name: Check environment
run: |
echo $PATH
echo $VENV
ls ./local/bin |
And I'm most sure snok/install-poetry@lint could work, because he added the path to the final commands. |
good intuition! if I delete |
To clear the GH Actions cache, it's a new feature since June 22. See this SO post https://stackoverflow.com/a/64819132 Clearing the cache
1st CI Run after clearing the cache.Link to my tests.yml
cache after this CI run
2nd CI RUNsame tests.yml
|
I'm on holidays almost without internet for a few days, but should have time to review a PR if anyone has time to investigate 👍 Otherwise, I'll be happy to look at this on Tuesday 🙂 |
You could always use a different cache key or add a restore key that's different than what it's using now. Poetry version changed but your pyproject.toml didn't, so the next change to your pyprotect.toml would have done it also. |
I'm having the exact same issue (exit code 127, only on macOS-latest) with the following workflow. Is there something I should change?
|
fixed it by adding
And replacing
with
|
* refactor github action to perform linting before testing and use a typical poetry installation workflow * fix syntax errors in github action config * reformatted files with black * reorganized imports with isort * ignore swap files so we don't accidentally commit them * create user group, add python executables to path, and upgrade pip. I changed the default CMD to 'bash' because 'poetry shell' wasn't working and I couldn't figure out why... * simplify github workflow into just one job there's no reason to separate concerns between linting and testing now, plus I didn't want to have repetetitive jobs (although I could eventually templatize the setup steps) * changed to an available python version on github runners * workaround bug in snok/install-poetry action that gives 'poetry: command not found' for the latest version (1.2.0) * went back to poetry 1.2.0 but added ~/.local/bin to the system path in the github action the reason for this reversion is described in more detail here: python-poetry/poetry#4242 essentially there isn't backwards compatibility with 1.2.0 lock files and old poetry versions (like the 1.1.14 I switched it to before in the github action), and it couldn't find 'setuptools' because of this * explicitly list directory, maybe because /home/tristan isn't resolved correctly? * update poetry in dev dockerfile, lock updates with this new version, and upgrade the poetry-core version for building these were recommended from the issue with the snok/install-poetry github action documented at snok/install-poetry#89 * add path logging so i can figure out what's going on in the github action * add env variable to hopefully prevent issues with upgrade * maybe this is caused by 3.6 being deprecated? comments in the previously linked issue suggested this could be why * run linting and testing steps in the github action job in a poetry shell otherwise, the job will fail because the tools are libraries aren't actually available in the environment * poetry run wasn't accepted by github as valid for the 'shell' field so I added a bash -c to see if that works * that didn't work either so calling poetry run on every command separately * fix spacing in run command * remove 3.10 runtime because I realized I didn't actually test this works * take out pointless echos and exclude poetry .venv from flake8 linting because otherwise it will lint dependency source files we have no control over * fix a bunch of linting errors * reformat files and fix a couple remaining linting errors * make isort compatible with black so they don't keep reformatting endlessly -- had to sacrifice some comments because I couldn't figure out how to get it to work without this (will try later) * fix recursive import by importing tqdm modules from the library directly * fix permissions on parent directory of the devcontainer's working directory to allow for the unit testing module to download some testing data from https://github.com/pyrfume/pyrfume-data * add back the line that I thought was a pointless import but actually has relevant logic... * fix last lingering linting error, left as a TODO * drop support for python 3.6 (not even tested in actions and losing support anyways soon) to upgrade pandas to a compatible version so that tests fully pass * remove macos runtime because for some reason it can't install public files from api.github.com/repos, even though I tested the same install locally on macOS with all of the failing python versions * don't fail fast so we can see the results of runs on all python distributions. also I reincluded macos just to see how far they get
Poetry 1.2.0 changes a lot of things about how path and virtualenvs are handled, and it breaks install-poetry:
The text was updated successfully, but these errors were encountered: