Skip to content

Commit

Permalink
Update directions and makefile to account for testpypi fun
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerzr committed Jan 21, 2025
1 parent 733da76 commit 498df89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,16 @@ test_rest:
prepare_release:
rm -rf dist build
python setup.py bdist_wheel sdist

# Make sure this is ran in a fresh venv of some form
install_test_release:
pip uninstall accelerate -y
pip install -i https://testpypi.python.org/pypi --extra-index-url https://pypi.org/simple accelerate

# Run as `make target=testpypi upload_release`
upload_release:
@if [ "$(target)" != "testpypi" ] && [ "$(target)" != "pypi" ]; then \
echo "Error: target must be either 'testpypi' or 'pypi'"; \
exit 1; \
fi
twine upload dist/* -r $(target)
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@
# 5. Run the following commands in the top-level directory:
# make prepare_release
# 6. Upload the package to the pypi test server first:
# twine upload dist/* -r testpypi
# make target=testpypi upload_release
# 7. Check that you can install it in a virtualenv by running:
# pip install accelerate
# pip uninstall accelerate
# pip install -i https://test.pypi.org/simple/ accelerate
# make install_test_release
# accelerate env
# accelerate test
# 8. Upload the final version to actual pypi:
# twine upload dist/* -r pypi
# make target=pypi upload_release
# 9. Add release notes to the tag in github once everything is looking hunky-dory.
# 10. Go back to the main branch and update the version in __init__.py, setup.py to the new version ".dev" and push to
# main.

0 comments on commit 498df89

Please sign in to comment.