galaxyproject / galaxyproject/total-perspective-vortex

linting for tool.tool_type fails

Open
#188 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
18
Forks
19
Avg merge
4d 9h
Merged PRs (30d)
5

Description

When we have the following in our TPV configuration, the linting will fail.

> if: user is not None and not (tool.tool_type in ["expression", "data_source"]

We need an ugly workaround like https://github.com/usegalaxy-eu/infrastructure-playbook/pull/1916/changes

The linting error is:

https://github.com/usegalaxy-eu/infrastructure-playbook/actions/runs/22406199429/job/64866605971

```
File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/tpv/commands/dryrunner.py", line 33, in run
return gateway.map_tool_to_destination(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self.galaxy_app, # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
tpv_config_files=self.tpv_config_files,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/tpv/rules/gateway.py", line 109, in map_tool_to_destination
return destination_mapper.map_to_destination(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
app, tool, user, job, job_wrapper, resource_params, workflow_invocation_uuid
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/tpv/core/mapper.py", line 241, in map_to_destination
evaluated_entity = self.match_combine_evaluate_entities(context, tool, user)
File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/tpv/core/mapper.py", line 204, in match_combine_evaluate_entities
evaluated_entity = combined_entity.evaluate_rules(context)
File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/tpv/core/entities.py", line 571, in evaluate_rules
if rule.is_matching(context):
~~~~~~~~~~~~~~~~^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/tpv/core/entities.py", line 522, in is_matching
if self.evaluator.eval_code_block(str(self.if_condition), context):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.13.11/x64/lib/python3.13/site-packages/tpv/core/loader.py", line 78, in eval_code_block
return eval(eval_block, locals)
File "", line 1, in
AttributeError: 'Tool' object has no attribute 'tool_type'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.