This document covers all steps that need to be done in order to do a release of the huggingface_hub library.
- On a clone of the main repo, not your fork, checkout the main branch and pull the latest changes:
git checkout main
git pull
Checkout a new branch with the version that you'd like to release: v-release, for example
v0.5-release. All patches will be done to that same branch.Update the
__version__variable in thesrc/huggingface_hub/__init__.pyfile to point to the version you're releasing:
__version__ = "<VERSION>"
- Make sure that the conda build works correctly by building it locally:
conda install -c defaults anaconda-client conda-build
HUB_VERSION=<VERSION> conda-build .github/conda
- Make sure that the pip wheel works correctly by building it locally and installing it:
pip install setuptools wheel
python setup.py sdist bdist_wheel
pip install dist/huggingface_hub-<VERSION>-py3-none-any.whl
- Commit, tag, and push the branch:
git commit -am "Release: v<VERSION>"
git tag v<VERSION> -m "Adds tag v<VERSION> for pypi and conda"
git push -u --tags origin v<MINOR-VERSION>-release
Verify that the docs have been built correctly. You can check that on the following link: https://huggingface.co/docs/huggingface_hub/v
Checkout main once again to update the version in the
__init__.pyfile:
git checkout main
- Update the version to contain the
.dev0suffix:
__version__ = "<VERSION+1>.dev0" # For example, after releasing v0.5.0 or v0.5.1: "0.6.0.dev0".
- Push the changes!
git push origin main