Skip to content

Commit

Permalink
chore: Migrate from pep517 to python-build (#1066)
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
* Remove check stage as done implicitly with python-build
   - c.f. https://github.com/FFY00/python-build/issues/105
  • Loading branch information
matthewfeickert authored Sep 15, 2020
1 parent be09011 commit 8a6ee36
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,16 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pep517, check-manifest, and twine
- name: Install python-build, check-manifest, and twine
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install pep517 --user
python -m pip install check-manifest twine
python -m pip install build check-manifest twine
- name: Check MANIFEST
run: |
check-manifest
- name: Test the build backend is compliant with PEP517
run: |
python -m pep517.check .
- name: Build a wheel and a sdist
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: |
Expand All @@ -44,26 +40,26 @@ jobs:
wheel_name=$(find dist/ -iname "*.whl" -printf "%f\n")
if [[ "${latest_tag_revlist_SHA}" != "${master_SHA}" ]]; then # don't check master push events coming from tags
if [[ "${wheel_name}" == *"pyhf-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
else
echo "Push event to origin/master was triggered by push of tag ${latest_tag}"
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 8a6ee36

Please sign in to comment.