Bug 2063769
Summary: | Please provide python3-pytest-asyncio for EPEL-9 | ||
---|---|---|---|
Product: | [Fedora] Fedora EPEL | Reporter: | Stefan Bluhm <fedoraproject.org> |
Component: | python-pytest-asyncio | Assignee: | Carl George 🤠<carl> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | epel9 | CC: | carl, code, jujens, python-sig |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-pytest-asyncio-0.18.3-1.el9 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-04-23 19:34:00 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 2063779 | ||
Bug Blocks: | 2063754 |
Description
Stefan Bluhm
2022-03-14 11:00:44 UTC
python3-setuptools_scm is included in RHEL 9 (CRB repo). (In reply to Stefan Bluhm from comment #1) > python3-setuptools_scm is included in RHEL 9 (CRB repo). The problem here is that it’s version 6.0.1, and pyproject.toml is asking for >=6.2.0. After consulting the upstream changelog[1], I guessed that 6.0.1 is probably still OK for the limited requirements of the RPM build, and tried a build with the dependency loosened. For testing, I used this sed expression in %prep: > sed -r -i 's/("setuptools_scm\[toml\]>=)6\.2"/\16.0.1"/' pyproject.toml The result was: > No matching package to install: 'python3dist(flaky) >= 3.5' > No matching package to install: 'python3dist(mypy) = 0.931' ----- The mypy dependency should ideally be patched out anyway[2]. Perhaps no-coverage.patch could become no-linters.patch. I used another sed expression to test this: > sed -r -i '/\bmypy\b/d' setup.cfg ----- The flaky dependency can be patched out if we skip the flaky integration test. (Why test integration with something that isn’t currently packaged?) That said, it would be *good* to get flaky in EPEL9. > %pytest --ignore=tests/test_flaky_integration.py I tested this with the above pytest argument and with > sed -r -i '/\bflaky\b/d' setup.cfg ----- After all that, a mock build almost succeeded, except that all of the tests in tests/modes/test_legacy_mode.py failed because they had each had two warnings instead of the expected one. The extra warning was: > ../../../../usr/lib/python3.9/site-packages/_pytest/config/__init__.py:676 > /usr/lib/python3.9/site-packages/_pytest/config/__init__.py:676: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: pytest_asyncio > self.import_plugin(import_spec) I recognize this warning as occurring because pytest finds pytest_asyncio in the current working directory *and* in %{buildroot}%{python3_sitelib}. This was a workaround for that: > %global __pytest %{python3} -m pytest and I guess it’s working on Fedora, but it’s not working on RHEL9. An alternative solution that does work is: > %check > # Keeps tests/modes/test_legacy_mode.py from failing with extra PytestAssertRewriteWarning > # (ensure it only finds the copy in buildroot site-packages) > rm -rf pytest_asyncio > %pytest --ignore=tests/test_flaky_integration.py This removal seems drastic but is harmless since %install has already happened by the time %check runs. ----- So it looks like an EPEL9 package is possible with those changes: - Loosen setuptools_scm[toml] min. version to 6.0.1 in pyproject.toml. - Patch out mypy and flaky dependencies in setup.cfg. - Skip the flaky integration test. - Use a different approach to preventing extra warnings in the legacy mode tests: removing the local pytest_asyncio directory is easy and works. Let me know if there is anything I can do to help with this. [1] https://github.com/pypa/setuptools_scm/blob/main/CHANGELOG.rst#v620 [2] https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters I accidentally dropped “--release epel9” from my last mockbuild. It turns out that
> rm -rf pytest_asyncio
is not a solution for the extra warnings causing the legacy mode tests to fail.
Something else is needed—I’m not sure what—or perhaps these can be skipped.
This source package was due to be renamed from python3-pytest-asyncio to python-pytest-asyncio to comply with the Python packaging guidelines [0]. I've completed that work [1], and I've built python-pytest-asyncio for EPEL9 as well. Note that it is only the source package (and dist-git repo) that were renamed, the built package is still named python3-pytest-asyncio. [0] https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_library_naming [1] bug 2076825 FEDORA-EPEL-2022-f26d6cc8cc has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-f26d6cc8cc Awesome! Thank you. FEDORA-EPEL-2022-f26d6cc8cc has been pushed to the Fedora EPEL 9 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-f26d6cc8cc See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-EPEL-2022-f26d6cc8cc has been pushed to the Fedora EPEL 9 stable repository. If problem still persists, please make note of it in this bug report. |