Bug 2584213

Summary: python-pygments-git fails to build with Python 3.16: DeprecationWarning: 'typing.AnyStr' is deprecated and slated for removal in Python 3.21. Use PEP 695 type parameters with constraints instead
Product: [Fedora] Fedora Reporter: Karolina Surma <ksurma>
Component: python-pygments-gitAssignee: Ankur Sinha (FranciscoD) <sanjay.ankur>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ksurma, mhroncok, sanjay.ankur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:    
Bug Blocks: 2567340    

Description Karolina Surma 2026-11-25 15:26:36 UTC
python-pygments-git fails to build with Python 3.16.0a2.

+ /usr/bin/python3 -m tox --current-env --assert-config -q --recreate -e py316
/usr/lib64/python3.16/site-packages/coverage/inorout.py:560: CoverageWarning: Module pygments_git was never imported. (module-not-imported); see https://coverage.readthedocs.io/en/7.17.3/messages.html#warning-module-not-imported
  self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
/usr/lib64/python3.16/site-packages/coverage/control.py:967: CoverageWarning: No data was collected. (no-data-collected); see https://coverage.readthedocs.io/en/7.17.3/messages.html#warning-no-data-collected
  self._warn("No data was collected.", slug="no-data-collected")
Traceback (most recent call last):
  File "<frozen runpy>", line 201, in _run_module_as_main
  File "<frozen runpy>", line 87, in _run_code
  File "/usr/lib64/python3.16/site-packages/coverage/__main__.py", line 12, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib64/python3.16/site-packages/coverage/cmdline.py", line 1169, in main
    status = CoverageScript().command_line(argv)
  File "/usr/lib64/python3.16/site-packages/coverage/cmdline.py", line 863, in command_line
    return self.do_run(options, args)
           ~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.16/site-packages/coverage/cmdline.py", line 1048, in do_run
    runner.run()
    ~~~~~~~~~~^^
  File "/usr/lib64/python3.16/site-packages/coverage/execfile.py", line 179, in run
    self._prepare2()
    ~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.16/site-packages/coverage/execfile.py", line 138, in _prepare2
    pathname, self.package, self.spec = find_module(self.modulename)
                                        ~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.16/site-packages/coverage/execfile.py", line 58, in find_module
    spec = importlib.util.find_spec(mod_main)
  File "<frozen importlib.util>", line 94, in find_spec
  File "/usr/lib/python3.16/site-packages/pytest/__init__.py", line 11, in <module>
    from _pytest.capture import CaptureFixture
  File "/usr/lib/python3.16/site-packages/_pytest/capture.py", line 19, in <module>
    from typing import AnyStr
  File "/usr/lib64/python3.16/typing.py", line 3950, in __getattr__
    warnings._deprecated(
    ~~~~~~~~~~~~~~~~~~~~^
        "typing.AnyStr",
        ^^^^^^^^^^^^^^^^
    ...<5 lines>...
        remove=(3, 21),
        ^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib64/python3.16/_py_warnings.py", line 893, in _deprecated
    _wm.warn(msg, DeprecationWarning, stacklevel=stacklevel)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
DeprecationWarning: 'typing.AnyStr' is deprecated and slated for removal in Python 3.21. Use PEP 695 type parameters with constraints instead

https://docs.python.org/3.16/whatsnew/3.16.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.16/fedora-rawhide-x86_64/11359678-python-pygments-git/

For all our attempts to build python-pygments-git with Python 3.16, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/package/python-pygments-git/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.16:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/

Let us know here if you have any questions.

Python 3.16 is planned to be included in Fedora 47.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.16.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.