From 498df89d168e2371a4d1c666b8551648ba192bc4 Mon Sep 17 00:00:00 2001 From: "[[ -z $EMAIL ]] && read -e -p \"Enter your email (for git configuration): \" EMAIL" Date: Tue, 21 Jan 2025 08:49:40 -0500 Subject: [PATCH] Update directions and makefile to account for testpypi fun --- Makefile | 13 +++++++++++++ setup.py | 8 +++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 37f0695bc62..f3876138519 100644 --- a/Makefile +++ b/Makefile @@ -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) \ No newline at end of file diff --git a/setup.py b/setup.py index f293af1577a..efeecd47feb 100644 --- a/setup.py +++ b/setup.py @@ -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.