This section is only relevant for core developers.
-
First check whether the
__version__
inkgx/__init__.py
matches with the latest tag or PyPI release. If the version is the same then you need to bump the version to make a new release. Follow Semantic Versioning guidelines to decide whether the bump in version is major or minor. -
Now do the same for
VERSION
insetup.py
, such that the version is in-sync withkgx/__init__.py
.
Now update Changelog.md and add the changes that this new release has.
Now update Dockerfile to use the new tag.
Update KGX documentation to be consistent with any changes or new additions to the codebase.
Also be sure to update the version in docs/conf.py to ensure that the right version is being displayed when the documentation is rendered.
Commiting changes and making a new release tag.
TAG=`python setup.py --version`
git add kgx/__init__.py
git add setup.py
git add CHANGELOG.md
git add Dockerfile
git add docs/conf.py
git commit --message="Bump version to $TAG in preparation of a release"
git push
git tag --annotate $TAG --message="Release $TAG"
git push --tags
To ensure this is successful, make sure you have relevant permissions to KGX package on PyPI.
Also, be sure to install twine and wheel.
Now, run the following commands:
rm -rf dist/
python setup.py sdist bdist_wheel bdist_egg
twine upload --repository-url https://upload.pypi.org/legacy/ --username PYPI_USERNAME dist/*
Go to https://github.com/biolink/kgx/releases/, edit the latest release and add the contents from CHANGELOG.md corresponding to that release.
Build and push the Docker image for the new version of KGX.
First have a fresh clone of the KGX GitHub repository, and then build the Docker image:
git clone https://github.com/biolink/kgx
cd kgx
docker build --no-cache -f Dockerfile --tag biolink/kgx:latest .
docker build --no-cache -f Dockerfile --tag biolink/kgx:$TAG .
Once the image is built, be sure to push to Dockerhub:
docker push biolink/kgx:latest
docker push biolink/kgx:$TAG
Note: It is important to have a fresh clone of the repository to avoid unnecessary files being included in the new Docker image.