29 Commits
Author SHA1 Message Date
John ChiltonandClaude Opus 5 12e8a1fb7a Bump export_remote to 0.2.0, freeze 0.1.0 alongside it
The sanitize option gained two values - replace spaces, and replace "/"
and spaces - and "/" is now documented as always surviving in
user-supplied names. Results are unchanged for the values 0.1.0 accepted:
"/" and "" both reduce the new named-path character set to the empty
tuple 0.1.0 hardcoded, and the auto branches build the same tuple either
way. The bump is for the input form, which now offers options an older
job was never able to pick.

export_remote.xml carries 0.2.0 and the untouched 0.1.0 is frozen as
export_remote_0.1.0.xml, with both registered in tool_conf.xml.sample and
the framework sample_tool_conf.xml.

Note this inverts the convention used by the bundled collection
operation tools, where the bare filename holds the old version and the
new one carries the version suffix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 12:09:40 -04:00
John Chilton 1a5375b0d0 Clarify export path sanitization names
Use descriptive variable names and explain the named-path slash exception. Align the tool labels and help text with the sanitizer behavior of replacing characters with underscores.
2026-09-20 10:12:12 -04:00
John ChiltonandClaude Opus 5 b25e664d20 Export tool: sanitize option as character set, keep "/" in named paths
Reworks the space-sanitizing option from #18455.

The select value is now the set of characters to strip, so splitting it
yields the individual characters. Drops the "space" sentinel and its
tripled #if/#else, and adds a "/ and spaces" option - the old select
forced an either/or.

Fixes two bugs:

- "Don't sanitize values" passed [""] to filesystem_safe_string, and
  str.replace("", "_") inserts at every position, so that option mangled
  every path it touched.
- The invalid_chars select was ignored entirely for datasets_named,
  which the PR author correctly reported.

Honoring the select for named datasets is what surfaces the underlying
contradiction: "/" is both the documented subdirectory syntax for that
field and the default sanitize target. "/" is now always kept for
user-supplied names, stated in the help text for both params rather
than leaving the control silently dead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-20 09:49:58 -04:00
John Chilton f7cdda5a64 Merge remote-tracking branch 'origin/dev' into export 2026-09-19 15:56:59 -04:00
PlushZ 3d18e37541 Add openBIS file source 2026-09-04 19:19:31 +02:00
paperbenni bec3d3ad9c Drop support for Python 3.8
Drop Python 3.8 support in 5 Pulsar-compatible packages
(job_metrics, tool_util, tool_util_models, util, objectstore)
and run pyupgrade --py310-plus on their source code.

- Bump requires-python from >=3.8 to >=3.10 in all 5 packages
- Remove Python 3.8 and 3.9 classifiers
- Remove ruff per-file-ignores for UP rules on these paths
- Remove backports.zoneinfo conditional dependency
- Remove pydyf<0.11 pin from conditional-requirements.txt
- Update Makefile pyupgrade target (remove PY38_PYUPGRADE_PATHS)
- Update CI workflow to test with Python 3.10 instead of 3.8

Clean up unused deprecated typing imports after pyupgrade

Remove now-unused typing imports (Dict, List, Optional, Set, Tuple,
Type, Union) that became dead after pyupgrade --py310-plus converted
annotations to use built-in types and | syntax.

Also run ruff check --fix --select=UP007,UP045 across the entire
codebase to convert remaining Optional[X] -> X | None and
Union[X, Y] -> X | Y patterns.

Enable ruff UP007/UP045 for Python 3.10 union syntax

Remove UP007 (Union[X,Y] -> X | Y) and UP045 (Optional[X] -> X | None)
from the ruff ignore list and convert all type aliases across the
codebase. These rules were deferred while Python 3.9 was supported;
requires-python is now >=3.10.

A custom script was used because neither ruff --fix nor
pyupgrade --py310-plus converts Optional[X]/Union[X,Y] in type alias
positions (e.g. X = Union[A, B]) — they only handle annotation
positions (e.g. def f(x: Optional[int])). All 167 violations were
module-level type aliases. A few edge cases were fixed manually:
single-element Union[X,], typing.Union qualified refs, runtime
Optional[type] calls, and Annotated[Optional[...]] pydantic fields.

