Files
DeepSpeed/release/release.sh
Logan Adams 1d30b58cba Replace calls to python setup.py sdist with python -m build --sdist (#7069)
With future changes coming to pip/python/etc, we need to modify to no
longer call `python setup.py ...` and replace it instead:
https://packaging.python.org/en/latest/guides/modernize-setup-py-project/#should-setup-py-be-deleted


![image](https://github.com/user-attachments/assets/ea39ef7b-3cbe-4916-86f0-bc46a5fce96d)

This means we need to install the build package which is added here as
well.

Additionally, we pass the `--sdist` flag to only build the sdist rather
than the wheel as well here.

---------

Signed-off-by: Logan Adams <loadams@microsoft.com>
2025-02-24 20:40:24 +00:00

56 lines
1.2 KiB
Bash

#!/bin/bash
cd ..
if [ ! -f ~/.pypirc ]; then
echo 'create .pypirc in order to upload to PyPI'
exit 1
fi
version=$1
if [ -z $version ]; then
echo "please provide version number for release"
exit 1
fi
if [[ $version == *"v"* ]]; then
echo "please only include version number without 'v' prefix"
exit 1
fi
if [ "${version}" != `cat version.txt` ]; then
echo "version=${version} does not match version.txt"
cat version.txt
exit 1
fi
echo "checking that the version is valid"
python release/check_release_version.py --release_version ${version}
if [ $? != 0 ]; then
echo 'please check the version number selected'
exit 1
fi
python -c "import twine"
if [ $? != 0 ]; then
echo 'please install twine via pip'
exit 1
fi
DS_BUILD_STRING="" python -m build --sdist
if [ ! -f dist/deepspeed-${version}.tar.gz ]; then
echo "prepared version does not match version given ($version), bump version first?"
ls dist
exit 1
fi
python -m twine upload dist/deepspeed-${version}.tar.gz --repository deepspeed
git tag v${version}
git push origin v${version}
echo "bumping up patch version"
python release/bump_patch_version.py --current_version ${version}