Use pypa/build to build dists, remove duplicate Python setup step
We don't need to set things up twice in a row (which we were doing in
restoring the cache) and let's use pypa/build instead of python setup.py
since that's better supported and the future
MODIFY
.github/PULL_REQUEST_TEMPLATE/release.md
.github/PULL_REQUEST_TEMPLATE/release.md
python -m venv
source venv/bin/activate
python -m pip install -U pip
- python -m pip install -U twine setuptools wheel
- python setup.py sdist bdist_wheel
+ python -m pip install -U twine setuptools wheel build
+ python -m build
twine check dist/*
# Inspect the output to make sure it looks right

MODIFY
.github/workflows/ci.yml
.github/workflows/ci.yml
@@ -21,8 +21,8 @@ jobs:
cache: pip
- name: Check packages
run: |
- python3 -m pip install -U pip setuptools wheel twine rstcheck;
- python3 setup.py sdist bdist_wheel;
+ python3 -m pip install -U pip setuptools wheel build twine rstcheck
+ python3 -m build
rstcheck README.rst CHANGES.rst
python3 -m twine check dist/*
test:
@@ -72,13 +72,6 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip
- - name: Set Up Python - ${{ matrix.python-version }}
- uses: actions/setup-python@v2
- if: "!endsWith(matrix.python-version, '-dev')"
- with:
- python-version: ${{ matrix.python-version }}
- cache: pip
-
- name: Set Up Python (Development version) - ${{ matrix.python-version }}
uses: deadsnakes/action@v2.0.2
if: endsWith(matrix.python-version, '-dev')

MODIFY
ci/deploy.sh
ci/deploy.sh
set -exo pipefail
-python3 -m pip install --upgrade twine wheel
-python3 setup.py sdist bdist_wheel
+python3 -m pip install --upgrade twine wheel build
+python3 -m build
python3 -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD --skip-existing

Use pypa/build to build dists, remove duplicate Python setup step

We don't need to set things up twice in a row (which we were doing in
restoring the cache) and let's use pypa/build instead of python setup.py
since that's better supported and the future