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 test-n-publish #23

Closed
wants to merge 2 commits into from
Closed

Conversation

soininen
Copy link
Contributor

This PR fixes the test-n-publish workflow.

The publishing step still fails but that is because uploads to PyPI are currently disabled if I understood correctly.

Copy link
Collaborator

@suvayu suvayu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a bit of misunderstanding here, my fault really for not documenting 🤐

The difficulty with the test step is that we need to test the new wheels with it's new dependencies, and it could be one of the other wheels that need testing. Consider the following cases, you are releasing:

  1. spinedb-api, spine-engine
    • spinedb-api, spine-engine: come from wheel
    • spine-items, spine-toolbox: come from PyPI
  2. spine-engine
    • spine-engine: comes from wheel
    • spinedb-api, spine-items, spine-toolbox: come from PyPI
  3. spinedb-api, spine-engine, spine-items, spine-toolbox; all come from wheels

So instead of figuring all of this out, I download all the wheels and install all of them for all packages, that way, when a package is excluded, it gets pulled in from PyPI.

And now to run the tests, we checkout the projects in a sub-directory, and slightly modify the test discovery command so that the $PWD is correct since we are one directory above.

<working directory>
├── dist
│   ├── Spine-Database-API
│   ├── spine-engine
│   ├── spine-items
│   └── Spine-Toolbox
└── <pkg-being-tested>

As for the reusable workflow issue, good catch! But I don't think we need to change anything in the repo. Our reusable workflow is in the same repo as the main calling workflow, so all we need to do is on PyPI approve publish-wheel.yml instead of test-n-publish.yml. I will have to fix the documentation for this.

Hopefully this makes sense 😬

@suvayu
Copy link
Collaborator

suvayu commented Mar 28, 2024

To fix the skip tag issue, I think what we can do is in the build step if skip is true, then add unconditional success step as the very last step (after upload). something like this maybe?

    - name: Signal skipping is also success
      if: ${{ inputs[matrix.pkg] }} == 'skip'
      run: true

There might be a cleaner more GH action way of doing this though, WDYT?

@soininen
Copy link
Contributor Author

soininen commented Apr 2, 2024

I have now added publish-wheel.yml as a publisher to PyPI for all the four projects so hopefully the reusable workflow works next time.

I am OK with trying something simpler that keeps the tests working as intended. I can always come back to this branch if I run into issues next time new versions get published :)

Anyway, PyPI is again accepting new uploads and this time I managed to get the publishing step to succeed. This conductor is pretty nifty once you get it running!

@suvayu
Copy link
Collaborator

suvayu commented Apr 2, 2024

I am OK with trying something simpler that keeps the tests working as intended.

I'm off until the 12, but I'll try to find some work time to implement this. It's mostly easy to implement, but cumbersome to test :-p

Anyway, PyPI is again accepting new uploads and this time I managed to get the publishing step to succeed.

I was wondering about this, if there's some way to retry after sometime, let's say a day. I think it should be possible because retention period on the artifacts is set to 7 days. I guess this isn't high priority since relaunching the workflow is simple. But maybe an informative error message would be useful.

This conductor is pretty nifty once you get it running!

Thanks a lot for patiently iterating :-p The next major piece would be if we can also generate your pyinstaller bundle, then I would consider this feature complete (for now :-p).

@suvayu
Copy link
Collaborator

suvayu commented Sep 9, 2024

close in favour of #27

@suvayu suvayu closed this Sep 9, 2024
@suvayu suvayu deleted the fix_skipping_in_test-n-publish branch September 9, 2024 15:57
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