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

Fix publish workflow #6

Merged
merged 14 commits into from
Aug 11, 2023
Merged

Fix publish workflow #6

merged 14 commits into from
Aug 11, 2023

Conversation

phackstock
Copy link
Contributor

@phackstock phackstock commented Aug 10, 2023

I've been playing around with this for a little while now.

  1. Issue was related to JRubics/poetry-publish (details: Detected Git repository, but failed because of dubious ownership JRubics/poetry-publish#39) solved by downgrading from v1.17 -> v1.16
  2. Issue was that the pg_config command was not found which is apparently required for building psycopg2.
    I tried the following fixes:
  • Bumping the version of psycopg2 (didn't work)
  • Installing libpq-dev (didn't work and was already installed anyway)
  • Switch psycopg2 to psycopg2-binary which is the pre-built version (apparently not recommended in production...)

The third option worked though (https://github.com/iiasa/ixmp4/actions/runs/5821805161, failed because of the version number as it was not triggered from a tag) so that sure what to do...

@phackstock phackstock requested a review from meksor August 10, 2023 13:42
@phackstock
Copy link
Contributor Author

Seems like my update to poety.lock broke some of the linting and formatting checks, reverting.

@danielhuppmann
Copy link
Member

I remember that psycopg2 gives me a headache every time I install ixmp4 in a new environment...

@phackstock
Copy link
Contributor Author

Played around a bit more and it seems that using psycopg2-binary is the only way to run the publish workflow...

@phackstock
Copy link
Contributor Author

The strange thing is that it seems all the other workflows are able to install the package just fine ...
I'll try that.

@phackstock
Copy link
Contributor Author

Looking good now https://test.pypi.org/project/ixmp4/0.2.0rc5/

@danielhuppmann
Copy link
Member

🎉

@phackstock
Copy link
Contributor Author

phackstock commented Aug 11, 2023

I think I figured out what was happening yesterday and why I couldn't get the workflow to work with JRubics/poetry-publish.
The strange part was that I got an error that pg_config was missing. When I than ran sudo apt-get install libpq-dev (to install pg_config) I got a message saying that it was already installed and that didn't fix the error.
Now I've realized that JRubics/poetry-publish runs in it's own docker container inside the GitHub action. pg_config was just installed on the host system, the ubuntu-latest runner from GitHub but not the container of the action.
That's why when I changed the publish workflow to not use JRubics/poetry-publish, everything is not working fine.

@phackstock
Copy link
Contributor Author

Just tested the install from testpypi, looks all good. The only reason that the publish workflow is failing here is because I pushed the v0.2.0rc5 tag in parallel and the workflow triggered by the tag ran faster (https://github.com/iiasa/ixmp4/actions/runs/5823260950).
All good to merge from my side and release ixmp4 0.2.0.

@danielhuppmann
Copy link
Member

danielhuppmann commented Aug 11, 2023

I pushed the v0.2.0rc5 tag in parallel and the workflow triggered by the tag ran faster

But why would the push of a commit trigger an upload to test-pypi at all? Only the tags should have any impact on pypi and test-pypi.

@phackstock
Copy link
Contributor Author

@danielhuppmann good question, just took a look and I cannot tell you, from looking at https://github.com/iiasa/ixmp4/actions/workflows/publish.yaml it looks like both of the runs for v0.2.0rc5 were triggered by the exact same event....
No idea why that ran twice.

@phackstock
Copy link
Contributor Author

Regardless of what caused the double run though, the package did end up being uploaded correctly to test pypi. So I would say we can go ahead with the merge.

@phackstock phackstock merged commit 4543b8e into main Aug 11, 2023
5 of 6 checks passed
@phackstock phackstock deleted the fix/publish-workflow branch August 11, 2023 09:27
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.

2 participants