Skip to content

Conversation

micaeljtoliveira
Copy link
Member

Add CI tests and a CD workflow to build and deploy Conda and PyPI packages. Code was mostly copied from other ACCESS projects.

Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.28%. Comparing base (2a27d6e) to head (2ca69a2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   99.28%   99.28%           
=======================================
  Files           9        9           
  Lines         278      278           
=======================================
  Hits          276      276           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@micaeljtoliveira
Copy link
Member Author

@edoyango Here is another one for you!

@micaeljtoliveira
Copy link
Member Author

@dougiesquire Would you mind having a look? I know you're very busy, but you're our resident conda/pypi expert and I unashamedly stole your code ;)

Copy link
Collaborator

@edoyango edoyango left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link

@dougiesquire dougiesquire left a comment

Choose a reason for hiding this comment

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

Looks good @micaeljtoliveira. Let me know if you like help setting up the PyPI trusted publishing or Anaconda token

Comment on lines +69 to +71
user: ${{ vars.ANACONDA_USER }}
label: main
token: ${{ secrets.ANACONDA_TOKEN }}

Choose a reason for hiding this comment

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

You'll need to add these to the repo if you haven't already. Happy to help with this

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm assuming the token is stored somewhere. bitwarden maybe?

Choose a reason for hiding this comment

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

We actually have been generating a separate token for each project. There was a discussion in the Python Standards Group a while back about whether this is a good idea and I think we resolved to continue doing this.

There are some instructions here for how to generate one: https://github.com/ACCESS-NRI/dev-docs/wiki/Continuous-integration-and-Deployment#publishing-a-python-package-to-conda

They require that you are a member of the accessnri Anaconda org. I can add you now.

Choose a reason for hiding this comment

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

@dougiesquire can you add me in too? (I reckon I asked this question before)

@micaeljtoliveira
Copy link
Member Author

Let me know if you like help setting up the PyPI trusted publishing or Anaconda token

@dougiesquire Yes, would be great if you could provide some guidance here, as I'm completely new to publishing packages on PyPI and Anaconda.

@dougiesquire
Copy link

Do you want to learn or shall I just do it? The hardest part is finding the login details haha. Then it's just clicking a few buttons and copying a token

@micaeljtoliveira
Copy link
Member Author

I want to learn!

@dougiesquire
Copy link

I've added some details to my review comments

@micaeljtoliveira
Copy link
Member Author

@dougiesquire All set on Anaconda and PyPI. Now, is there a way to test everything is set correctly before merging this?

@dougiesquire
Copy link

You can try deploying to testPyPI, but in my experience that's not really a worthwhile exercise. I usually take the "suck it and see" approach.

@micaeljtoliveira micaeljtoliveira changed the title Add conda and pypi builds Add conda and PyPI builds Sep 19, 2025
@micaeljtoliveira micaeljtoliveira merged commit 6197c55 into main Sep 19, 2025
8 checks passed
@micaeljtoliveira micaeljtoliveira deleted the pypi_conda branch September 19, 2025 07:12
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.

4 participants