Commit Graph
58498 Commits
Author SHA1 Message Date
Nicola Soranzo 53f00e407e Update pytest configuration for v7.0
pytest 7.0 added a `pythonpath` setting that replaces (and breaks) the
pytest-pythonpath plugin:

https://docs.pytest.org/en/7.0.x/changelog.html#features
2022-02-07 11:50:55 +00:00
galaxybot 2e7fb00a11 Update Python dependencies 2022-02-05 03:11:10 +00:00
Nicola Soranzo 67b54456a0 Merge branch 'release_22.01' into dev 2022-02-04 16:10:47 +00:00
Nicola Soranzo c1f7799f98 Merge branch 'release_21.09' into release_22.01 2022-02-04 15:36:47 +00:00
Marius van den Beek 529d2e8e08 Merge pull request #13309 from bernt-matthias/topic/hdah-only-undeleted
[22.01] Only create HDAH entries for undeleted HDAs
2022-02-04 15:10:32 +01:00
Björn Grüning 44644a0175 Merge pull request #13304 from mvdbeek/fix_stopping_its_slurm
[21.09] Fix stopping ITs on slurm
2022-02-04 13:46:28 +01:00
Marius van den Beek bb299b9dff Merge pull request #13301 from Smithsonian/Fixfor13297
[21.09] Fix univa job runner setup without nativeSpecification
2022-02-04 13:13:46 +01:00
Matthias BerntandMarius van den Beek 81ff85205d only create HDAH entries for undeleted HDAs
fixes https://github.com/galaxyproject/galaxy/issues/13307

Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
2022-02-04 12:53:06 +01:00
mvdbeek a60a898c3b Fix stopping ITs on slurm
If slurm decided the job is in error. There are configurations of slurm
that error out when cancelling the job monitor script, and others that
don't do this.
2022-02-04 10:44:19 +01:00
Björn Grüning 3ed17ba8b8 Merge pull request #13292 from mvdbeek/tag_filter_input_optional
[22.01] Make tag filter input optional
2022-02-04 10:14:00 +01:00
mvdbeek 6ee7d6bfe2 Merge branch 'release_22.01' into dev 2022-02-04 09:49:21 +01:00
Marius van den Beek a66a8b6e54 Merge pull request #13299 from mvdbeek/disable_required_metadata_filter_for_now
[22.01] Limit required element validation to safe elements
2022-02-04 09:27:26 +01:00
Marius van den Beek 3b25dd6184 Merge pull request #13268 from bgruening/xref_bioconductor
[22.01] Add bioconductor as valid xref for tools
2022-02-03 18:44:19 +01:00
mvdbeek f7eaa0a06d Make RData version optional 2022-02-03 18:31:07 +01:00
mvdbeek fd399a02ae Fix element_is_set check for keys that don't match the datatype
defintion.

Fixes
```
2022-02-03 12:40:03,491 ERROR [galaxy.web.framework.decorators] Uncaught exception in exposed API method:
Traceback (most recent call last):
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/web/framework/decorators.py", line 320, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/webapps/galaxy/api/tools.py", line 563, in create
    return self._create(trans, payload, **kwd)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/webapps/galaxy/api/tools.py", line 631, in _create
    vars = tool.handle_input(trans, incoming, history=target_history, use_cached_job=use_cached_job, input_format=input_format)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/__init__.py", line 1767, in handle_input
    all_params, all_errors, rerun_remap_job_id, collection_info = self.expand_incoming(trans=trans, incoming=incoming, request_context=request_context, input_format=input_format)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/__init__.py", line 1747, in expand_incoming
    populate_state(request_context, self.inputs, expanded_incoming, params, errors, simple_errors=False, input_format=input_format)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/parameters/__init__.py", line 348, in populate_state
    _populate_state_legacy(request_context, inputs, incoming, state, errors=errors, context=context, check=check, simple_errors=simple_errors)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/parameters/__init__.py", line 408, in _populate_state_legacy
    state[input.name] = input.get_initial_value(request_context, context)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/parameters/basic.py", line 1001, in get_initial_value
    options = list(self.get_options(trans, other_values))
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/parameters/basic.py", line 890, in get_options
    return self.options.get_options(trans, other_values)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/parameters/dynamic_options.py", line 763, in get_options
    rval = filter.filter_options(rval, trans, other_values)
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/tools/parameters/dynamic_options.py", line 207, in filter_options
    if not r.metadata.element_is_set(self.key):
  File "/tmp/tmp778b108w/galaxy-dev/lib/galaxy/model/metadata.py", line 175, in element_is_set
    meta_spec = self.parent.metadata.spec[name]
KeyError: 'groups'
```

