Skip to content

Commit

Permalink
Merge pull request #18449 from nsoranzo/python3.13
Browse files Browse the repository at this point in the history
Add Python 3.13 support
  • Loading branch information
nsoranzo authored Oct 31, 2024
2 parents 0f06c9b + febd6f9 commit 80ce8ad
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/first_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
env:
LINT_PATH: 'lib/galaxy/dependencies/pinned-lint-requirements.txt'
TYPE_PATH: 'lib/galaxy/dependencies/pinned-typecheck-requirements.txt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint_openapi_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/osx_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reports_startup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_galaxy_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toolshed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
shed-api: ['v1', 'v2']
test-install-client: ['galaxy_api', 'standalone']
services:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.12']
python-version: ['3.8', '3.13']
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/dependencies/conditional-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These dependencies are only required when certain config options are set
psycopg2-binary==2.9.9
psycopg2-binary==2.9.10
mysqlclient
fluent-logger
sentry-sdk[fastapi]
Expand Down
3 changes: 2 additions & 1 deletion lib/galaxy/dependencies/pinned-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ celery==5.4.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
cheetah3==3.2.6.post1
circus==0.18.0
click==8.1.7
click-didyoumean==0.3.1
Expand All @@ -51,6 +50,7 @@ colorama==0.4.6 ; platform_system == 'Windows'
coloredlogs==15.0.1
conda-package-streaming==0.11.0
cryptography==43.0.3
ct3==3.3.3.post1
cwl-upgrader==1.2.11
cwl-utils==0.35
cwltool==3.1.20241007082533
Expand All @@ -66,6 +66,7 @@ email-validator==2.2.0
exceptiongroup==1.2.2 ; python_full_version < '3.11'
fastapi-slim==0.115.4
filelock==3.16.1
fissix==24.4.24 ; python_full_version >= '3.13'
frozenlist==1.5.0
fs==2.4.16
fsspec==2024.10.0
Expand Down
5 changes: 0 additions & 5 deletions lib/galaxy/util/image_util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Provides utilities for working with image files."""

import imghdr
import logging
from typing import (
List,
Expand All @@ -22,11 +21,7 @@ def image_type(filename: str) -> Optional[str]:
with Image.open(filename) as im:
fmt = im.format
except Exception:
# We continue to try with imghdr, so this is a rare case of an
# exception we expect to happen frequently, so we're not logging
pass
if not fmt:
fmt = imghdr.what(filename)
if fmt:
return fmt.upper()
else:
Expand Down
20 changes: 18 additions & 2 deletions lib/galaxy/util/template.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
"""Entry point for the usage of Cheetah templating within Galaxy."""

import sys
import traceback
from lib2to3.refactor import RefactoringTool

from Cheetah.Compiler import Compiler
from Cheetah.NameMapper import NotFound
from Cheetah.Parser import ParseError
from Cheetah.Template import Template
from packaging.version import Version
from past.translation import myfixes

from galaxy.util.tree_dict import TreeDict
from . import unicodify

if sys.version_info >= (3, 13):
import fissix
from fissix import (
fixes as fissix_fixes,
pgen2 as fissix_pgen2,
refactor as fissix_refactor,
)

sys.modules["lib2to3"] = fissix
sys.modules["lib2to3.fixes"] = fissix_fixes
sys.modules["lib2to3.pgen2"] = fissix_pgen2
sys.modules["lib2to3.refactor"] = fissix_refactor

from lib2to3.refactor import RefactoringTool

from past.translation import myfixes

# Skip libpasteurize fixers, which make sure code is py2 and py3 compatible.
# This is not needed, we only translate code on py3.
myfixes = [f for f in myfixes if not f.startswith("libpasteurize")]
Expand Down
6 changes: 3 additions & 3 deletions packages/app/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ install_requires =
galaxy-objectstore
galaxy-tool-util[cwl,edam]
galaxy-tours
galaxy-util
galaxy-util[image_util]
galaxy-web-framework
galaxy-web-stack
Beaker
Expand All @@ -57,7 +57,7 @@ install_requires =
Mako
Markdown
MarkupSafe
mercurial
mercurial>=6.8.2
packaging
paramiko!=2.9.0,!=2.9.1
pebble
Expand All @@ -74,7 +74,7 @@ install_requires =
starlette
svgwrite
typing-extensions
WebOb
WebOb>=1.8.9
Whoosh
packages = find:
python_requires = >=3.8
Expand Down
5 changes: 2 additions & 3 deletions packages/data/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ install_requires =
galaxy-objectstore
galaxy-schema
galaxy-tool-util
galaxy-util[template]
galaxy-util[image_util,template]
alembic
alembic-utils
bdbag>=1.6.3
Expand All @@ -46,7 +46,7 @@ install_requires =
h5grove>=1.2.1
h5py
isa-rwval @ git+https://github.com/nsoranzo/isa-rwval.git@master
isal
isal>=1.7.0
MarkupSafe
msal
mrcfile
Expand All @@ -62,7 +62,6 @@ install_requires =
SQLAlchemy>=2.0,<2.1,!=2.0.36
tifffile
typing-extensions
WebOb
packages = find:
python_requires = >=3.8

Expand Down
1 change: 0 additions & 1 deletion packages/files/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ include_package_data = True
install_requires =
galaxy-util[config_template]
fs
isal
typing-extensions
packages = find:
python_requires = >=3.8
Expand Down
2 changes: 1 addition & 1 deletion packages/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow.

# Install extras (if needed)
if [ "$package_dir" = "util" ]; then
pip install '.[template,jstree,config_template]'
pip install '.[image_util,template,jstree,config_template]'
elif [ "$package_dir" = "tool_util" ]; then
pip install '.[cwl,mulled,edam,extended-assertions]'
else
Expand Down
2 changes: 1 addition & 1 deletion packages/test_base/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ install_requires =
galaxy-tool-util
galaxy-util
bioblend
cwltest
cwltest>=2.5.20240906231108
gxformat2
pytest
PyYAML
Expand Down
4 changes: 2 additions & 2 deletions packages/tool_shed/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ install_requires =
galaxy-auth
galaxy-config
galaxy-data
galaxy-util
galaxy-util[image_util]
galaxy-web-framework
galaxy-web-stack
galaxy-web-apps
Expand All @@ -48,7 +48,7 @@ install_requires =
graphql-core
Mako
MarkupSafe
mercurial
mercurial>=6.8.2
Paste
pydantic>=2.7.4
Routes
Expand Down
2 changes: 1 addition & 1 deletion packages/tool_util/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ version = 24.2.dev0
[options]
include_package_data = True
install_requires =
galaxy-util>=22.1
galaxy-util[image_util]>=22.1
conda-package-streaming
lxml!=4.2.2
MarkupSafe
Expand Down
5 changes: 4 additions & 1 deletion packages/util/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ packages = find:
python_requires = >=3.7

[options.extras_require]
image_util =
pillow
jstree =
dictobj
template =
Cheetah3
CT3>=3.3.3
fissix;python_version>='3.13'
future>=1.0.0
config_template =
Jinja2
Expand Down
6 changes: 3 additions & 3 deletions packages/web_apps/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ install_requires =
a2wsgi
apispec
Babel
Cheetah3
CT3>=3.3.3
fastapi>=0.101.0
gunicorn
gxformat2
Expand All @@ -63,8 +63,8 @@ install_requires =
tuswsgi
typing-extensions
uvicorn
uvloop
WebOb
uvloop>=0.21.0
WebOb>=1.8.9
packages = find:
python_requires = >=3.8

Expand Down
19 changes: 10 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ dependencies = [
"boto",
"bx-python",
"celery",
"Cheetah3",
"cloudauthz==0.6.0",
"cloudbridge",
"circus",
"conda-package-streaming",
"CT3>=3.3.3", # Python 3.13 support
"cwltool>=3.1.20230624081518", # save time, minimum needed by cwl-1.0 branch
"dictobj",
"dnspython",
"docutils!=0.17,!=0.17.1",
"dparse",
"edam-ontology",
"fastapi-slim>=0.111.0",
"fissix ; python_version>='3.13'",
"fs",
"future>=1.0.0", # Python 3.12 support
"graphene",
Expand All @@ -50,14 +51,14 @@ dependencies = [
"h5py>=3.12 ; python_version>='3.9'", # Python 3.13 support
"importlib-resources ; python_version<'3.9'", # for importlib.{abc.Traversable,resources.{files, Package}}
"isa-rwval @ git+https://github.com/nsoranzo/isa-rwval.git@master", # https://github.com/ISA-tools/isa-rwval/pull/17
"isal",
"isal>=1.7.0", # Python 3.13 support
"jinja2",
"kombu>=5.3", # for importlib-metadata fix
"lagom",
"Mako",
"Markdown",
"MarkupSafe",
"mercurial",
"mercurial>=6.8.2", # Python 3.13 support
"mrcfile",
"msal",
"nodeenv",
Expand Down Expand Up @@ -89,7 +90,7 @@ dependencies = [
"rocrate",
"Routes",
"s3fs>=2023.1.0",
"schema-salad!=8.3.20220721194857", # https://github.com/common-workflow-language/schema_salad/issues/575
"schema-salad>=8.7.20240905150001", # Python 3.13 support
"social-auth-core>=4.5.0", # to drop dependency on abandoned python-jose
"sortedcontainers",
"SQLAlchemy>=2.0,<2.1,!=2.0.36", # https://github.com/sqlalchemy/sqlalchemy/issues/12019,
Expand All @@ -103,8 +104,8 @@ dependencies = [
"tuswsgi",
"typing-extensions",
"uvicorn!=0.28.0", # https://github.com/galaxyproject/galaxy/issues/17669
"uvloop",
"WebOb",
"uvloop>=0.21.0", # Python 3.13 support
"WebOb>=1.8.9", # Python 3.13 support
"Whoosh",
"zipstream-new",
]
Expand All @@ -122,7 +123,7 @@ dev = [
"black",
"boto3",
"codespell",
"cwltest",
"cwltest>=2.5.20240906231108", # Python 3.13 support
"darker",
"fluent-logger",
"galaxy-release-util",
Expand All @@ -133,7 +134,7 @@ dev = [
"myst-parser",
"onedatafilerestclient==21.2.5.2",
"pkce",
"playwright",
"playwright>=1.48.0", # Python 3.13 support
"pytest<8", # https://github.com/galaxyproject/galaxy/issues/17561
"pytest-asyncio",
"pytest-cov",
Expand All @@ -154,7 +155,7 @@ dev = [
"statsd",
"testfixtures",
"tuspy",
"twill>=3.2.1", # https://github.com/twill-tools/twill/issues/18
"twill>=3.2.5", # Python 3.13 support
"watchdog",
"Werkzeug",
]
Expand Down
Loading

0 comments on commit 80ce8ad

Please sign in to comment.