17 Commits
Author SHA1 Message Date
John ChiltonandClaude Opus 5.5 a8f39f2ba5 Move API test code shared with other suites to galaxy_test.base
Integration tests, framework tests and lib/galaxy_test/conftest.py
imported ApiTestCase, tool/workflow/history mixins and sample sheet
helpers from API test modules. Move them to galaxy_test.base;
api/_framework.py re-exports ApiTestCase for the API tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:36:21 -04: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
Nicola Soranzo 7f89e0eab9 Code cleanups from pyupgrade
Found by running:

```
make pyupgrade
ruff check --fix .
ruff check --preview --unsafe-fixes --select=F401 --fix .
make format
make update-client-api-schema
```

The bulk of the changes are replacements of typing deprecated aliases
such as `Dict` and `List` with the standard library classes. These
aliases became redundant in Python 3.9 when the corresponding
pre-existing classes were enhanced to support `[]`, see
https://docs.python.org/3/library/typing.html#deprecated-aliases

Also:
- Update the `pyupgrade` Makefile target to use `--py38-plus` for the
  packages needed by Pulsar, including the new galaxy-tool-util-models
  package.
2025-07-31 11:17:22 +01:00
Nicola Soranzo 053ca5198e Enable `warn_unused_ignores` mypy option 2024-04-16 01:12:58 +01:00
John Chilton aeac8c6060 Restore test framework features... 2022-11-26 11:28:36 -05:00
Nicola Soranzo 3a8997ccf2 Replace `unittest.TestCase` in API, framework, performance, Selenium and ToolShed tests
In API tests, replace no more working `uses_test_history` decorator (because
the `history_id` method parameter is interpreted as a fixture) with a real
class-level pytest fixture.
As a consequence, replace use of `self.history_id` in API tests because it
interferes with the class-level `history_id` fixture.

Also:
- Some type annotations
2022-11-07 15:44:01 +00:00
Nicola Soranzo 7f55e10cd2 Remove now redundant base class 2022-09-21 01:18:56 +01:00
mvdbeek c14d6164e9 Enable celery in API, Selenium, Integration tests 2022-05-25 19:46:47 +02:00
Dannon Baker 623a5e165a Apply black formatting.
Apply isort.
2022-02-03 07:42:20 -05:00
Michael R. Crusoe 7819fdc7a6 tighten type ignores 2021-11-23 13:12:07 +01:00
John Chilton fa2d2092f8 Type fixes: galaxy_test.api.test_tools. 2021-10-11 16:32:29 -04:00
John Chilton 8484f40f31 mypy for test/ 2020-12-25 17:38:51 -05:00
Nicola Soranzo 9d74bba7fb Drop support for retired Python 3.5
Upgrade syntax using `pyupgrade --py36-plus` .

Manually drop several `six` imports.

Also:
- Remove broken pr_cache in scripts/bootstrap_history.py
- Fix broken prefix removal in lib/galaxy/tool_util/deps/mulled/mulled_build.py
2020-10-07 11:52:13 +01:00
Matthias Bernt b2c23e2392 fix rebasing errors
ApiTestCase has been moved and I missed the additional base class
which is necessary for resolving the MRO
2020-09-09 18:20:02 +02:00
John Chilton 2c2ed3f288 Decouple API and Selenium tests from galaxy-test-driver (and the whole app!)
I've been refactoring toward this for at least half a decade. Being able to pip install the API and Selenium tests without bringing in the whole app is important to make them usable outside the context of the app - for testing remote, running servers for instance.

If galaxy-test-driver is available the test cases will still spawn a Galaxy instance if needed, but this is not longer required for import or use.
2020-07-06 13:57:48 -04:00
John ChiltonandMarius van den Beek 97c0574898 Update lib/galaxy_test/api/_framework.py
Co-Authored-By: Marius van den Beek <m.vandenbeek@gmail.com>
2019-11-12 11:24:23 -05:00
John Chilton d04c020747 Migrate api tests into lib/galaxy_test for packaging. 2019-11-12 09:05:08 -05:00