The cached job might be skipped and null, in which case we should not
override the `expression.json` extension, because in that case the
dataset would not be considered as a null.
The test failure without any really useful context on the client is bad and indicating a problem - it is going to be some concurrency or database thing in the test environment or an issue with us hitting Github a bunch right in a row. Regardless - it isn't the job of this test case to uncover that I think - I think isolating the network and simplifying the test here will increase the test robustness and ensure it is testing what it is meant to test.
`__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.
This is configurable with two new options:
- `calculate_dataset_hash`: in which cases Galaxy should calculate
a hash for a new dataset. Possible values: 'always', 'upload'
(the default), 'never'.
- `hash_function`. Possible values: 'md5', 'sha1', 'sha256', 'sha512'
Hashes are calculated via a Celery task, so currently only if
the 'enable_celery_tasks' option is set to true.
Currently when uploading datasets with associated hashes, this were
only validated if `validate_hashes=True` was also passed in the
request.
This commit drops `validate_hashes` completely and always validates
hashes when they were provided.
Private requests must be claimed before use. Public / Anonymous requests
only depend on the public flag, so anoymous users can create private
landing requests and authenticated users can create public requests.
Tests should cover all of these scenarios.
I will occasionally see tests that skip instead of failing because the tool required to run the test stopped loading - maybe a parsing error or a misconfiguration around sample data tables. I don't think this should be the default but we should make sure all our CI tests are running properly.