Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wwood committed May 1, 2024
1 parent d8549fc commit 2e0b9e6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python3

import io
from os.path import dirname, join
import extern

def get_version(relpath):
"""Read version info from a file without importing it"""
for line in io.open(join(dirname(__file__), relpath), encoding="cp437"):
if "__version__" in line:
if '"' in line:
return line.split('"')[1]
elif "'" in line:
return line.split("'")[1]

if __name__ == "__main__":
version = get_version('zenodo_backpack/version.py')
print("version is {}".format(version))

# print("building docs")
# extern.run("python3 build_docs.py")

print("Checking if repo is clean ..")
extern.run('if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then exit 1; fi')

extern.run('git tag v{}'.format(version))
print("Now run 'git push && git push --tags' and GitHub actions will build and upload to PyPI".format(version))
# print('You have to run ./build.sh from the docker directory to build the docker image, once the tag is on GitHub')

2 changes: 1 addition & 1 deletion zenodo_backpack/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.0"
__version__ = "0.3.0"

0 comments on commit 2e0b9e6

Please sign in to comment.