-
Notifications
You must be signed in to change notification settings - Fork 68
Use bumpversion for epidata client #1436
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already duplicating the version number twice in this package, once in the __init__.py
and once in the setup.py
, which is kinda ugly. i would feel better if we could avoid adding a third copy of it. What if we keep the literal in delphi_epidata.py
and make https://github.com/cmu-delphi/delphi-epidata/blob/dev/src/client/packaging/pypi/delphi_epidata/__init__.py just look like:
from .delphi_epidata import Epidata, __version__
name = "delphi_epidata"
and dont forget to add to |
c94b464
to
01c8823
Compare
src/client/delphi_epidata.py
Outdated
_version = version("delphi-epidata") | ||
except PackageNotFoundError: | ||
_version = "0.script" | ||
_version = "4.1.20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to agree with the change in __init__.py
:
_version = "4.1.20" | |
__version__ = "4.1.20" |
(and then change the other references to this variable as well)
src/client/delphi_epidata.py
Outdated
_version = version("delphi-epidata") | ||
except PackageNotFoundError: | ||
_version = "0.script" | ||
_version_ = "4.1.20" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still doesnt match whats in __init__.py
!
_version_ = "4.1.20" | |
__version__ = "4.1.20" |
the convention is for this to be a "dunder", as seen in the good ol:
if __name__ == '__main__':
|
Closes #1431.
Summary:
Updates the versioning in the Python client to the same method used in the JS and R clients. With this method, the version is set to a simple hardcoded string; however, during a new Delphi release, GitHub Actions will run bump2version during the release process and automatically update this string in the code.
This can be replicated in a local environment; the following code should bump the version in the Python client (as well as the
.bumpversion.cfg
file itself, and 7 other files) to 4.1.21:Prerequisites:
dev
branchdev