From 3f9cdb40be0310f9e79ff906a596ad222843cdbf Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Mon, 21 Oct 2024 18:09:58 +0100 Subject: [PATCH 1/3] Disallow SQLAlchemy 2.0.36 due to https://github.com/sqlalchemy/sqlalchemy/issues/12019 . --- packages/app/setup.cfg | 2 +- packages/data/setup.cfg | 2 +- packages/job_execution/setup.cfg | 2 +- packages/tool_shed/setup.cfg | 2 +- packages/web_apps/setup.cfg | 3 +-- packages/web_framework/setup.cfg | 2 +- packages/web_stack/setup.cfg | 2 +- pyproject.toml | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/app/setup.cfg b/packages/app/setup.cfg index 1184ee741978..285e9b8c7bf0 100644 --- a/packages/app/setup.cfg +++ b/packages/app/setup.cfg @@ -68,7 +68,7 @@ install_requires = refgenconf>=0.12.0 regex requests - SQLAlchemy>=2.0,<2.1 + SQLAlchemy>=2.0,<2.1,!=2.0.36 sqlitedict starlette svgwrite diff --git a/packages/data/setup.cfg b/packages/data/setup.cfg index c48c3d1825bc..8c271593cbe2 100644 --- a/packages/data/setup.cfg +++ b/packages/data/setup.cfg @@ -59,7 +59,7 @@ install_requires = pysam>=0.21 rocrate social-auth-core[openidconnect]==4.0.3 - SQLAlchemy>=2.0,<2.1 + SQLAlchemy>=2.0,<2.1,!=2.0.36 tifffile typing-extensions WebOb diff --git a/packages/job_execution/setup.cfg b/packages/job_execution/setup.cfg index 5e0e0d02b9c5..827c34922e2c 100644 --- a/packages/job_execution/setup.cfg +++ b/packages/job_execution/setup.cfg @@ -38,7 +38,7 @@ install_requires = galaxy-tool-util galaxy-util MarkupSafe - SQLAlchemy>=2.0,<2.1 + SQLAlchemy>=2.0,<2.1,!=2.0.36 packages = find: python_requires = >=3.8 diff --git a/packages/tool_shed/setup.cfg b/packages/tool_shed/setup.cfg index 2f167e97693a..217d4d4d2f1e 100644 --- a/packages/tool_shed/setup.cfg +++ b/packages/tool_shed/setup.cfg @@ -52,7 +52,7 @@ install_requires = Paste pydantic>=2.7.4 Routes - SQLAlchemy>=2.0,<2.1 + SQLAlchemy>=2.0,<2.1,!=2.0.36 starlette starlette-context starlette-graphene3 diff --git a/packages/web_apps/setup.cfg b/packages/web_apps/setup.cfg index c33e2002f9a1..914d43a895d2 100644 --- a/packages/web_apps/setup.cfg +++ b/packages/web_apps/setup.cfg @@ -57,8 +57,7 @@ install_requires = PyYAML requests Routes - SQLAlchemy>=2.0,<2.1 - sqlalchemy-migrate + SQLAlchemy>=2.0,<2.1,!=2.0.36 starlette starlette-context tuswsgi diff --git a/packages/web_framework/setup.cfg b/packages/web_framework/setup.cfg index d9c47cd7e37d..c9cc44ab8c46 100644 --- a/packages/web_framework/setup.cfg +++ b/packages/web_framework/setup.cfg @@ -40,7 +40,7 @@ install_requires = pydantic>=2.7.4 requests Routes - SQLAlchemy>=2.0,<2.1 + SQLAlchemy>=2.0,<2.1,!=2.0.36 WebOb packages = find: diff --git a/packages/web_stack/setup.cfg b/packages/web_stack/setup.cfg index e3d80a798b06..3daf83c89e40 100644 --- a/packages/web_stack/setup.cfg +++ b/packages/web_stack/setup.cfg @@ -34,7 +34,7 @@ include_package_data = True install_requires = galaxy-data galaxy-util - SQLAlchemy>=2.0,<2.1 + SQLAlchemy>=2.0,<2.1,!=2.0.36 packages = find: python_requires = >=3.8 diff --git a/pyproject.toml b/pyproject.toml index 42cb29994ffe..96860904bd55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,7 +110,7 @@ Routes = "*" schema-salad = "!=8.3.20220721194857" # https://github.com/common-workflow-language/schema_salad/issues/575 social-auth-core = ">=4.5.0" # to drop dependency on abandoned python-jose sortedcontainers = "*" -SQLAlchemy = "^2.0" +SQLAlchemy = ">=2.0,<2.1,!=2.0.36" # https://github.com/sqlalchemy/sqlalchemy/issues/12019 sqlitedict = "*" sqlparse = "*" starlette = "*" From 82e7fd97ce449e40efcf0b829140dfcd4292ce8f Mon Sep 17 00:00:00 2001 From: galaxybot Date: Sat, 19 Oct 2024 03:20:00 +0000 Subject: [PATCH 2/3] Update Python dependencies by running `make update-dependencies`. --- lib/galaxy/dependencies/dev-requirements.txt | 22 +++++++------- .../dependencies/pinned-lint-requirements.txt | 2 +- .../dependencies/pinned-requirements.txt | 29 +++++++++---------- .../pinned-typecheck-requirements.txt | 16 +++++----- 4 files changed, 33 insertions(+), 36 deletions(-) diff --git a/lib/galaxy/dependencies/dev-requirements.txt b/lib/galaxy/dependencies/dev-requirements.txt index 4d38a19dcd8a..50e5db6dc2ef 100644 --- a/lib/galaxy/dependencies/dev-requirements.txt +++ b/lib/galaxy/dependencies/dev-requirements.txt @@ -4,7 +4,7 @@ aiohappyeyeballs==2.4.3 ; python_version >= "3.8" and python_version < "3.13" aiohttp==3.10.10 ; python_version >= "3.8" and python_version < "3.13" aiosignal==1.3.1 ; python_version >= "3.8" and python_version < "3.13" alabaster==0.7.13 ; python_version >= "3.8" and python_version < "3.13" -anyio==4.5.0 ; python_version >= "3.8" and python_version < "3.13" +anyio==4.5.2 ; python_version >= "3.8" and python_version < "3.13" ase==3.23.0 ; python_version >= "3.8" and python_version < "3.13" async-timeout==4.0.3 ; python_version >= "3.8" and python_version < "3.11" attrs==24.2.0 ; python_version >= "3.8" and python_version < "3.13" @@ -26,7 +26,7 @@ colorama==0.4.6 ; python_version >= "3.8" and python_version < "3.13" and (sys_p contourpy==1.1.1 ; python_version >= "3.8" and python_version < "3.9" contourpy==1.3.0 ; python_version >= "3.9" and python_version < "3.13" coverage[toml]==7.6.1 ; python_version >= "3.8" and python_version < "3.13" -cryptography==43.0.1 ; python_version >= "3.8" and python_version < "3.13" +cryptography==43.0.3 ; python_version >= "3.8" and python_version < "3.13" cwltest==2.5.20240906231108 ; python_version >= "3.8" and python_version < "3.13" cycler==0.12.1 ; python_version >= "3.8" and python_version < "3.13" darker==2.1.1 ; python_version >= "3.8" and python_version < "3.13" @@ -98,7 +98,7 @@ pluggy==1.5.0 ; python_version >= "3.8" and python_version < "3.13" port-for==0.7.3 ; python_version >= "3.8" and python_version < "3.13" prettytable==3.11.0 ; python_version >= "3.8" and python_version < "3.13" propcache==0.2.0 ; python_version >= "3.8" and python_version < "3.13" -psutil==6.0.0 ; python_version >= "3.8" and python_version < "3.13" and sys_platform != "cygwin" +psutil==6.1.0 ; python_version >= "3.8" and python_version < "3.13" and sys_platform != "cygwin" psycopg==3.2.3 ; python_version >= "3.8" and python_version < "3.13" pycparser==2.22 ; python_version >= "3.8" and python_version < "3.13" pyee==12.0.0 ; python_version >= "3.8" and python_version < "3.13" @@ -122,7 +122,7 @@ pytest-postgresql==6.1.1 ; python_version >= "3.8" and python_version < "3.13" pytest-shard==0.1.2 ; python_version >= "3.8" and python_version < "3.13" pytest==7.4.4 ; python_version >= "3.8" and python_version < "3.13" python-dateutil==2.9.0.post0 ; python_version >= "3.8" and python_version < "3.13" -python-irodsclient==2.1.0 ; python_version >= "3.8" and python_version < "3.13" +python-irodsclient==2.2.0 ; python_version >= "3.8" and python_version < "3.13" python-slugify==8.0.4 ; python_version >= "3.8" and python_version < "3.13" pytz==2024.2 ; python_version >= "3.8" and python_version < "3.9" pywin32-ctypes==0.2.3 ; python_version >= "3.8" and python_version < "3.13" and sys_platform == "win32" @@ -138,16 +138,16 @@ rich==13.9.2 ; python_version >= "3.8" and python_version < "3.13" rpds-py==0.20.0 ; python_version >= "3.9" and python_version < "3.13" ruamel-yaml-clib==0.2.8 ; platform_python_implementation == "CPython" and python_version < "3.13" and python_version >= "3.8" ruamel-yaml==0.18.6 ; python_version >= "3.8" and python_version < "3.13" -rucio-clients==35.4.0 ; python_version >= "3.9" and python_version < "3.13" +rucio-clients==35.4.1 ; python_version >= "3.9" and python_version < "3.13" s3transfer==0.10.3 ; python_version >= "3.8" and python_version < "3.13" -schema-salad==8.7.20240905150001 ; python_version >= "3.8" and python_version < "3.13" +schema-salad==8.7.20241010092723 ; python_version >= "3.8" and python_version < "3.13" scipy==1.10.1 ; python_version >= "3.8" and python_version < "3.9" scipy==1.13.1 ; python_version >= "3.9" and python_version < "3.10" scipy==1.14.1 ; python_version >= "3.10" and python_version < "3.13" secretstorage==3.3.3 ; python_version >= "3.8" and python_version < "3.13" and sys_platform == "linux" selenium==4.25.0 ; python_version >= "3.8" and python_version < "3.13" seletools==1.5.0 ; python_version >= "3.8" and python_version < "3.13" -setuptools==75.1.0 ; python_version >= "3.8" and python_version < "3.13" +setuptools==75.2.0 ; python_version >= "3.8" and python_version < "3.13" six==1.16.0 ; python_version >= "3.8" and python_version < "3.13" sniffio==1.3.1 ; python_version >= "3.8" and python_version < "3.13" snowballstemmer==2.2.0 ; python_version >= "3.8" and python_version < "3.13" @@ -166,13 +166,13 @@ stevedore==5.3.0 ; python_version >= "3.9" and python_version < "3.13" tabulate==0.9.0 ; python_version >= "3.9" and python_version < "3.13" testfixtures==8.3.0 ; python_version >= "3.8" and python_version < "3.13" text-unidecode==1.3 ; python_version >= "3.8" and python_version < "3.13" -tinydb==4.8.1 ; python_version >= "3.8" and python_version < "3.13" +tinydb==4.8.2 ; python_version >= "3.8" and python_version < "3.13" toml==0.10.2 ; python_version >= "3.8" and python_version < "3.13" tomli==2.0.2 ; python_version >= "3.8" and python_full_version <= "3.11.0a6" trio-websocket==0.11.1 ; python_version >= "3.8" and python_version < "3.13" -trio==0.26.2 ; python_version >= "3.8" and python_version < "3.13" +trio==0.27.0 ; python_version >= "3.8" and python_version < "3.13" tuspy==1.0.3 ; python_version >= "3.8" and python_version < "3.13" -twill==3.2.5 ; python_version >= "3.8" and python_version < "3.13" +twill==3.3 ; python_version >= "3.8" and python_version < "3.13" twine==5.1.1 ; python_version >= "3.8" and python_version < "3.13" typing-extensions==4.12.2 ; python_version >= "3.8" and python_version < "3.13" tzdata==2024.2 ; python_version >= "3.8" and python_version < "3.13" and sys_platform == "win32" @@ -184,5 +184,5 @@ websocket-client==1.8.0 ; python_version >= "3.8" and python_version < "3.13" werkzeug==3.0.4 ; python_version >= "3.8" and python_version < "3.13" wrapt==1.16.0 ; python_version >= "3.8" and python_version < "3.13" wsproto==1.2.0 ; python_version >= "3.8" and python_version < "3.13" -yarl==1.15.0 ; python_version >= "3.8" and python_version < "3.13" +yarl==1.15.2 ; python_version >= "3.8" and python_version < "3.13" zipp==3.20.2 ; python_version >= "3.8" and python_version < "3.13" diff --git a/lib/galaxy/dependencies/pinned-lint-requirements.txt b/lib/galaxy/dependencies/pinned-lint-requirements.txt index 37feaac86fe3..0f3613e5155a 100644 --- a/lib/galaxy/dependencies/pinned-lint-requirements.txt +++ b/lib/galaxy/dependencies/pinned-lint-requirements.txt @@ -4,4 +4,4 @@ flake8-bugbear==24.8.19 mccabe==0.7.0 pycodestyle==2.12.1 pyflakes==3.2.0 -ruff==0.6.9 +ruff==0.7.0 diff --git a/lib/galaxy/dependencies/pinned-requirements.txt b/lib/galaxy/dependencies/pinned-requirements.txt index e19f442af6c6..3894ee456644 100644 --- a/lib/galaxy/dependencies/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pinned-requirements.txt @@ -11,9 +11,8 @@ aioitertools==0.12.0 ; python_version >= "3.8" and python_version < "3.13" aiosignal==1.3.1 ; python_version >= "3.8" and python_version < "3.13" alembic==1.13.3 ; python_version >= "3.8" and python_version < "3.13" amqp==5.2.0 ; python_version >= "3.8" and python_version < "3.13" -aniso8601==9.0.1 ; python_version >= "3.8" and python_version < "3.13" annotated-types==0.7.0 ; python_version >= "3.8" and python_version < "3.13" -anyio==4.5.0 ; python_version >= "3.8" and python_version < "3.13" +anyio==4.5.2 ; python_version >= "3.8" and python_version < "3.13" apispec==6.6.1 ; python_version >= "3.8" and python_version < "3.13" appdirs==1.4.4 ; python_version >= "3.8" and python_version < "3.13" arcp==0.2.1 ; python_version >= "3.8" and python_version < "3.13" @@ -52,9 +51,9 @@ cloudbridge==3.2.0 ; python_version >= "3.8" and python_version < "3.13" colorama==0.4.6 ; python_version >= "3.8" and python_version < "3.13" and platform_system == "Windows" coloredlogs==15.0.1 ; python_version >= "3.8" and python_version < "3.13" conda-package-streaming==0.11.0 ; python_version >= "3.8" and python_version < "3.13" -cryptography==43.0.1 ; python_version >= "3.8" and python_version < "3.13" +cryptography==43.0.3 ; python_version >= "3.8" and python_version < "3.13" cwl-upgrader==1.2.11 ; python_version >= "3.8" and python_version < "3.13" -cwl-utils==0.34 ; python_version >= "3.8" and python_version < "3.13" +cwl-utils==0.35 ; python_version >= "3.8" and python_version < "3.13" cwltool==3.1.20241007082533 ; python_version >= "3.8" and python_version < "3.13" defusedxml==0.7.1 ; python_version >= "3.8" and python_version < "3.13" deprecation==2.1.0 ; python_version >= "3.8" and python_version < "3.13" @@ -66,7 +65,7 @@ dparse==0.6.3 ; python_version >= "3.8" and python_version < "3.13" edam-ontology==1.25.2 ; python_version >= "3.8" and python_version < "3.13" email-validator==2.2.0 ; python_version >= "3.8" and python_version < "3.13" exceptiongroup==1.2.2 ; python_version >= "3.8" and python_version < "3.11" -fastapi-slim==0.115.0 ; python_version >= "3.8" and python_version < "3.13" +fastapi-slim==0.115.2 ; python_version >= "3.8" and python_version < "3.13" filelock==3.16.1 ; python_version >= "3.8" and python_version < "3.13" frozenlist==1.4.1 ; python_version >= "3.8" and python_version < "3.13" fs==2.4.16 ; python_version >= "3.8" and python_version < "3.13" @@ -74,8 +73,8 @@ fsspec==2024.9.0 ; python_version >= "3.8" and python_version < "3.13" future==1.0.0 ; python_version >= "3.8" and python_version < "3.13" galaxy2cwl==0.1.4 ; python_version >= "3.8" and python_version < "3.13" graphene-sqlalchemy==3.0.0rc1 ; python_version >= "3.8" and python_version < "3.13" -graphene==3.3 ; python_version >= "3.8" and python_version < "3.13" -graphql-core==3.2.4 ; python_version >= "3.8" and python_version < "3.13" +graphene==3.4 ; python_version >= "3.8" and python_version < "3.13" +graphql-core==3.2.5 ; python_version >= "3.8" and python_version < "3.13" graphql-relay==3.2.0 ; python_version >= "3.8" and python_version < "3.13" gravity==1.0.6 ; python_version >= "3.8" and python_version < "3.13" greenlet==3.0.3 ; python_version < "3.13" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_version >= "3.8" @@ -132,7 +131,7 @@ promise==2.3 ; python_version >= "3.8" and python_version < "3.13" prompt-toolkit==3.0.48 ; python_version >= "3.8" and python_version < "3.13" propcache==0.2.0 ; python_version >= "3.8" and python_version < "3.13" prov==1.5.1 ; python_version >= "3.8" and python_version < "3.13" -psutil==6.0.0 ; python_version >= "3.8" and python_version < "3.13" +psutil==6.1.0 ; python_version >= "3.8" and python_version < "3.13" pulsar-galaxy-lib==0.15.6 ; python_version >= "3.8" and python_version < "3.13" pycparser==2.22 ; python_version >= "3.8" and python_version < "3.13" pycryptodome==3.21.0 ; python_version >= "3.8" and python_version < "3.13" @@ -175,9 +174,9 @@ rpds-py==0.20.0 ; python_version >= "3.8" and python_version < "3.13" ruamel-yaml-clib==0.2.8 ; platform_python_implementation == "CPython" and python_version < "3.13" and python_version >= "3.8" ruamel-yaml==0.18.6 ; python_version >= "3.8" and python_version < "3.13" s3fs==2024.9.0 ; python_version >= "3.8" and python_version < "3.13" -schema-salad==8.7.20240905150001 ; python_version >= "3.8" and python_version < "3.13" +schema-salad==8.7.20241010092723 ; python_version >= "3.8" and python_version < "3.13" setuptools-scm==5.0.2 ; python_version >= "3.8" and python_version < "3.13" -setuptools==75.1.0 ; python_version >= "3.8" and python_version < "3.13" +setuptools==75.2.0 ; python_version >= "3.8" and python_version < "3.13" six==1.16.0 ; python_version >= "3.8" and python_version < "3.13" sniffio==1.3.1 ; python_version >= "3.8" and python_version < "3.13" social-auth-core==4.5.4 ; python_version >= "3.8" and python_version < "3.13" @@ -188,12 +187,12 @@ sqlitedict==2.1.0 ; python_version >= "3.8" and python_version < "3.13" sqlparse==0.5.1 ; python_version >= "3.8" and python_version < "3.13" starlette-context==0.3.6 ; python_version >= "3.8" and python_version < "3.13" starlette-graphene3==0.6.0 ; python_version >= "3.8" and python_version < "3.13" -starlette==0.38.6 ; python_version >= "3.8" and python_version < "3.13" +starlette==0.40.0 ; python_version >= "3.8" and python_version < "3.13" supervisor==4.2.5 ; python_version >= "3.8" and python_version < "3.13" svgwrite==1.4.3 ; python_version >= "3.8" and python_version < "3.13" tenacity==9.0.0 ; python_version >= "3.8" and python_version < "3.13" tifffile==2023.7.10 ; python_version >= "3.8" and python_version < "3.13" -tinydb==4.8.1 ; python_version >= "3.8" and python_version < "3.13" +tinydb==4.8.2 ; python_version >= "3.8" and python_version < "3.13" tomli==2.0.2 ; python_version >= "3.8" and python_version < "3.11" tornado==6.4.1 ; python_version >= "3.8" and python_version < "3.13" tqdm==4.66.5 ; python_version >= "3.8" and python_version < "3.13" @@ -204,8 +203,8 @@ tzdata==2024.2 ; python_version >= "3.8" and python_version < "3.13" tzlocal==5.2 ; python_version >= "3.8" and python_version < "3.13" ubiquerg==0.8.0 ; python_version >= "3.8" and python_version < "3.13" urllib3==1.26.20 ; python_version >= "3.8" and python_version < "3.13" -uvicorn==0.31.1 ; python_version >= "3.8" and python_version < "3.13" -uvloop==0.20.0 ; python_version >= "3.8" and python_version < "3.13" +uvicorn==0.32.0 ; python_version >= "3.8" and python_version < "3.13" +uvloop==0.21.0 ; python_version >= "3.8" and python_version < "3.13" vine==5.1.0 ; python_version >= "3.8" and python_version < "3.13" wcwidth==0.2.13 ; python_version >= "3.8" and python_version < "3.13" webencodings==0.5.1 ; python_version >= "3.8" and python_version < "3.13" @@ -213,7 +212,7 @@ webob==1.8.8 ; python_version >= "3.8" and python_version < "3.13" whoosh==2.7.4 ; python_version >= "3.8" and python_version < "3.13" wrapt==1.16.0 ; python_version >= "3.8" and python_version < "3.13" yacman==0.9.3 ; python_version >= "3.8" and python_version < "3.13" -yarl==1.15.0 ; python_version >= "3.8" and python_version < "3.13" +yarl==1.15.2 ; python_version >= "3.8" and python_version < "3.13" zipp==3.20.2 ; python_version >= "3.8" and python_version < "3.13" zipstream-new==1.1.8 ; python_version >= "3.8" and python_version < "3.13" zstandard==0.23.0 ; python_version >= "3.8" and python_version < "3.13" diff --git a/lib/galaxy/dependencies/pinned-typecheck-requirements.txt b/lib/galaxy/dependencies/pinned-typecheck-requirements.txt index e66208b2a104..328c76785427 100644 --- a/lib/galaxy/dependencies/pinned-typecheck-requirements.txt +++ b/lib/galaxy/dependencies/pinned-typecheck-requirements.txt @@ -1,14 +1,12 @@ ---extra-index-url https://wheels.galaxyproject.org/simple - annotated-types==0.7.0 ; python_version >= "3.8" and python_version < "3.13" -boto3-stubs[s3]==1.35.39 ; python_version >= "3.8" and python_version < "3.13" -botocore-stubs==1.35.39 ; python_version >= "3.8" and python_version < "3.13" +boto3-stubs[s3]==1.35.44 ; python_version >= "3.8" and python_version < "3.13" +botocore-stubs==1.35.44 ; python_version >= "3.8" and python_version < "3.13" cffi==1.17.1 ; python_version >= "3.8" and python_version < "3.13" and platform_python_implementation != "PyPy" -cryptography==43.0.1 ; python_version >= "3.8" and python_version < "3.13" +cryptography==43.0.3 ; python_version >= "3.8" and python_version < "3.13" lxml-stubs==0.5.1 ; python_version >= "3.8" and python_version < "3.13" -mypy-boto3-s3==1.35.32 ; python_version >= "3.8" and python_version < "3.13" +mypy-boto3-s3==1.35.42 ; python_version >= "3.8" and python_version < "3.13" mypy-extensions==1.0.0 ; python_version >= "3.8" and python_version < "3.13" -mypy==1.11.2 ; python_version >= "3.8" and python_version < "3.13" +mypy==1.12.0 ; python_version >= "3.8" and python_version < "3.13" pycparser==2.22 ; python_version >= "3.8" and python_version < "3.13" and platform_python_implementation != "PyPy" pydantic-core==2.23.4 ; python_version >= "3.8" and python_version < "3.13" pydantic==2.9.2 ; python_version >= "3.8" and python_version < "3.13" @@ -19,14 +17,14 @@ types-boto==2.49.18.20240806 ; python_version >= "3.8" and python_version < "3.1 types-contextvars==2.4.7.3 ; python_version >= "3.8" and python_version < "3.13" types-dataclasses==0.6.6 ; python_version >= "3.8" and python_version < "3.13" types-docutils==0.21.0.20241005 ; python_version >= "3.8" and python_version < "3.13" -types-html5lib==1.1.11.20240806 ; python_version >= "3.8" and python_version < "3.13" +types-html5lib==1.1.11.20241018 ; python_version >= "3.8" and python_version < "3.13" types-markdown==3.7.0.20240822 ; python_version >= "3.8" and python_version < "3.13" types-paramiko==3.5.0.20240928 ; python_version >= "3.8" and python_version < "3.13" types-python-dateutil==2.9.0.20241003 ; python_version >= "3.8" and python_version < "3.13" types-pyyaml==6.0.12.20240917 ; python_version >= "3.8" and python_version < "3.13" types-requests==2.31.0.6 ; python_version >= "3.8" and python_version < "3.13" types-s3transfer==0.10.3 ; python_version >= "3.8" and python_version < "3.13" -types-setuptools==75.1.0.20240917 ; python_version >= "3.8" and python_version < "3.13" +types-setuptools==75.2.0.20241019 ; python_version >= "3.8" and python_version < "3.13" types-six==1.16.21.20241009 ; python_version >= "3.8" and python_version < "3.13" types-urllib3==1.26.25.14 ; python_version >= "3.8" and python_version < "3.13" typing-extensions==4.12.2 ; python_version >= "3.8" and python_version < "3.13" From 9f780658e7833e1fd40b84a235e6785487ee8b47 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Mon, 21 Oct 2024 13:20:08 +0100 Subject: [PATCH 3/3] Fixes for mypy 1.12.0 --- lib/galaxy/managers/notification.py | 18 ++++----- lib/galaxy/tool_util/verify/interactor.py | 40 +++++++++---------- lib/galaxy/tools/__init__.py | 2 +- .../webapps/galaxy/api/library_datasets.py | 4 +- lib/galaxy/webapps/galaxy/api/users.py | 28 ++++++------- .../galaxy/services/library_contents.py | 2 +- lib/galaxy/webapps/galaxy/services/tools.py | 2 +- lib/tool_shed/webapp/api2/repositories.py | 2 +- 8 files changed, 43 insertions(+), 55 deletions(-) diff --git a/lib/galaxy/managers/notification.py b/lib/galaxy/managers/notification.py index 7c7ea171f694..6bd99278e59a 100644 --- a/lib/galaxy/managers/notification.py +++ b/lib/galaxy/managers/notification.py @@ -414,16 +414,14 @@ def update_broadcasted_notification(self, notification_id: int, request: Notific def get_user_notification_preferences(self, user: User) -> UserNotificationPreferences: """Gets the user's current notification preferences or the default ones if no preferences are set.""" - current_notification_preferences = ( - user.preferences[NOTIFICATION_PREFERENCES_SECTION_NAME] - if NOTIFICATION_PREFERENCES_SECTION_NAME in user.preferences - else None - ) - try: - return UserNotificationPreferences.model_validate_json(current_notification_preferences) - except ValidationError: - # Gracefully return default preferences is they don't exist or get corrupted - return UserNotificationPreferences.default() + current_notification_preferences = user.preferences.get(NOTIFICATION_PREFERENCES_SECTION_NAME) + if current_notification_preferences: + try: + return UserNotificationPreferences.model_validate_json(current_notification_preferences) + except ValidationError: + pass + # Gracefully return default preferences is they don't exist or get corrupted + return UserNotificationPreferences.default() def update_user_notification_preferences( self, user: User, request: UpdateUserNotificationPreferencesRequest diff --git a/lib/galaxy/tool_util/verify/interactor.py b/lib/galaxy/tool_util/verify/interactor.py index cccb1aaa9f58..5f3e2ccd775c 100644 --- a/lib/galaxy/tool_util/verify/interactor.py +++ b/lib/galaxy/tool_util/verify/interactor.py @@ -521,12 +521,12 @@ def stage_data_async( metadata = test_data.get("metadata", {}) if not hasattr(metadata, "items"): raise Exception(f"Invalid metadata description found for input [{fname}] - [{metadata}]") - for name, value in test_data.get("metadata", {}).items(): - tool_input[f"files_metadata|{name}"] = value + for metadata_name, value in test_data.get("metadata", {}).items(): + tool_input[f"files_metadata|{metadata_name}"] = value composite_data = test_data["composite_data"] + files = {} if composite_data: - files = {} for i, file_name in enumerate(composite_data): if force_path_paste: file_path = self.test_data_path(tool_id, file_name, tool_version=tool_version) @@ -548,24 +548,21 @@ def stage_data_async( location = self._ensure_valid_location_in(test_data) if fname: file_name = self.test_data_path(tool_id, fname, tool_version=tool_version) - file_name_exists = os.path.exists(f"{file_name}") - upload_from_location = not file_name_exists and location is not None - name = os.path.basename(location if upload_from_location else fname) - tool_input.update( - { - "files_0|NAME": name, - "files_0|type": "upload_dataset", - } - ) - files = {} - if upload_from_location: - tool_input.update({"files_0|url_paste": location}) - elif force_path_paste: - file_name = self.test_data_path(tool_id, fname, tool_version=tool_version) - tool_input.update({"files_0|url_paste": f"file://{file_name}"}) + file_name_exists = os.path.exists(file_name) + tool_input["files_0|type"] = "upload_dataset" + if not file_name_exists and location is not None: + name = location + tool_input["files_0|url_paste"] = location else: - file_content = self.test_data_download(tool_id, fname, is_output=False, tool_version=tool_version) - files = {"files_0|file_data": file_content} + name = fname + if force_path_paste: + file_name = self.test_data_path(tool_id, fname, tool_version=tool_version) + tool_input["files_0|url_paste"] = f"file://{file_name}" + else: + file_content = self.test_data_download(tool_id, fname, is_output=False, tool_version=tool_version) + files["files_0|file_data"] = file_content + name = os.path.basename(name) + tool_input["files_0|NAME"] = name submit_response_object = self.__submit_tool( history_id, "upload1", tool_input, extra_data={"type": "upload_dataset"}, files=files ) @@ -587,8 +584,7 @@ def stage_data_async( def _ensure_valid_location_in(self, test_data: dict) -> Optional[str]: location: Optional[str] = test_data.get("location") - has_valid_location = location and util.is_url(location) - if location and not has_valid_location: + if location and not util.is_url(location): raise ValueError(f"Invalid `location` URL: `{location}`") return location diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index a7b6c96bc1f3..a65a45b4b088 100644 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -737,7 +737,7 @@ def decode(self, values, tool, app): Restore the state from a string """ values = safe_loads(values) or {} - self.page = values.pop("__page__") if "__page__" in values else None + self.page = values.pop("__page__") if "__page__" in values else 0 self.rerun_remap_job_id = values.pop("__rerun_remap_job_id__") if "__rerun_remap_job_id__" in values else None self.inputs = params_from_strings(tool.inputs, values, app, ignore_errors=True) diff --git a/lib/galaxy/webapps/galaxy/api/library_datasets.py b/lib/galaxy/webapps/galaxy/api/library_datasets.py index e8f3c64957a5..59d8065b85cd 100644 --- a/lib/galaxy/webapps/galaxy/api/library_datasets.py +++ b/lib/galaxy/webapps/galaxy/api/library_datasets.py @@ -487,9 +487,7 @@ def load(self, trans, payload=None, **kwd): os.path.realpath(path), ) raise exceptions.RequestParameterInvalidException("The given path is invalid.") - if trans.app.config.user_library_import_check_permissions and not full_path_permission_for_user( - full_dir, path, username - ): + if username is not None and not full_path_permission_for_user(full_dir, path, username): log.error( "User attempted to import a path that resolves to a path outside of their import dir: " "%s -> %s and cannot be read by them.", diff --git a/lib/galaxy/webapps/galaxy/api/users.py b/lib/galaxy/webapps/galaxy/api/users.py index 0d5803971801..9579fa63f79a 100644 --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -395,17 +395,16 @@ def remove_favorite( user = self.service.get_user(trans, user_id) favorites = json.loads(user.preferences["favorites"]) if "favorites" in user.preferences else {} if object_type.value == "tools": - if "tools" in favorites: - favorite_tools = favorites["tools"] - if object_id in favorite_tools: - del favorite_tools[favorite_tools.index(object_id)] - favorites["tools"] = favorite_tools - user.preferences["favorites"] = json.dumps(favorites) - with transaction(trans.sa_session): - trans.sa_session.commit() - else: - raise exceptions.ObjectNotFound("Given object is not in the list of favorites") - return favorites + favorite_tools = favorites.get("tools", []) + if object_id in favorite_tools: + del favorite_tools[favorite_tools.index(object_id)] + favorites["tools"] = favorite_tools + user.preferences["favorites"] = json.dumps(favorites) + with transaction(trans.sa_session): + trans.sa_session.commit() + else: + raise exceptions.ObjectNotFound("Given object is not in the list of favorites") + return FavoriteObjectsSummary.model_validate(favorites) @router.put( "/api/users/{user_id}/favorites/{object_type}", @@ -428,17 +427,14 @@ def set_favorite( raise exceptions.ObjectNotFound(f"Could not find tool with id '{tool_id}'.") if not tool.allow_user_access(user): raise exceptions.AuthenticationFailed(f"Access denied for tool with id '{tool_id}'.") - if "tools" in favorites: - favorite_tools = favorites["tools"] - else: - favorite_tools = [] + favorite_tools = favorites.get("tools", []) if tool_id not in favorite_tools: favorite_tools.append(tool_id) favorites["tools"] = favorite_tools user.preferences["favorites"] = json.dumps(favorites) with transaction(trans.sa_session): trans.sa_session.commit() - return favorites + return FavoriteObjectsSummary.model_validate(favorites) @router.put( "/api/users/{user_id}/theme/{theme}", diff --git a/lib/galaxy/webapps/galaxy/services/library_contents.py b/lib/galaxy/webapps/galaxy/services/library_contents.py index 2e909b00956a..971c356f56d3 100644 --- a/lib/galaxy/webapps/galaxy/services/library_contents.py +++ b/lib/galaxy/webapps/galaxy/services/library_contents.py @@ -163,7 +163,7 @@ def create( with tempfile.NamedTemporaryFile( dir=trans.app.config.new_file_path, prefix="upload_file_data_", delete=False ) as dest: - shutil.copyfileobj(upload_file.file, dest) # type: ignore[misc] # https://github.com/python/mypy/issues/15031 + shutil.copyfileobj(upload_file.file, dest) upload_file.file.close() upload_files.append(dict(filename=upload_file.filename, local_filename=dest.name)) payload.upload_files = upload_files diff --git a/lib/galaxy/webapps/galaxy/services/tools.py b/lib/galaxy/webapps/galaxy/services/tools.py index 9e2298eae134..6897965d112f 100644 --- a/lib/galaxy/webapps/galaxy/services/tools.py +++ b/lib/galaxy/webapps/galaxy/services/tools.py @@ -71,7 +71,7 @@ def create_fetch( with tempfile.NamedTemporaryFile( dir=trans.app.config.new_file_path, prefix="upload_file_data_", delete=False ) as dest: - shutil.copyfileobj(upload_file.file, dest) # type: ignore[misc] # https://github.com/python/mypy/issues/15031 + shutil.copyfileobj(upload_file.file, dest) util.umask_fix_perms(dest.name, trans.app.config.umask, 0o0666) upload_file.file.close() files_payload[f"files_{i}|file_data"] = FilesPayload( diff --git a/lib/tool_shed/webapp/api2/repositories.py b/lib/tool_shed/webapp/api2/repositories.py index b20f3fc020d3..24425bbe0239 100644 --- a/lib/tool_shed/webapp/api2/repositories.py +++ b/lib/tool_shed/webapp/api2/repositories.py @@ -497,7 +497,7 @@ async def create_changeset_revision( dir=trans.app.config.new_file_path, prefix="upload_file_data_", delete=False ) as dest: upload_file_like: IO[bytes] = the_file.file - shutil.copyfileobj(upload_file_like, dest) # type: ignore[misc] # https://github.com/python/mypy/issues/15031 + shutil.copyfileobj(upload_file_like, dest) the_file.file.close() filename = dest.name try: