#1151790 python-npe2: FTBFS: ImportError: cannot import name 'ArgsKwargs' from 'pydantic_core._pydantic_core' (unknown location)

#1151790#5
Date:
2026-10-23 16:27:46 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202610/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:python-npe2, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
    from pydantic_core import __version__ as __pydantic_core_version__
  File "/usr/lib/python3/dist-packages/pydantic_core/__init__.py", line 8, in <module>
    from ._pydantic_core import (
    ...<21 lines>...
    )
ImportError: cannot import name 'ArgsKwargs' from 'pydantic_core._pydantic_core' (unknown location)
E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.15_npe2/build; python3.15 -m pytest -k "not fetch and not test_cli_convert_svg and not test_conversion and not test_render_docs and not test_setuptools_plugin and not test_compile and not test_cli_convert_package_name" tests
I: pybuild base:383: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_npe2/build; python3.14 -m pytest -k "not fetch and not test_cli_convert_svg and not test_conversion and not test_render_docs and not test_setuptools_plugin and not test_compile and not test_cli_convert_package_name" tests
============================= test session starts ==============================
platform linux -- Python 3.14.8, pytest-9.1.1, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>
configfile: pyproject.toml
plugins: npe2-0.8.3, pretty-1.3.0, napari-plugin-engine-0.2.1
collected 265 items / 59 deselected / 1 skipped / 206 selected

tests/test__io_utils.py ..................................               [ 16%]
tests/test_cli.py ...................................                    [ 33%]
tests/test_config_contribution.py ................                       [ 41%]
tests/test_contributions.py .....................                        [ 51%]
tests/test_docs.py .                                                     [ 51%]
tests/test_implements.py ....                                            [ 53%]
tests/test_manifest.py .................                                 [ 62%]
tests/test_npe1_adapter.py ........                                      [ 66%]
tests/test_package_meta.py ...                                           [ 67%]
tests/test_plugin_manager.py ................                            [ 75%]
tests/test_pm_module.py .                                                [ 75%]
tests/test_pytest_plugin.py ......                                       [ 78%]
tests/test_tmp_plugin.py ...                                             [ 80%]
tests/test_utils.py ....                                                 [ 82%]
tests/test_validations.py .....................................          [100%]

