Skip to content

Conversation

@dtch1997
Copy link
Collaborator

@dtch1997 dtch1997 commented Feb 8, 2025

add ci for automated testing
ci workflow will allow automated deployment, if desired (uncomment the pypi-publish step)

add manual publishing workflow. this can deploy the latest build to pypi

@dtch1997
Copy link
Collaborator Author

dtch1997 commented Feb 8, 2025

Should be good to go now.

In order to setup PyPI trusted publishing, you need to do the following:

  1. Go to PyPI website
  2. Sidebar --> click 'Publishing'
  3. Scroll down to 'Add a new pending publisher'
  4. Fill in the form appropriately

For this project, the values should be:

  • PyPI project name: openweights
  • Owner: longtermrisk
  • repository name: openweights
  • workflow name: manual_publish.yaml (later you can add ci.yaml also)
  • environment name: pypi

Once you set up trusted publishing, you can run the manual_publish.yaml workflow in Github actions.

  • Go to Actions
  • Sidebar --> click 'manual_publish`
  • You should be able to click a button and run the workflow to deploy the library

@dtch1997
Copy link
Collaborator Author

dtch1997 commented Feb 8, 2025

note:

  • ci currently doesn't run any tests, because it looks like the tests are all integration tests (i.e. require actual API calls to Supabase).
  • If you want to enable testing, you can implement unit tests that use mock API calls so only the Client and Worker functionality are used.

I'd be happy to submit another PR for this

@nielsrolf nielsrolf merged commit 7ff635c into main Feb 10, 2025
4 checks passed
@nielsrolf
Copy link
Collaborator

Cool, thanks a lot for the PR! - it's now published here: https://pypi.org/project/openweights/

Regarding CI: it would be great to add tests eventually, my todo notes for that were that the CI should:

  • maybe run some unit tests, if there are components that change often and break sometimes
  • build the docker images for the workers
  • run integration tests against a local supabase dev environment or against an actual supabase dev environment
  • if tests pass, push the docker images (& release pypi)

I'm not sure how important the existing tests are, so I wouldn't spend much time on turning them into unit tests (maybe the worker and validation tests make sense but they test things that I don't expect to break very often, compared to how different components interact). But if you notice that things break that can easily be tested or you're motivated for other reasons I welcome any PR!

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.

3 participants