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

Publish package to PyPI on push tags #485

Open
tetsuok opened this issue Sep 13, 2022 · 2 comments
Open

Publish package to PyPI on push tags #485

tetsuok opened this issue Sep 13, 2022 · 2 comments

Comments

@tetsuok
Copy link
Contributor

tetsuok commented Sep 13, 2022

Currently, a GitHub action to push ExplainaBoard to PyPI is triggered on push commit to main if some change is maded in version.py (regardless of version change). This approach is not reliable because it is possible to add comments or more code to version.py. In fact, #415 added docstrng to version.py which accidentally triggered the CI, and CI failed because the version didn't change.

It is better to configure the CI not to get triggered accidentally. For example, it is possible to trigger the CI on pushing a tag (e.g., v0.12) to this repository rather than on pushing a commit to main. (NOTE: Whether to create release branches or not is a separate topic). Process to bump the version in version.py, and push tags need to be automated to avoid mistakes.

@neubig
Copy link
Contributor

neubig commented Sep 13, 2022

This sounds good to me, as long as we can realize the following:

Process to bump the version in version.py, and push tags need to be automated to avoid .

One reason why this is automated now (instead of using tags) is that in my previous experience I used tags for releases but it was error prone to need to update the code and the tag manually, and one was often forgotten.

@odashi
Copy link
Contributor

odashi commented Sep 14, 2022

Some techniques used by other libraries is autogenerating version information from the tag: refers the tag string, and if it is formed as a version number, copy it to _version.py and publish the library with it.

There is a tool to refer information in the version control system during setup, which is used in other projects (e.g., Black)

https://pypi.org/project/setuptools-scm/

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

No branches or pull requests

3 participants