============================= slowest 10 durations =============================
0.15s call     .pybuild/cpython3_3.14_npe2/build/tests/test_cli.py::test_cli_validate_load_err
0.04s call     .pybuild/cpython3_3.14_npe2/build/tests/test_npe1_adapter.py::test_npe1_adapter_cache
0.04s call     .pybuild/cpython3_3.14_npe2/build/tests/test_cli.py::test_cli_parse[False-yaml]
0.03s call     .pybuild/cpython3_3.14_npe2/build/tests/test_cli.py::test_cli_parse[False-toml]
0.03s setup    .pybuild/cpython3_3.14_npe2/build/tests/test__io_utils.py::test_read
0.03s call     .pybuild/cpython3_3.14_npe2/build/tests/test_cli.py::test_cli_parse[True-yaml]
0.03s call     .pybuild/cpython3_3.14_npe2/build/tests/test__io_utils.py::test_read_uses_correct_passed_plugin
0.03s call     .pybuild/cpython3_3.14_npe2/build/tests/test_contributions.py::test_writer_priority
0.03s call     .pybuild/cpython3_3.14_npe2/build/tests/test_npe1_adapter.py::test_npe1_adapter
0.03s call     .pybuild/cpython3_3.14_npe2/build/tests/test_cli.py::test_cli_convert_repo_dry_run
Results (0.39s):
       206 passed
         1 skipped
        59 deselected
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.15 3.14" --parallel=2 returned exit code 13
make: *** [debian/rules:6: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1151790#10
Date:
2026-10-27 10:26:42 UTC
From:
To:
Control: retitle -1 python-npe2: FTBFS: importlib.metadata.MetadataNotFound: No package metadata was found
in a different way.  The Python 3.14 tests are fine.  I haven't debugged
this further.

I: pybuild base:383: cd /build/reproducible-path/python-npe2-0.8.3/.pybuild/cpython3_3.15_npe2/build; python3.15 -m pytest -k "not fetch and not test_cli_convert_svg and not test_conversion and not test_render_docs and not test_setuptools_plugin and not test_compile and not test_cli_convert_package_name" tests
============================= test session starts ==============================
platform linux -- Python 3.15.1, pytest-9.1.1, pluggy-1.6.0
rootdir: /build/reproducible-path/python-npe2-0.8.3
configfile: pyproject.toml
plugins: npe2-0.8.3, napari-plugin-engine-0.2.1, pretty-1.3.0
collected 265 items / 59 deselected / 1 skipped / 206 selected

tests/test__io_utils.py ..................................               [ 16%]
tests/test_cli.py ...................................                    [ 33%]
tests/test_config_contribution.py ................                       [ 41%]
tests/test_contributions.py .....................                        [ 51%]
tests/test_docs.py .                                                     [ 51%]
tests/test_implements.py ....                                            [ 53%]
tests/test_manifest.py ....F                                             [ 56%]
.pybuild/cpython3_3.15_npe2/build/tests/test_manifest.py:46 test_discover_errors
tests/test_manifest.py ............                                      [ 62%]
tests/test_npe1_adapter.py ........                                      [ 66%]
tests/test_package_meta.py ...                                           [ 67%]
tests/test_plugin_manager.py ................                            [ 75%]
tests/test_pm_module.py .                                                [ 75%]
tests/test_pytest_plugin.py F                                            [ 76%]
.pybuild/cpython3_3.15_npe2/build/tests/test_pytest_plugin.py:60 test_npe2pm_fixture[\nfrom npe2._pytest_plugin import TestPluginManager\nfrom npe2 import PluginManager\n\ndef test_something_1(npe2pm):\n    assert isinstance(npe2pm, TestPluginManager)\n    assert PluginManager.instance() is npe2pm\n]
tests/test_pytest_plugin.py .....                                        [ 78%]
tests/test_tmp_plugin.py ...                                             [ 80%]
tests/test_utils.py ....                                                 [ 82%]
tests/test_validations.py .....................................          [100%]

=================================== FAILURES ===================================
                          ^^^^^^^^^^^^^^^^

npe2/manifest/schema.py:367:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
npe2/manifest/schema.py:554: in _from_dist
     return PluginManifest._from_entrypoint(_npe2, dist)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <class 'npe2.manifest.schema.PluginManifest'>
entry_point = EntryPoint(name='my-plugin', value='asdfsad:blahblahblah.yaml', group='napari.manifest')
distribution = <importlib.metadata.PathDistribution object at 0x7ff488cd5130>

     @classmethod
     def _from_entrypoint(
         cls,
         entry_point: metadata.EntryPoint,
         distribution: metadata.Distribution | None = None,
     ) -> PluginManifest:
         module_match = entry_point.pattern.match(entry_point.value)
         assert module_match is not None
         module = module_match.group("module")

         spec = util.find_spec(module or "")
         if not spec:  # pragma: no cover
npe2/manifest/schema.py:399: ValueError

During handling of the above exception, another exception occurred:

tmp_path = PosixPath('/tmp/pytest-of-sbuild/pytest-0/test_discover_errors0')

     @pytest.mark.filterwarnings("ignore:Implicit None on return values is deprecated")
     def test_discover_errors(tmp_path: Path):
         """testing various discovery errors"""
         # package with proper `napari.manifest` entry_point, but invalid pointer to
         # a manifest should yield an error in results
         a = tmp_path / "a"
         a.mkdir()
         a_ep = a / "entry_points.txt"
         bad_value = "asdfsad:blahblahblah.yaml"
         a_ep.write_text(f"[napari.manifest]\n{SAMPLE_PLUGIN_NAME} = {bad_value}")

         # package with proper `napari.manifest` entry_point, but invalid manifest
         b = tmp_path / "b"
         b.mkdir()
         b_ep = b / "entry_points.txt"
         b_ep.write_text("[napari.manifest]\nsome_plugin = module:napari.yaml")
         module = tmp_path / "module"
         module.mkdir()
         (module / "napari.yaml").write_text("name: hi??")

         # a regular package, with out napari.manifest entry_point should just be skipped
         c = tmp_path / "c"
         c.mkdir()
         c_ep = c / "entry_points.txt"
         c_ep.write_text("[console.scripts]\nsomething = something")

         dists = [
             metadata.PathDistribution(a),
             metadata.PathDistribution(b),
             metadata.PathDistribution(c),
         ]

         with patch.object(metadata, "distributions", return_value=dists):
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/test_manifest.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:62: in wrapper
     yield from _discover(*args, **kwargs)
npe2/manifest/schema.py:382: in discover
     ENTRY_POINT, dist.metadata["Name"], e
                  ^^^^^^^^^^^^^
/usr/lib/python3.15/importlib/metadata/__init__.py:543: in metadata
     return self._assemble_message(self._ensure_metadata_present(text))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <importlib.metadata.PathDistribution object at 0x7ff488cd5130>
text = None

     def _ensure_metadata_present(self, text: str | None) -> str:
         if text is not None:
             return text
/usr/lib/python3.15/importlib/metadata/__init__.py:556: MetadataNotFound
_ test_npe2pm_fixture[\nfrom npe2._pytest_plugin import TestPluginManager\nfrom npe2 import PluginManager\n\ndef test_something_1(npe2pm):\n    assert isinstance(npe2pm, TestPluginManager)\n    assert PluginManager.instance() is npe2pm\n] _

pytester_pretty = <pytest_pretty.PytesterWrapper object at 0x7ff486d0a7b0>
case = '\nfrom npe2._pytest_plugin import TestPluginManager\nfrom npe2 import PluginManager\n\ndef test_something_1(npe2pm):\n    assert isinstance(npe2pm, TestPluginManager)\n    assert PluginManager.instance() is npe2pm\n'

     @pytest.mark.parametrize("case", [CASE1, CASE2, CASE3, CASE4, CASE5, CASE6])
     def test_npe2pm_fixture(pytester_pretty: pytest.Pytester, case):
         """Make sure that the npe2pm fixture works."""

         # create a temporary pytest test file
         pytester_pretty.makepyfile(case)

/build/reproducible-path/python-npe2-0.8.3/.pybuild/cpython3_3.15_npe2/build/tests/test_pytest_plugin.py:67: AssertionError
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform linux -- Python 3.15.1, pytest-9.1.1, pluggy-1.6.0
rootdir: /tmp/pytest-of-sbuild/pytest-0/test_npe2pm_fixture0
plugins: npe2-0.8.3, napari-plugin-engine-0.2.1, pretty-1.3.0
collected 1 item / 1 error

==================================== ERRORS ====================================