Devpi-client cannot find Python module packaging_legacy

Greetings

I am stuck trying to devpi upload my Python project (not nix-packaged) to a devpi server.

I am in a nix-shell -p devpi-client on NixOS 26.05 in WSL2 using flakes (which I think should not matter). I get the following error:

$ devpi upload
Traceback (most recent call last):
  File "/nix/store/2kvbdsy2n7wgx6clrxpgsjm95b2y1p2k-devpi-client-7.2.1/bin/.devpi-wrapped", line 9, in <module>
    sys.exit(main())
             ~~~~^^
  File "/nix/store/2kvbdsy2n7wgx6clrxpgsjm95b2y1p2k-devpi-client-7.2.1/lib/python3.13/site-packages/devpi/main.py", line 45, in main
    hub, method = initmain(argv)
                  ~~~~~~~~^^^^^^
  File "/nix/store/2kvbdsy2n7wgx6clrxpgsjm95b2y1p2k-devpi-client-7.2.1/lib/python3.13/site-packages/devpi/main.py", line 57, in initmain
    mod = __import__(mod, None, None, ["__doc__"])
  File "/nix/store/2kvbdsy2n7wgx6clrxpgsjm95b2y1p2k-devpi-client-7.2.1/lib/python3.13/site-packages/devpi/upload.py", line 12, in <module>
    from devpi_common.metadata import Version, get_pyversion_filetype
  File "/nix/store/id0iz5i7dd164rzh07sca1h304yzb112-python3.13-devpi-common-4.1.1/lib/python3.13/site-packages/devpi_common/metadata.py", line 6, in <module>
    from packaging_legacy.version import parse as parse_version
ModuleNotFoundError: No module named 'packaging_legacy'

I don’t know if that’s of any concern: I am using setuptools with setuptools_scm to dynamically infer the version number upon build. python3 -m build (from a venv with python’s build installed) works, though.

From what I can see in the nixpkgs source, python313Packages.packaging-legacy seems to be included in the devpi-client derivation, but only in nativeCheckInputs, which I understand is not included for runtime use of devpi, though the devpi client is meant to execute the build of the Python package…

Am I misunderstanding anything? What should I be doing differently? My intention is not to build a derivation (to nix-package my Python project), but rather package and upload it to a conventional python package repo, what devpi is meant to do.