Fix UP007 autofix regression with string forward reference type aliases

Commit fa6bd955a0 enabled ruff UP007/UP045 and auto-fixed
module-level type aliases using Union with string forward
references, producing invalid 'str | str' expressions.

This was a known ruff bug (charliermarsh/ruff#826) that has since
been fixed in later ruff versions, but this codebase was
converted before the fix was in place.

Revert to Union syntax and restore TYPE_CHECKING imports that
ruff's TCH rule cleaned up as a side effect when it thought the
forward references were unused.
2026-06-25 15:12:05 +01:00
Björn Grüning bedf19baa4 change description of the export tool 2025-04-05 22:25:22 +02:00
John Chilton ff011fbe01 Handle directories with percents in export_remote.xml. 2025-03-20 16:25:09 -04:00
mvdbeek 0d1f74e4dd Merge branch 'release_24.1' into dev 2024-08-08 17:43:04 +02:00
davelopezandMarius van den Beek 7d00202034 Fix export_remote include metadata flag
We were passing 'false' to --export-metadata-files, but it was
considered True (non-zero length string), and the metadata was
always included in the export.

Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
2024-08-07 14:46:57 +02:00
Delphine Lariviere 7cf87b0cbb remove duplicated line 2024-06-28 13:10:09 +02:00
Delphine Lariviere 6270c87433 fix sanitizing of slashes and add sanitizing spaces 2024-06-28 13:06:17 +02:00
John Davis b06016d424 Drop send_to_cloud tool 2024-05-21 13:52:24 -04:00
Nicola Soranzo 534010a8cb Enable flake8-implicit-str-concat ruff rules
See https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
2024-04-29 13:37:54 +01:00
Nicola Soranzo 7fee81607c Add linting with ruff
ruff (https://github.com/charliermarsh/ruff) is a new and extremely fast
Python linter, written in Rust.
Ruff can be used to replace Flake8 (plus a variety of plugins), isort,
pydocstyle, yesqa, eradicate, pyupgrade, and autoflake.
Here ruff is added to our current linters (flake8, flake8-bugbear and isort)
while we assess its reliability.
I've not enabled the isort rules because many of the options we use are not
implemented yet. I have instead enabled the pyupgrade rules (a tool which I
run manually every few months).

Also:
- Fix new linting errors reported by ruff.
2023-01-16 14:34:56 +00:00
Dannon Baker 03351d2a9f Apply black to tools as well 2022-02-03 09:12:13 -05:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
Alex Ostrovsky f884f9b149 Allow any format in export tool 2022-01-11 13:10:03 -08:00
Marius van den BeekandNicola Soranzo 94881812a0 Tweak tool options
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2021-08-25 18:03:19 +03:00
mvdbeek ee63fcc736 Allow skipping sanitization of / char
and allow using collection name as outer directory
2021-08-25 10:51:13 +03:00
mvdbeek 8bf9de4e1a Provide $input.serialize(), allow wrap_json to serialize collections 2021-05-28 22:49:49 +02:00
mvdbeek d6e58fb898 Implement export of FileParameter / MetadataFile files 2021-05-27 17:23:42 +02:00
mvdbeek 05d517a384 Mirror collection structure on exported filesystem 2021-05-27 17:21:01 +02:00
mvdbeek f5d05fb545 Allow creation of subdirectories on export 2021-05-27 17:21:01 +02:00
mvdbeek a4c0468813 Sanitize exported filenames
Now can't include leading `.`, `/` and utf null, and is truncated at 255
characters. Duplicate filenames will raise an error.
2021-05-27 17:21:01 +02:00
mvdbeek 920a4b3f77 Provide files to export as json configfile
This avoids shell limits and quoting issues.
2021-05-27 17:21:01 +02:00
mvdbeek f24024c0d7 Add name_and_ext shortcut 2021-05-27 17:21:01 +02:00
mvdbeek 97af023140 Enable datatype aliases for stuff that has weird extensions in Galaxy 2021-05-27 17:21:01 +02:00
John Chilton e9081759ca Add tool for exporting individual files to Galaxy.
Stolen wholesale from EU. Trying to make it a bit more general though.
2021-05-27 17:21:01 +02:00