Previously, the ``validation_dataset_metadata_in_file`` test tool was failing
to load and was not tested at all during framework tests on GitHub Actions.
as documented in the xsd
in addition fix https://github.com/galaxyproject/galaxy/issues/14324,
i.e. document the `separator` attribute of options
also doc that only 1MB is used and lines starting with `#` are always
ignored
for the case that a boolean is referred.
In this case the python string value of the parameter value
needs to be used as the value for the when tag which might be a
bit confusing.
The test is also extended such that:
- multiple (two) conditional actions are used in one output
- referring parameters in sections
The new flake8-bugbear 22.7.1 warns if a function defined inside a loop uses
a variable redefined in the loop, due to the late-binding closure gotcha:
https://docs.python-guide.org/writing/gotchas/#late-binding-closures
When possible/sensible, I've moved the function definition before the loop
(adding the variable(s) as parameters) which is clearly also a speed-up.
Most other cases are false alarms, e.g. if the function is used and
discarded within the loop iteration that defines it. In such cases, I've
annotated the offending lines with a `# noqa: B023`.
The only file where I've applied the suggested workaround of immediately
binding arguments is in `lib/galaxy/visualization/plugins/config_parser.py`
Also:
- Small refactorings, in particular to `scripts/apply_tags.py`
The upload1 tool would have created a dataset in the history that would
have become auto-selected ... which is of course a bug when running
tools via the API, xref
https://github.com/galaxyproject/galaxy/issues/13799.
This fixes
```
ERROR galaxy.tools.actions:__init__.py:683 Cannot remap rerun dependencies.
Traceback (most recent call last):
File "/Users/mvandenb/src/galaxy/lib/galaxy/tools/actions/__init__.py", line 664, in _remap_job_on_rerun
self.__remap_parameters(job_to_remap, jtid, jtod, out_data)
File "/Users/mvandenb/src/galaxy/lib/galaxy/tools/actions/__init__.py", line 694, in __remap_parameters
input_values = {p.name: json.loads(p.value) for p in job_to_remap.parameters}
File "/Users/mvandenb/src/galaxy/lib/galaxy/tools/actions/__init__.py", line 694, in <dictcomp>
input_values = {p.name: json.loads(p.value) for p in job_to_remap.parameters}
File "/usr/local/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not
NoneType
```
Optional data inputs or optional selects are stored as `None` (super
inconsistent, since most other parameters are stored as JOSN. We should
create "basic_2.py" using pydantic at one point not too far into the
future ...). This means we can't call `json.loads` on these. Fortunately
this is the only place we do it, and we don't need to consider optional
parameters here anyway.