Bug 2059939 - python-pytest-postgresql fails to build with pytest 7 and also breaks dependent packages
Summary: python-pytest-postgresql fails to build with pytest 7 and also breaks depende...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pytest-postgresql
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mikel Olasagasti Uranga
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTEST7 2059938
TreeView+ depends on / blocked
 
Reported: 2022-03-02 11:20 UTC by Miro Hrončok
Modified: 2022-03-02 17:37 UTC (History)
1 user (show)

Fixed In Version: python-pytest-postgresql-3.1.3-1.fc37
Clone Of:
Environment:
Last Closed: 2022-03-02 17:12:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ClearcodeHQ pytest-postgresql issues 533 0 None closed Breaks with pytest 7 due to private imports 2022-03-02 11:21:21 UTC

Description Miro Hrončok 2022-03-02 11:20:54 UTC
In this copr repo, I have updated pytest to 7.0.1:

https://copr.fedorainfracloud.org/coprs/churchyard/pytest-7/

Based on this PR:

https://src.fedoraproject.org/rpms/pytest/pull-request/25

I'd like to update pytest to 7 in Fedora 37, but python-pytest-postgresql 3.1.2-2  fails to build.


https://copr.fedorainfracloud.org/coprs/churchyard/pytest-7/package/python-pytest-postgresql/


+ /usr/bin/pytest --postgresql-exec=/usr/bin/pg_ctl -k 'not docker' --no-cov
Traceback (most recent call last):
  File "/usr/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 188, in console_main
    code = main()
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 146, in main
    config = _prepareconfig(args, plugins)
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 325, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/usr/lib/python3.10/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/usr/lib/python3.10/site-packages/_pytest/helpconfig.py", line 102, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/usr/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1013, in pytest_cmdline_parse
    self.parse(args)
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1301, in parse
    self._preparse(args, addopts=addopts)
  File "/usr/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1184, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/usr/lib/python3.10/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 162, in load
    module = import_module(match.group('module'))
  File "/usr/lib64/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILDROOT/python-pytest-postgresql-3.1.2-2.fc37.x86_64/usr/lib/python3.10/site-packages/pytest_postgresql/plugin.py", line 21, in <module>
    from pytest_postgresql import factories
  File "/builddir/build/BUILDROOT/python-pytest-postgresql-3.1.2-2.fc37.x86_64/usr/lib/python3.10/site-packages/pytest_postgresql/factories/__init__.py", line 20, in <module>
    from pytest_postgresql.factories.process import postgresql_proc
  File "/builddir/build/BUILDROOT/python-pytest-postgresql-3.1.2-2.fc37.x86_64/usr/lib/python3.10/site-packages/pytest_postgresql/factories/process.py", line 27, in <module>
    from _pytest.tmpdir import TempdirFactory
ImportError: cannot import name 'TempdirFactory' from '_pytest.tmpdir' (/usr/lib/python3.10/site-packages/_pytest/tmpdir.py)

This is private API usage and appears to be fixed via https://github.com/ClearcodeHQ/pytest-postgresql/issues/533 https://github.com/ClearcodeHQ/pytest-postgresql/commit/2ae96bc7b82631a12b16696df1dd21aad5a5b160 


There are several packages affected by this update, so I'd very much appreciate it if you could backport the fix yourself.

Thanks!

Comment 1 Fedora Update System 2022-03-02 17:11:56 UTC
FEDORA-2022-6d129b75e6 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-6d129b75e6

Comment 2 Fedora Update System 2022-03-02 17:12:30 UTC
FEDORA-2022-6d129b75e6 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 3 Mikel Olasagasti Uranga 2022-03-02 17:17:42 UTC
Version 3.1.3 has the fix backported. I tested using mock + your copr repo.

Comment 4 Miro Hrončok 2022-03-02 17:37:58 UTC
Thanks!


Note You need to log in before you can comment on or make changes to this bug.