which happens when forcing a tabular dataset into a more specialized
input https://github.com/galaxyproject/tools-iuc/blob/e22821f51ae326b3696a9456cbc44f9982512a52/tools/mothur/homova.xml#L48

Arguably this is a tool issue, but we already log a KeyError above and
it seems more of a linting issue than something that should cause a test
failure.
2022-02-03 18:30:10 +01:00
Nicola Soranzo 9143dd7ca4 Merge pull request #11162 from dannon/try-again-for-black 2022-02-03 17:05:38 +00:00
ajs6f 10a6db4392 Fix for traceback:
```
Traceback (most recent call last):
  File "lib/galaxy/jobs/runners/__init__.py", line 707, in monitor
    self.check_watched_items()
  File "lib/galaxy/jobs/runners/drmaa.py", line 338, in check_watched_items
    if self._complete_terminal_job(ajs, drmaa_state=state) is not None:
  File "lib/galaxy/jobs/runners/univa.py", line 85, in _complete_terminal_job
    time_granted, mem_granted = _parse_native_specs(ajs.job_id, native_spec)
  File "lib/galaxy/jobs/runners/univa.py", line 572, in _parse_native_specs
    m = re.search(r"rt=([0-9:]+)[\s,]*", native_spec)
  File "/pool/spare/galaxy/galaxy/.venv/lib64/python3.6/re.py", line 182, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object
```

See https://github.com/galaxyproject/galaxy/issues/13297 reported by @ajs6f fix from @mvdbeek
2022-02-03 11:46:42 -05:00
Dannon Baker 2957b314df Add /tools/ application of black to git-blame-ignore-revs as well. Not rebasing this one into the main blob and rerunning because I don't expect merge conflicts like we'd have in the core codebase. 2022-02-03 09:31:11 -05:00
Dannon Baker 03351d2a9f Apply black to tools as well 2022-02-03 09:12:13 -05:00
Nicola Soranzo f74ae05cf1 Update Python formatting docs 2022-02-03 14:08:09 +00:00
Nicola Soranzo 6057338cbd Format files in packages/ with black
with:

```
find packages/ -name '*.py' | xargs black
```

The `packages/` directory is currently excluded in the `[tool.black]`
section of `pyproject.toml` because black follows symlinks.
2022-02-03 14:07:52 +00:00
Nicola Soranzo dc87e8f38a Help black with placement of noqa comments 2022-02-03 14:07:14 +00:00
DannonandNicola Soranzo 34de0307a6 Apply suggestions from code review
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-02-03 08:53:23 -05:00
DannonandNicola Soranzo c440eda909 Add isort github action to python linting workflow.
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-02-03 08:36:21 -05:00
Dannon Baker a59985fc31 Add '.git-blame-ignore-revs' file for better git blame usage with
sweeping changes.  To use this locally just do:
`git config blame.ignoreRevsFile .git-blame-ignore-revs`
And your git blame will now skip revisions indicated in the file.

Now that we have gitignore-ignore-revs, we might as well use it for the big prettier passes

