Commit Graph
9 Commits
Author SHA1 Message Date
Nicola Soranzo 78234720c4 Replace deprecated `__package__ with __name__
`__package__` is deprecated since Python 3.13, see
https://docs.python.org/3/reference/datamodel.html#module.__package__

`importlib.resources.files()` can be passed a non-package module
since Python 3.12 (or importlib-resources 5.10.0, see
https://importlib-resources.readthedocs.io/en/latest/history.html#v5-10-0 ),
so we can use `__name__` instead of `__package__`.

Also, I noticed that in lib/galaxy/config/__init__.py we are passing
a directory to `importlib.resources.as_file()`, which is supported
only since Python 3.12 (or importlib-resources 5.9.0).

For the reasons above:
- Update conditional imports in `lib/galaxy/util/resources.py` to
  import from `importlib.resources` only for Python 3.12,
  otherwise from the importlib-resources package.
- Update importlib-resources requirement in galaxy-util package.
- Drop importlib-resources requirement from galaxy-web-apps as it's
  not imported directly from its code any more.
2024-12-16 15:16:41 +00:00
Nicola Soranzo 37116c39a0 Fix type annotation of code using XML etree
by adding lxml-stubs to our typecheck requirements.
2024-01-26 18:41:09 +00:00
mvdbeek ac41a2bd44 More root and model fixes 2024-01-08 11:33:30 +01:00
Michael R. Crusoe 14fb5acc69 importlib_resources is only needed in Python 3.8
Add type hints + fixes
2023-11-27 00:01:54 +00:00
Yakubov, Sergey b342f4ccb6 rename _sync_cache -> sync_cache 2023-11-17 12:08:28 -05:00
Yakubov, Sergey 898c5c942d optimize object store pull
added sync_cache parameter to the get_filename function that allows
skip pulling to cache when not needed
2023-11-14 11:57:40 -05:00
Yakubov, Sergey c30a4c06c2 Replace file_name property with get_file_name function 2023-11-08 17:17:14 -05:00
Nicola Soranzo b4c1119f00 Code cleanups from pyupgrade
Found by running:

```
ack --type=python -f | grep -v '^lib/galaxy/schema/bco/\|^lib/galaxy/schema/drs/\|^tools/' | xargs pyupgrade --py37-plus
```
2023-01-16 14:34:55 +00:00
John Chilton 5c04e71a58 Data manager bundles. 2022-12-20 10:35:17 -05:00