Integration test failed - assert nomatch (Arch linux)
Describe the bug
Integration tests fail when running the check() function to build the Arch Linux package.
No errors are returned by the build process - only the check().
--------------------------- snapshot report summary ----------------------------
2 snapshots failed. 210 snapshots passed.
=========================== short test summary info ============================
FAILED tests/integration/test_snapshot_option_update.py::test_update_failure_shows_snapshot_diff - Failed: nomatch: ".*assert snapshot == \\['this', 'will', 'not', 'match'\\]"
=========== 1 failed, 235 passed, 4 xpassed, 297 warnings in 20.44s ============
==> ERROR: A failure occurred in check().
Aborting...
:: Unable to build python-syrupy - makepkg exited with code: 4
To reproduce
- Download the PKGBUILD from the aur into a temp dir (or use an aur helper such as trizen, yay etc.)
- Run
makepkgagainst the PKGBUILD - Get a test error returned from the check() function
Expected behavior
Package should pass integration tests.
Environment (please complete the following information):
- OS: Arch Linux
- Syrupy Version: 3.0.3-1
- Python Version: 3.10
We're not going to be able to avoid regressions unless we move the build checks to this repo. I don't have any experience with building packages for arch linux, but if you'd like to open a PR to contribute the relevant workflows, I'll merge it in.
I am also re-considering the use of poetry (still tentative) so the build process may change somewhat (should be PEP compliant).
We use the poetry-core backend in our pyproject.toml. This is PEP 517 compliant.
@carlosal1015 Could you try the build instructions in poetry-core? I'll likely migrate to build at some point, but in the meantime, a pip install followed by a pip wheel should do the trick.
It's discouraged to install the wheel directly, but it is possible.
Removing the build() and check() sections from the PKGBUILD and making these changes:
source=(https://files.pythonhosted.org/packages/py3/${_base::1}/$_base/${_base//-/_}-$pkgver-py3-none-any.whl)
sha512sums=('8ccff1caba6b31a3f1abf2ef68add20c79bbca02cc3b81c38a3893067e4a44ff511cb02a8cf9fd855f4adcddc21e5345add627f464cad8470787cb589aad1d1a')
package() {
python -m installer --destdir="${pkgdir}" ${_base//-/_}-$pkgver-py3-none-any.whl
Results in a built package.
We use the poetry-core backend in our pyproject.toml. This is PEP 517 compliant.
@carlosal1015 Could you try the build instructions in poetry-core? I'll likely migrate to
buildat some point, but in the meantime, apip installfollowed by apip wheelshould do the trick.
I am following according to https://wiki.archlinux.org/title/Python_package_guidelines
For Python packages using standard metadata to specify their build backend in pyproject.toml, this can most easily achieved using python-build and python-installer. Old packages might fail to specify that they use setuptools, and only offer a setup.py that has to be invoked manually.
I am often put the the package name build-backend = 'foo' in pyproject.toml as make dependency join with python-build and python-installer and does the trick 100%, with poetry, poetry-core, setuptools, flit-core, etc.
--------------------------- snapshot report summary ---------------------------- 2 snapshots failed. 210 snapshots passed. =========================== short test summary info ============================ FAILED tests/integration/test_snapshot_option_update.py::test_update_failure_shows_snapshot_diff - Failed: nomatch: ".*assert snapshot == \\['this', 'will', 'not', 'match'\\]" =========== 1 failed, 235 passed, 4 xpassed, 297 warnings in 20.44s ============ ==> ERROR: A failure occurred in check(). Aborting...
@alan1world I can skip this single test with pytest -k 'not update_failure_shows_snapshot_diff'. if the new release still failing check() function.
The build process has changed since this issue was last active.