Add isort application to .git-blame-ignore-revs
2022-02-03 07:44:30 -05:00
Dannon Baker 34acc8a683 Black-related mypy fixes 2022-02-03 07:42:23 -05:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
DannonandNicola Soranzo ff2f3600f4 Update Makefile
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-02-03 07:39:47 -05:00
Dannon Baker c6d250516e Add simple make target for formatting everything (non-diff) 2022-02-03 07:39:47 -05:00
Dannon Baker fb454041b1 Ignore E203 even for stricter linting subset 2022-02-03 07:39:47 -05:00
Dannon Baker ff08c9c75e Drop flake8-import-order (this will all be automagically reordered by isort, so there's no need to lint the order) 2022-02-03 07:39:47 -05:00
Dannon Baker bf0ad06e22 Move isort back into devDependencies. 2022-02-03 07:39:47 -05:00
Dannon Baker 2ee2adae5d Fix comments in .isort.cfg -- looks like you can't have inline comments here? 2022-02-03 07:39:47 -05:00
Dannon Baker 3dc305433c Isort config update from Nicola at https://github.com/galaxyproject/galaxy/pull/13270\#discussion_r798123586 2022-02-03 07:39:47 -05:00
Dannon Baker 480b62f372 Add isort devdependency 2022-02-03 07:39:47 -05:00
mvdbeek 54bde2cc2a Move config to .isort.cfg 2022-02-03 07:39:47 -05:00
mvdbeek 0484e3061c Increase line length so long import statements aren't split 2022-02-03 07:39:47 -05:00
mvdbeek 73bd2597bd Configure isort to produce the right import order style 2022-02-03 07:39:47 -05:00
mvdbeek f6f9d119a3 Move conditional import to end of section
This is necessary so that isort doesn't add extra lines between
statements and import order linting doesn't fail.
2022-02-03 07:39:45 -05:00
mvdbeek 94a512b558 Drop python3.6 compat import 2022-02-03 07:38:50 -05:00
Dannon Baker ae59ab561b Reorder pyproject.toml 2022-02-03 07:38:26 -05:00
DannonandNicola Soranzo 0b63c1f504 Apply suggestions from code review
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2022-02-03 07:38:26 -05:00
Dannon Baker 78e2629229 E203 handling -- see discussion in See https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated 2022-02-03 07:38:26 -05:00
Dannon Baker 412b6dc78d Update shared pyfaidx to match (regenerated from poetry, this is the only change that should be required) 2022-02-03 07:38:26 -05:00
Dannon Baker 3987b11805 Add black check action to python linting 2022-02-03 07:38:25 -05:00
Dannon Baker d21474fc84 Add black to dev-dependencies 2022-02-03 07:38:25 -05:00
Dannon Baker 275ad1217f Introduce pyproject.toml for black settings 2022-02-03 07:38:25 -05:00
mvdbeek 7341a90849 Mark Bed as check_required_metadata 2022-02-03 13:11:38 +01:00
mvdbeek 370d343670 Limit required element validation to safe elements
There used to be a long-standing bug in setting up the MetadataValidator
if default values were used. We fixed this in
https://github.com/galaxyproject/galaxy/pull/13139/commits/e194ef97e49c4947711ad1d20873ddc0aa686a66,
but that means we're now checking for all non-optional values before
running a tool. We have a ton of non-optional MetadatElement items
in datatypes that should maybe be optional (an indication might be if
`default` and `no_value` are specified and set to the same value ... but
I'm not sure that's a 100% thing). So I think that reviewing this
requires domain knowledge of the datatypes and what elements are really required,
and I'm not sure we can do this in a timely fashion, and not break
something that used to work.

So my suggestion is that we add `check_required_metadata=True`
on datatypes for which we have checked that non-optional metadata
elements are really non-optional. For those metadata elements
for which this is not the case we skip the validation as we would
do prior to
https://github.com/galaxyproject/galaxy/pull/13139/commits/e194ef97e49c4947711ad1d20873ddc0aa686a66.

As an example I have marked  RDS and RData with check_required_metadata
and added a test for check_required_metadata.
2022-02-03 12:58:38 +01:00
Björn Grüning 949da57ffe change XSD to adopt to the new syntax 2022-02-02 21:03:49 +01:00