Commit Graph

1929 Commits

Author SHA1 Message Date
Dannon Baker 5b4b3892f9 Use corepack to enable yarn in common_startup.sh 2025-10-22 12:49:20 -04:00
mvdbeek b488cf2694 Use nodejs-wheel to install node 2025-09-27 09:17:12 +02: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
Charles Coulombe b08b68a889 Fix assertion on python version
Likely a typo, f-strings were introduced in 3.6
2025-07-24 21:15:28 -04:00
davelopez fdac8820a6 Merge release_25.0 into dev 2025-06-16 14:12:30 +02:00
mvdbeek 37c5e9978c Run make format 2025-05-09 10:53:43 +02:00
Nate Coraor 0ee30084cb Preserve loc permissions 2025-05-09 10:52:17 +02:00
Nate Coraor a5cc985765 Add optional empty directory pruning 2025-05-09 10:52:17 +02:00
Nate Coraor 5027e02bf3 Drop unused colors 2025-05-09 10:52:16 +02:00
Nate Coraor 8f5e50ddcf lint 2025-05-09 10:52:16 +02:00
Nate Coraor da2c8cb321 Drop symlink map, add support for tables that don't use path or dbkey columns. 2025-05-09 10:52:16 +02:00
Nate Coraor 6e79ca5922 Script to reorganize tool data to new layout, symlink logic is broken 2025-05-09 10:52:12 +02:00
Ahmed Awan b80f41816c Merge remote-tracking branch 'upstream/release_24.2' into dev 2025-03-31 10:35:43 -05:00
Nicola Soranzo cd11d22129 Merge branch 'release_24.1' into release_24.2 2025-03-28 17:55:45 +00:00
John Davis 1bf72997a0 Handle "%" character in raw SQL
This statement is prepared for SQLAlchemy but executed via psycopg2 in
the `pgcleanup.py` script. For psycopg2, the "%" character should be replaced
with %% (see docs
https://www.psycopg.org/docs/usage.html#passing-parameters-to-sql-queries).
SQLAlchemy already takes care of it automatically.
2025-03-28 15:08:21 +00:00
Nicola Soranzo 5fe5b53bf3 Fix new ruff 0.11.0 errors
Also:
- Add and fix type annotations
- Fix call of `object_store_allows_id_selection()` method
2025-03-15 17:12:02 +00:00
John Chilton 293ce59e3c Allow bootstrap_test_shed to bypass errors in tool shed 1.0 API.
Alternative to https://github.com/galaxyproject/galaxy/pull/18680 if that never gets deployed.
2025-03-03 20:39:27 -05:00
Nicola Soranzo 49fa860647 Merge pull request #19706 from nsoranzo/type_annot_model
Use model classes from ``galaxy.model`` instead of ``app.model`` object - Part 1
2025-02-26 16:15:21 +00:00
Nicola Soranzo 9477c7773e Use model classes from `galaxy.model instead of app.model` object
for proper type annotation of query results.

Also:
- Drop unused code from `lib/tool_shed/webapp/controllers/user.py`
- Drop Galaxy model code from
  `lib/tool_shed/util/admin_util.py:Admin.purge_user()`
2025-02-26 12:41:40 +00:00
Nicola Soranzo edd8bccf4f Drop support for Python 3.8 2025-02-25 19:20:46 +00:00
Nicola Soranzo 0f1bfb6839 Type annotation improvements 2025-02-21 15:46:14 +00:00
Nicola Soranzo dd80698e4b Removed deprecated `current` attribute of scoped_session 2025-02-21 09:29:41 +00:00
Nicola Soranzo 7ce76af796 Format code with black 25.1.0 2025-02-16 18:07:51 +00:00
John Davis 7886de0dd8 Fix typo
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
2025-01-23 11:39:25 -05:00
John Davis 896d0848c2 Remove transaction helper from scripts 2025-01-23 11:39:25 -05:00
Nicola Soranzo 26a4e146e0 Fix UP031 errors
reported by ruff 0.8.0 .
2024-11-24 21:35:23 +00:00
Nate Coraor 235e4ce5c3 Update static handling for welcome.html to automatically load sample if
the non-sample is not present, and for installed Galaxy. Fix robots.txt
and favicon which were not served at all due to middleware.
2024-10-24 13:17:40 -04:00
mvdbeek 3d17e97760 Merge branch 'release_24.1' into dev 2024-09-20 10:53:21 +02:00
John Chilton 307acd972f Add migration that makes dataset uuid unique
and enforces a unique constraint.
Also incldues a script to update purged status for affected datasets
that are not in any object store.
2024-09-20 10:40:12 +02:00
mvdbeek 9da413cf7b Merge branch 'release_24.1' into dev 2024-09-19 11:39:11 +02:00
mvdbeek ec48f50877 Fix wrong celery_app config on job and workflow handlers
Fixes https://github.com/galaxyproject/galaxy/issues/18727 /
https://sentry.galaxyproject.org/share/issue/8091a452f32645b89b37976362779532/:
```
Message
(59965185/49195886) Job wrapper finish method failed
Stack Trace

Newest

OperationalError: unable to open database file
  File "sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
  File "sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
  File "sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
  File "sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
  File "sqlalchemy/pool/impl.py", line 179, in _do_get
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/impl.py", line 177, in _do_get
    return self._create_connection()
  File "sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
  File "sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
  File "sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/20/e3q8)
  File "kombu/connection.py", line 472, in _reraise_as_library_errors
    yield
  File "kombu/connection.py", line 556, in _ensured
    return fun(*args, **kwargs)
  File "kombu/messaging.py", line 202, in _publish
    [maybe_declare(entity) for entity in declare]
  File "kombu/messaging.py", line 202, in <listcomp>
    [maybe_declare(entity) for entity in declare]
  File "kombu/messaging.py", line 107, in maybe_declare
    return maybe_declare(entity, self.channel, retry, **retry_policy)
  File "kombu/common.py", line 113, in maybe_declare
    return _maybe_declare(entity, channel)
  File "kombu/common.py", line 153, in _maybe_declare
    entity.declare(channel=channel)
  File "kombu/entity.py", line 617, in declare
    self._create_queue(nowait=nowait, channel=channel)
  File "kombu/entity.py", line 626, in _create_queue
    self.queue_declare(nowait=nowait, passive=False, channel=channel)
  File "kombu/entity.py", line 655, in queue_declare
    ret = channel.queue_declare(
  File "kombu/transport/virtual/base.py", line 537, in queue_declare
    self._new_queue(queue, **kwargs)
  File "kombu/transport/sqlalchemy/__init__.py", line 159, in _new_queue
    self._get_or_create(queue)
  File "kombu/transport/sqlalchemy/__init__.py", line 138, in _get_or_create
    obj = self.session.query(self.queue_cls) \
  File "kombu/transport/sqlalchemy/__init__.py", line 133, in session
    _, Session = self._open()
  File "kombu/transport/sqlalchemy/__init__.py", line 125, in _open
    metadata.create_all(engine)
  File "sqlalchemy/sql/schema.py", line 5857, in create_all
    bind._run_ddl_visitor(
  File "sqlalchemy/engine/base.py", line 3250, in _run_ddl_visitor
    with self.begin() as conn:
  File "contextlib.py", line 137, in __enter__
    return next(self.gen)
  File "sqlalchemy/engine/base.py", line 3240, in begin
    with self.connect() as conn:
  File "sqlalchemy/engine/base.py", line 3276, in connect
    return self._connection_cls(self)
  File "sqlalchemy/engine/base.py", line 148, in __init__
    Connection._handle_dbapi_exception_noconnection(
  File "sqlalchemy/engine/base.py", line 2440, in _handle_dbapi_exception_noconnection
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "sqlalchemy/engine/base.py", line 146, in __init__
    self._dbapi_connection = engine.raw_connection()
  File "sqlalchemy/engine/base.py", line 3300, in raw_connection
    return self.pool.connect()
  File "sqlalchemy/pool/base.py", line 449, in connect
    return _ConnectionFairy._checkout(self)
  File "sqlalchemy/pool/base.py", line 1263, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "sqlalchemy/pool/base.py", line 712, in checkout
    rec = pool._do_get()
  File "sqlalchemy/pool/impl.py", line 179, in _do_get
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/impl.py", line 177, in _do_get
    return self._create_connection()
  File "sqlalchemy/pool/base.py", line 390, in _create_connection
    return _ConnectionRecord(self)
  File "sqlalchemy/pool/base.py", line 674, in __init__
    self.__connect()
  File "sqlalchemy/pool/base.py", line 900, in __connect
    with util.safe_reraise():
  File "sqlalchemy/util/langhelpers.py", line 146, in __exit__
    raise exc_value.with_traceback(exc_tb)
  File "sqlalchemy/pool/base.py", line 896, in __connect
    self.dbapi_connection = connection = pool._invoke_creator(self)
  File "sqlalchemy/engine/create.py", line 643, in connect
    return dialect.connect(*cargs, **cparams)
  File "sqlalchemy/engine/default.py", line 620, in connect
    return self.loaded_dbapi.connect(*cargs, **cparams)
OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/20/e3q8)
  File "galaxy/jobs/runners/__init__.py", line 677, in _finish_or_resubmit_job
    job_wrapper.finish(
  File "galaxy/jobs/__init__.py", line 2070, in finish
    task_wrapper.delay()
  File "celery/canvas.py", line 353, in delay
    return self.apply_async(partial_args, partial_kwargs)
  File "celery/canvas.py", line 400, in apply_async
    return _apply(args, kwargs, **options)
  File "celery/app/task.py", line 594, in apply_async
    return app.send_task(
  File "celery/app/base.py", line 801, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "celery/app/amqp.py", line 518, in send_task_message
    ret = producer.publish(
  File "kombu/messaging.py", line 186, in publish
    return _publish(
  File "kombu/connection.py", line 553, in _ensured
    with self._reraise_as_library_errors():
  File "contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)
  File "kombu/connection.py", line 476, in _reraise_as_library_errors
    raise ConnectionError(str(exc)) from exc
```
The issue was that we aren't setting `GALAXY_CONFIG_FILE` if the job and
workflow handlers are started with `-c path/to/galaxy.yml`, and the
celery config heuristic isn't looking at sys.argv.
2024-09-16 19:11:18 +02:00
davelopez 985184b458 Fix import issue in bootstrap_test_shed.py
$ make bootstrap_test_backend
cd ../../../..; . .venv/bin/activate; python scripts/bootstrap_test_shed.py
Traceback (most recent call last):
  File "/galaxy/scripts/bootstrap_test_shed.py", line 20, in <module>
    from galaxy.util import requests
ModuleNotFoundError: No module named 'galaxy'
make: *** [Makefile:22: bootstrap_test_backend] Error 1
2024-07-12 17:23:08 +02:00
mvdbeek 0122cdb16e Merge branch 'release_24.0' into release_24.1 2024-06-05 17:43:18 +02:00
mvdbeek 7228c5aad1 Merge branch 'release_23.2' into release_24.0 2024-06-05 15:25:29 +02:00
mvdbeek fed2294c1b Merge branch 'release_23.1' into release_23.2 2024-06-05 10:03:56 +02:00
mvdbeek 06b8db47ba Change hardcoded repo location in more place 2024-05-31 11:36:59 +02:00
mvdbeek 093dcc8d3d Merge branch 'release_24.0' into release_24.1 2024-05-28 14:34:20 +02:00
Nicola Soranzo 8cdca0f343 Revert some requests import changes
introduced in https://github.com/galaxyproject/galaxy/pull/18003 .
In particular, when using requests in the tests to connect to Galaxy
or the ToolShed it's not needed to use the modified headers.

Also:
- Move some imports after conditional imports.
- Fix type annotations in `lib/tool_shed/test/base/populators.py`
- Fix typo bug in `test/unit/util/test_get_url.py`
2024-05-23 15:55:56 +01:00
John Davis 04e77ef134 Remove legacy ref to sqlalchemy migrate 2024-05-22 14:57:53 -04:00
John Chilton 2f43c32fd9 Merge pull request #18003 from mvdbeek/add_galaxy_to_user_agent
Add galaxy to user agent
2024-05-20 12:14:13 -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 0629908541 Fix new UP031 errors from ruff 0.4.2 2024-04-29 00:09:38 +01:00
mvdbeek e8a3b8c0cd Create wrapper for requests with default user agent 2024-04-16 17:54:29 +02:00
John Davis bf62b25eee Merge pull request #17922 from jdavcs/dev_model_edits1
Model edits and bug fixes
2024-04-11 20:30:25 -04:00
mvdbeek 9ff846aba6 Merge branch 'release_24.0' into dev 2024-04-06 16:50:48 +02:00
John Davis 09fee6aaad Remove future, autocommit args from session and engine creation 2024-04-05 13:54:39 -04:00
Nicola Soranzo ad6fbe5b82 Merge branch 'release_23.2' into release_24.0 2024-04-05 14:52:29 +01:00
mvdbeek bd846d9b2e Adjust update_cwl_conformance_tests.sh for removed branch 2024-04-05 13:49:31 +02:00
John Davis 0e61d61f47 Fix SA2.0 error: joinedload does not take str args 2024-04-02 10:08:53 -04:00
Nicola Soranzo a2018a5e60 Enable flake8-comprehensions ruff rules
but allow `dict()` calls that make use of keyword arguments (e.g.,
`dict(a=1, b=2)`).
2024-03-09 19:11:20 +00:00