I recently messed up the built PyPI package of PyPDF2 (the packages
missed one package). The result was that CI looked fine, but every user who used PyPI to install PyPDF2==2.3.0
got an error when importing PyPDF2 (this one).
The package was in the Github repository, but not in the built distribution.
I want to check my distribution files in CI.
I already build the package, but I don't know how to install it from that artifact. Also, how do I make sure that pytest
uses the installed artifact and not the local PyPDF2
folder when I execute the tests?
How I build the package in Github Actions
package:
name: Build & verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{env.PYTHON_LATEST}}
- run: python -m pip install build twine check-wheel-contents
- run: python -m build --sdist --wheel .
- run: ls -l dist
- run: check-wheel-contents dist/*.whl
- name: Check long_description
run: python -m twine check dist/*
The current steps
In case you want to see the full picture: https://github.com/py-pdf/PyPDF2/blob/main/.github/workflows/github-ci.yaml