Closed matthewfeickert closed 1 month ago
Setting a breakpoint
just before
BACKENDS[backend].run_workflow(name, spec)
in
results in
$ PACKTIVITY_DOCKER_CMD_MOD="-u root" recast run examples/rome --backend local --tag "local-$(coolname 2)"
> /home/feickert/.pyenv/versions/3.12.1/envs/juhofer-debug/lib/python3.12/site-packages/recastatlas/backends/__init__.py(79)run_sync()
-> BACKENDS[backend].run_workflow(name, spec)
(Pdb) backend
'local'
(Pdb) BACKENDS
{'kubernetes': <recastatlas.backends.kubernetes.KubernetesBackend object at 0x7f0539fe5250>, 'docker': <recastatlas.backends.docker.DockerBackend object at 0x7f053abe6330>}
(Pdb) from recastatlas.backends.local import LocalBackend
*** ModuleNotFoundError: No module named 'pkg_resources'
(Pdb)
So even though pkg_resources
isn't used in the code base directly, it is getting used somewhere.
The problem is that
calls
and yadage
depends on packtivity
which depends on checksumdir
which uses pkg_resources
.
>>> from yadage.steering_api import run_workflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/yadage/steering_api.py", line 8, in <module>
from .steering_object import YadageSteering
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/yadage/steering_object.py", line 8, in <module>
from .wflowstate import load_model_fromstring
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/yadage/wflowstate.py", line 4, in <module>
from .wflow import YadageWorkflow
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/yadage/wflow.py", line 4, in <module>
from .stages import JsonStage, OffsetStage
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/yadage/stages.py", line 5, in <module>
from .state_providers import load_provider
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/yadage/state_providers/__init__.py", line 4, in <module>
from .localposix import LocalFSProvider
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/yadage/state_providers/localposix.py", line 6, in <module>
from packtivity.statecontexts import load_state
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/packtivity/statecontexts/__init__.py", line 4, in <module>
from .posixfs_context import LocalFSState
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/packtivity/statecontexts/posixfs_context.py", line 6, in <module>
import checksumdir
File "/home/feickert/.pyenv/versions/juhofer-debug/lib/python3.12/site-packages/checksumdir/__init__.py", line 17, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
checksumdir
looks unsupported given https://github.com/to-mc/checksumdir/issues/26, so I think the solution is to move packtivity
off of it for an alternative.
Resolved by the release of packtivity
v0.17.0
.
If
recast-atlas
is installed in an environment withoutsetuptools
then running with a non-docker backend
will fail with
This is resolved if
setuptools
is installedbut
recast-atlas
should have no dependence onsetuptools
at all.https://github.com/recast-hep/recast-atlas/blob/11af091e2d5651b33ba234e55e48cd322756597a/pyproject.toml#L1-L6
https://github.com/recast-hep/recast-atlas/blob/11af091e2d5651b33ba234e55e48cd322756597a/src/recastatlas/subcommands/run.py#L58-L64
https://github.com/recast-hep/recast-atlas/blob/11af091e2d5651b33ba234e55e48cd322756597a/src/recastatlas/backends/__init__.py#L76-L78