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

ci: add workflow to deploy to pypi #8

Merged
merged 1 commit into from Oct 15, 2022

Conversation

ap--
Copy link
Contributor

@ap-- ap-- commented Oct 14, 2022

This PR adds a workflow to deploy scikit_mol to pypi for commits that are tagged.

The way you use this is the following:

  • develop your module on github and everytime you want to make a new release you create a tag
    # the current latest commit on main that should be released as a new version
    $ git tag v0.1.2
    $ git push origin v0.1.2
  • this will trigger the ci and build a new version of the package and deploy to pypi
  • I recommend having the tags adhere to semantic versioning vX.Y.Z

To set up the required tokens, goto pypi and sign up.
Goto your account settings and scroll to the API token section. Create a new API token with scope for everything (note: after your project was created you can replace the token with a token that has scope only for your project)
Copy the token and add it as a secret in your github repository (Settings > Secrets > Actions, --> Create New Repository Secret) The secret name should be PYPI_PASSWORD.

When the deploy pipeline after a tagged commit succeeds, your new version is available on pypi.

People can then just pip install scikit-mol

If anything is unclear, let me know!

@EBjerrum
Copy link
Owner

Thanks for the detailed descriptions, I've setup the pypi account and created the access token and added it for the repository. One question, do you have a good reference with instructions for the way that you have set up the repository?

@EBjerrum EBjerrum merged commit 18dbf3e into EBjerrum:main Oct 15, 2022
@ap--
Copy link
Contributor Author

ap-- commented Oct 15, 2022

The way I set it up is mostly a collection of different pieces from multiple best practices for how to setup these packages. It has little overhead and only uses the default pypa tools instead of relying on tools like flit or poetry.

Resources are here:

And for running the tests in the CI, it's just running pytest together with coverage (for code coverage analysis) and the way the tests are setup via github actions uses caching for files you might have to always download for testing your code.

If you want I could make another PR to setup automatic source code linting / formatting, and maybe static type analysis via mypy in case you want to standardise your code in the way it's now commonly done in the Python community. Although I would probably not do that right now, because it will just increase the barrier for contributions without any imminent benefit for the currently small codebase.

Cheers,
Andreas 😃

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.

None yet

2 participants