Skip to content

Commit

Permalink
Merge pull request #19341 from nsoranzo/misc_fixes_202412
Browse files Browse the repository at this point in the history
Misc fixes 202412
  • Loading branch information
mvdbeek authored Dec 18, 2024
2 parents 16ec912 + 4e650b4 commit b74d24f
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/mulled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
key: tox-cache-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-mulled
- name: Install Apptainer's singularity
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.3.6 # https://github.com/eWaterCycle/setup-apptainer/pull/68
- name: Install tox
run: pip install tox
- name: Run tests
Expand Down
1 change: 0 additions & 1 deletion client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28958,7 +28958,6 @@ export interface operations {
};
path: {
library_id: string;
/** @example F0123456789ABCDEF */
id: string;
};
cookie?: never;
Expand Down
2 changes: 2 additions & 0 deletions doc/schema_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ number of tutorials on building Galaxy tools that would better serve that purpos
$tag:tool://element[@name='tool']
$tag:tool|description://element[@name='tool']//element[@name='description']
$tag:tool|macros://complexType[@name='Macros']
$tag:tool|entry_points://complexType[@name='EntryPoints']
$tag:tool|entry_points|entry_point://complexType[@name='EntryPoint']
$tag:tool|edam_topics://complexType[@name='EdamTopics']
$tag:tool|edam_operations://complexType[@name='EdamOperations']
$tag:tool|xrefs://complexType[@name='xrefs']
Expand Down
11 changes: 6 additions & 5 deletions lib/galaxy/config/config_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
APP_DESCRIPTION = """Application to target for operation (i.e. galaxy, tool_shed, or reports))"""
DRY_RUN_DESCRIPTION = """If this action modifies files, just print what would be the result and continue."""
UNKNOWN_OPTION_MESSAGE = "Option [%s] not found in schema - either it is invalid or the Galaxy team hasn't documented it. If invalid, you should manually remove it. If the option is valid but undocumented, please file an issue with the Galaxy team."
USING_SAMPLE_MESSAGE = "Config file not found, using sample."
NO_APP_MAIN_MESSAGE = "No app:main section found, using application defaults throughout."
YAML_COMMENT_WRAPPER = TextWrapper(
initial_indent="# ", subsequent_indent="# ", break_long_words=False, break_on_hyphens=False
Expand Down Expand Up @@ -306,9 +305,11 @@ def _find_config(args: Namespace, app_desc: App) -> str:
if os.path.exists(possible_ini_config):
path = possible_ini_config

if not path:
_warn(USING_SAMPLE_MESSAGE)
if path:
print(f"Found config file {path}")
else:
path = os.path.join(args.galaxy_root, app_desc.sample_destination)
_warn(f"Config file not found, using sample {path}")

return path

Expand Down Expand Up @@ -354,8 +355,8 @@ def _validate(args: Namespace, app_desc: App) -> None:
path = _find_config(args, app_desc)
# Allow empty mapping (not allowed by pykwalify)
raw_config = _order_load_path(path)
if raw_config.get(app_desc.app_name) is None:
raw_config[app_desc.app_name] = {}
# Drop top-level keys (e.g. "gravity") except for app_desc.app_name
raw_config = {app_desc.app_name: raw_config.get(app_desc.app_name) or {}}
# Rewrite the file any way to merge any duplicate keys
with tempfile.NamedTemporaryFile("w", delete=False, suffix=".yml") as config_p:
ordered_dump(raw_config, config_p)
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/config/schemas/config_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ mapping:
helpsite_url:
type: str
required: true
required: false
default: https://help.galaxyproject.org/
per_host: true
desc: |
Expand Down
7 changes: 1 addition & 6 deletions lib/galaxy/datatypes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,7 @@ def set_meta(
def displayable(self, dataset: DatasetProtocol) -> bool:
try:
return (
not dataset.deleted
and not dataset.dataset.purged
and dataset.has_data()
and dataset.state == dataset.states.OK
and dataset.metadata.columns > 0
and dataset.metadata.data_lines != 0
super().displayable(dataset)
and dataset.metadata.chromCol
and dataset.metadata.startCol
and dataset.metadata.endCol
Expand Down
11 changes: 5 additions & 6 deletions lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,12 @@ def value_from_basic(self, value, app, ignore_errors=False):
elif isinstance(value, MutableMapping) and value.get("__class__") == "UnvalidatedValue":
return value["value"]
# Delegate to the 'to_python' method
if ignore_errors:
try:
return self.to_python(value, app)
except Exception:
return value
else:
try:
return self.to_python(value, app)
except Exception:
if not ignore_errors:
raise
return value

def value_to_display_text(self, value) -> str:
if is_runtime_value(value):
Expand Down
16 changes: 8 additions & 8 deletions lib/galaxy/tools/parameters/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def value_from_basic(self, value, app, ignore_errors=False):
else:
rval_dict[input.name] = input.value_from_basic(d[input.name], app, ignore_errors)
rval.append(rval_dict)
except Exception as e:
except Exception:
if not ignore_errors:
raise e
raise
return rval

def get_initial_value(self, trans, context):
Expand Down Expand Up @@ -226,9 +226,9 @@ def value_from_basic(self, value, app, ignore_errors=False):
for input in self.inputs.values():
if not ignore_errors or input.name in value:
rval[input.name] = input.value_from_basic(value[input.name], app, ignore_errors)
except Exception as e:
except Exception:
if not ignore_errors:
raise e
raise
return rval

def get_initial_value(self, trans, context):
Expand Down Expand Up @@ -389,9 +389,9 @@ def value_from_basic(self, value, app, ignore_errors=False):
else:
rval_dict[input.name] = input.value_from_basic(d[input.name], app, ignore_errors)
rval.append(rval_dict)
except Exception as e:
except Exception:
if not ignore_errors:
raise e
raise
return rval

def get_file_count(self, trans, context):
Expand Down Expand Up @@ -794,9 +794,9 @@ def value_from_basic(self, value, app, ignore_errors=False):
# conditional's values dictionary.
if not ignore_errors or input.name in value:
rval[input.name] = input.value_from_basic(value[input.name], app, ignore_errors)
except Exception as e:
except Exception:
if not ignore_errors:
raise e
raise
return rval

def get_initial_value(self, trans, context):
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/services/library_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
str,
Path(
title="The encoded ID of a library folder or dataset.",
example="F0123456789ABCDEF",
examples=["F0123456789ABCDEF"],
min_length=16,
pattern="F?[0-9a-fA-F]+",
),
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
addopts = --doctest-continue-on-failure --verbosity=1
addopts = --doctest-continue-on-failure --verbosity=1 --showlocals
asyncio_mode = auto
log_level = DEBUG
# Install pytest-memray and set memray to true here to enable memory profiling of tests
Expand Down
4 changes: 3 additions & 1 deletion test/unit/tool_shed/test_shed_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def whoosh_index_dir():
@pytest.fixture(scope="module")
def community_file_dir():
extracted_archive_dir = tempfile.mkdtemp()
b = BytesIO(requests.get(URL).content)
response = requests.get(URL)
response.raise_for_status()
b = BytesIO(response.content)
tarfile.open(fileobj=b, mode="r:gz").extractall(extracted_archive_dir)
try:
yield extracted_archive_dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def test_singularity_container_test(tmp_path) -> None:
"singularity",
tmp_path,
)
assert "samtools:1.0--1" in results["passed"]
assert "pybigwig:0.3.22--py36h54a71a5_0" in results["passed"]
assert "yasm:1.3.0--0" in results["notest"]
assert "samtools:1.0--1" in results["passed"], results
assert "pybigwig:0.3.22--py36h54a71a5_0" in results["passed"], results
assert "yasm:1.3.0--0" in results["notest"], results

0 comments on commit b74d24f

Please sign in to comment.