-
Notifications
You must be signed in to change notification settings - Fork 12
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
Auto pushing to TestPypi #26
Conversation
…python package index
Linked to #23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks a lot! Nice and simple. I've created the TEST_PYPI_TOKEN.
I'd prefer to have the TestPyPi upload in a different action, presumably depending if the CI action succeeded. Easy?
Action failure
|
@casperdcl, maybe you can have a look at this PR and add some recommendations. |
Ah my bad, I forgot to install build in that code (I was testing in a different branch with many test pushes to test the workflow and had to copy a bunch of code to an earlier commit in order to not pollute git). I'll fix. And yes, I can add as a separate workflow that only runs if the CI action succeeds. This is an example of a separate workflow in my own fork |
@KrisThielemans just updated and created a separate workflow which depends on Once this is sufficiently tested, we'll have to create a workflow for adding to the real
|
Excellent. thanks! I'll let the experts comment. |
This action is currently not running. @casperdcl @johnstairs , do we need to first merge this to I still think having it as a separate action is the best way forward, as we will need to push to Pypi only on releases (the equivalent of https://github.com/ismrmrd/mrd/blob/main/.github/workflows/mrd_pypi.yml). It is not clear to me if a depending action will have access to files created by the CI workflow. If not, it could push the python files as an artefact. |
I'll merge this to see what happens. Likely will need to be improved later... |
This sort of worked: https://test.pypi.org/project/petsird/0.0.1/ Thanks @lukepolson ! However,
No idea what to do... |
@KrisThielemans this could happen if your venv doesn't match the requirements file. Are you sure you have the right version of python3 installed? |
oops. shows that I always use conda...
I had to manually do |
lol use |
pyproject.toml
file to/python
that has dependencies for the code generated by theyardl generate
command (the python files it creates).ci.yml
file so that it auto pushes to Test Pypi. @KrisThielemans or whoever is owner of the repo, you'll have to manually add aTEST_PYPI_TOKEN
as follows in order for this to work. (1) Sign up for TestPypi. (2) Create an API token on TestPyPi via Account Settings -> Add API token. (3) Add the API token on Github with the nameTEST_PYPI_TOKEN
via Settings -> Secrets and Variables -> Actions -> New Repository secret. Unfortunately only owners of the repo can do this.Whenever main gets pushed to, a package with the name
prd
(and version specified bypyproject.toml
) will get uploaded to testpypi under your account. If the version remains the same with two pushes to main, I think pushing to testpypi will fail (once we update to regular pypi it will definitely fail since it needs different version numbers every time).By the way @KrisThielemans, this prevents us from having to manually add the generated code in
/prd
to the repository, which you eluded to in #23 . Essentially the workflow (i) creates the code in/prd
viayardl
and (ii) serves everything in/prd
as its own python package on pypi.