pytest-html requires pkg_resources package. That lib builds just fine, but when in runtime, it cannot find pkg_resources (it uses lib to discover some files so I couldn't just remove this dependency).
python -m pytest -s
Traceback (most recent call last):
File "/nix/store/4c3z5r6yxsf2cxwwyazhdn92xixn4j5b-python3-3.7.5/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/nix/store/4c3z5r6yxsf2cxwwyazhdn92xixn4j5b-python3-3.7.5/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/pytest/main.py", line 7, in
raise SystemExit(pytest.main())
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/_pytest/config/init.py", line 72, in main
config = _prepareconfig(args, plugins)
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/_pytest/config/init.py", line 223, in _prepareconfig
pluginmanager=pluginmanager, args=args
File "/nix/store/r17fx9dfw5mgc2bdf8axb4cqlmygc4hb-python3.7-pluggy-0.13.1/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/nix/store/r17fx9dfw5mgc2bdf8axb4cqlmygc4hb-python3.7-pluggy-0.13.1/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/nix/store/r17fx9dfw5mgc2bdf8axb4cqlmygc4hb-python3.7-pluggy-0.13.1/lib/python3.7/site-packages/pluggy/manager.py", line 87, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/nix/store/r17fx9dfw5mgc2bdf8axb4cqlmygc4hb-python3.7-pluggy-0.13.1/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall
gen.send(outcome)
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse
config = outcome.get_result()
File "/nix/store/r17fx9dfw5mgc2bdf8axb4cqlmygc4hb-python3.7-pluggy-0.13.1/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/nix/store/r17fx9dfw5mgc2bdf8axb4cqlmygc4hb-python3.7-pluggy-0.13.1/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/_pytest/config/init.py", line 793, in pytest_cmdline_parse
self.parse(args)
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/_pytest/config/init.py", line 999, in parse
self._preparse(args, addopts=addopts)
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/_pytest/config/init.py", line 947, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "/nix/store/r17fx9dfw5mgc2bdf8axb4cqlmygc4hb-python3.7-pluggy-0.13.1/lib/python3.7/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
plugin = ep.load()
File "/nix/store/48c1xhr07kacm9y1c82qq12kc2yfj113-python3.7-importlib-metadata-1.4.0/lib/python3.7/site-packages/importlib_metadata/init.py", line 94, in load
module = import_module(match.group('module'))
File "/nix/store/4c3z5r6yxsf2cxwwyazhdn92xixn4j5b-python3-3.7.5/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "/nix/store/3xzqd88h5vqgpblysbr78k1qfgfhay6h-python3.7-pytest-5.3.2/lib/python3.7/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
exec(co, module.dict)
File "/nix/store/nj5wzjfda3ymf0dkfija7bsp3lp4yl1k-python3.7-python3.7-pytest-html-2.0.1/lib/python3.7/site-packages/pytest_html/plugin.py", line 11, in
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
pytest-html requires pkg_resources package. That lib builds just fine, but when in runtime, it cannot find pkg_resources (it uses lib to discover some files so I couldn't just remove this dependency).
To reproduce:
self: super: { "pytest-html" = python.overrideDerivation super.pytest-html (old: { buildInputs = old.buildInputs ++ [ self."setuptools-scm" ]; "pytest-metadata" = super.pytest-metadata.overrideAttrs (old: { buildInputs = old.buildInputs ++ [ self."setuptools-scm" ]; }); }