Skip to content

Commit

Permalink
chore: Migrate from pep517 to python-build (#38)
Browse files Browse the repository at this point in the history
* Migrate from the deprecated pep517.build to python-build CLI for builds for packaging
   - c.f. pypa/pyproject-hooks#83
  • Loading branch information
matthewfeickert authored Sep 22, 2020
1 parent afd2700 commit 82ecaba
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,38 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install pep517, check-manifest, and twine
- name: Install python-build, check-manifest, and twine
run: |
python -m pip install pep517 --user
python -m pip install check-manifest twine
python -m pip install --upgrade pip setuptools wheel
python -m pip install build check-manifest twine
- name: Check MANIFEST
run: |
check-manifest
- name: Build a binary wheel and a source tarball
run: |
python -m pep517.build --source --binary --out-dir dist/ .
python -m build --sdist --wheel --outdir dist/ .
- name: Verify untagged commits have dev versions
if: "!startsWith(github.ref, 'refs/tags/')"
run: |
wheel_name=$(find dist/ -iname "*.whl" -printf "%f\n")
if [[ "${wheel_name}" == *"pylhe-0.1.dev"* || "${wheel_name}" != *"dev"* ]]; then
echo "pep517.build incorrectly named built distribution: ${wheel_name}"
echo "pep517 is lacking the history and tags required to determine version number"
echo "python-build incorrectly named built distribution: ${wheel_name}"
echo "python-build is lacking the history and tags required to determine version number"
echo "intentionally erroring with 'return 1' now"
return 1
fi
echo "pep517.build named built distribution: ${wheel_name}"
echo "python-build named built distribution: ${wheel_name}"
- name: Verify tagged commits don't have dev versions
if: startsWith(github.ref, 'refs/tags')
run: |
wheel_name=$(find dist/ -iname "*.whl" -printf "%f\n")
if [[ "${wheel_name}" == *"dev"* ]]; then
echo "pep517.build incorrectly named built distribution: ${wheel_name}"
echo "python-build incorrectly named built distribution: ${wheel_name}"
echo "this is incorrrectly being treated as a dev release"
echo "intentionally erroring with 'return 1' now"
return 1
fi
echo "pep517.build named built distribution: ${wheel_name}"
echo "python-build named built distribution: ${wheel_name}"
- name: Verify the distribution
run: twine check dist/*
- name: Publish distribution 📦 to Test PyPI
Expand Down

0 comments on commit 82ecaba

Please sign in to comment.