Skip to content

Commit

Permalink
Pin pydantic to >=2.7.4
Browse files Browse the repository at this point in the history
Pydantic <2.7.4 is broken on Python>=3.12.4 , see
pydantic/pydantic#9609 .
Fixed upstream in pydantic/pydantic#9639 .

Fix the following traceback in startup test on Python 3.12:

```
Traceback (most recent call last):
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/bin/galaxyctl", line 10, in <module>
    sys.exit(galaxyctl())
             ^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/click/core.py", line 1682, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/click/core.py", line 1729, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/gravity/cli.py", line 59, in get_command
    return name_to_command(name)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/gravity/cli.py", line 45, in name_to_command
    mod = __import__(mod_name, None, None, ["cli"])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/gravity/commands/cmd_stop.py", line 4, in <module>
    from gravity import process_manager
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/gravity/process_manager/__init__.py", line 14, in <module>
    from gravity.config_manager import ConfigManager
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/gravity/config_manager.py", line 18, in <module>
    from gravity.state import ConfigFile, service_for_service_type
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/gravity/state.py", line 42, in <module>
    class ConfigFile(BaseModel):
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/pydantic/v1/main.py", line 286, in __new__
    cls.__try_update_forward_refs__()
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/pydantic/v1/main.py", line 807, in __try_update_forward_refs__
    update_model_forward_refs(cls, cls.__fields__.values(), cls.__config__.json_encoders, localns, (NameError,))
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py", line 554, in update_model_forward_refs
    update_field_forward_refs(f, globalns=globalns, localns=localns)
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py", line 520, in update_field_forward_refs
    field.type_ = evaluate_forwardref(field.type_, globalns, localns or None)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.12/site-packages/pydantic/v1/typing.py", line 66, in evaluate_forwardref
    return cast(Any, type_)._evaluate(globalns, localns, set())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'
```

Example: https://github.com/galaxyproject/galaxy/actions/runs/9581802216/job/26419972297
  • Loading branch information
nsoranzo committed Jun 19, 2024
1 parent 08d42ea commit c3ef080
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions lib/galaxy/dependencies/pinned-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ psutil==5.9.8 ; 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.20.0 ; python_version >= "3.8" and python_version < "3.13"
pydantic-core==2.18.2 ; python_version >= "3.8" and python_version < "3.13"
pydantic-core==2.18.4 ; python_version >= "3.8" and python_version < "3.13"
pydantic-tes==0.1.5 ; python_version >= "3.8" and python_version < "3.13"
pydantic==2.7.1 ; python_version >= "3.8" and python_version < "3.13"
pydantic[email]==2.7.1 ; python_version >= "3.8" and python_version < "3.13"
pydantic==2.7.4 ; python_version >= "3.8" and python_version < "3.13"
pydantic[email]==2.7.4 ; python_version >= "3.8" and python_version < "3.13"
pydot==2.0.0 ; python_version >= "3.8" and python_version < "3.13"
pyeventsystem==0.1.0 ; python_version >= "3.8" and python_version < "3.13"
pyfaidx==0.8.1.1 ; python_version >= "3.8" and python_version < "3.13"
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/dependencies/pinned-typecheck-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ mypy-boto3-s3==1.34.105 ; 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.10.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.18.2 ; python_version >= "3.8" and python_version < "3.13"
pydantic==2.7.1 ; python_version >= "3.8" and python_version < "3.13"
pydantic-core==2.18.4 ; python_version >= "3.8" and python_version < "3.13"
pydantic==2.7.4 ; python_version >= "3.8" and python_version < "3.13"
tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.11"
types-awscrt==0.20.9 ; python_version >= "3.8" and python_version < "3.13"
types-bleach==6.1.0.20240331 ; python_version >= "3.8" and python_version < "3.13"
Expand Down
2 changes: 1 addition & 1 deletion packages/app/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ install_requires =
paramiko!=2.9.0,!=2.9.1
pebble
pulsar-galaxy-lib>=0.15.0.dev0
pydantic>=2,!=2.6.0,!=2.6.1
pydantic>=2.7.4
pysam>=0.21
PyJWT
PyYAML
Expand Down
2 changes: 1 addition & 1 deletion packages/data/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ install_requires =
numpy
parsley
pycryptodome
pydantic[email]>=2,!=2.6.0,!=2.6.1
pydantic[email]>=2.7.4
pylibmagic
python-magic
pysam>=0.21
Expand Down
2 changes: 1 addition & 1 deletion packages/objectstore/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ version = 23.2.dev0
include_package_data = True
install_requires =
galaxy-util[config_template]
pydantic>=2,!=2.6.0,!=2.6.1
pydantic>=2.7.4
PyYAML
packages = find:
python_requires = >=3.7
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ version = 23.2.dev0
include_package_data = True
install_requires =
galaxy-util
pydantic[email]>=2,!=2.6.0,!=2.6.1
pydantic[email]>=2.7.4
packages = find:
python_requires = >=3.8

Expand Down
2 changes: 1 addition & 1 deletion packages/tool_shed/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ install_requires =
MarkupSafe
mercurial
Paste
pydantic>=2,!=2.6.0,!=2.6.1
pydantic>=2.7.4
Routes
SQLAlchemy>=2.0,<2.1
starlette
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 @@ -38,7 +38,7 @@ install_requires =
lxml!=4.2.2
MarkupSafe
packaging
pydantic>=2,!=2.6.0,!=2.6.1
pydantic>=2.7.4
PyYAML
requests
sortedcontainers
Expand Down
2 changes: 1 addition & 1 deletion packages/tours/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ version = 23.2.dev0
include_package_data = True
install_requires =
galaxy-navigation
pydantic>=2,!=2.6.0,!=2.6.1
pydantic>=2.7.4
PyYAML
packages = find:
python_requires = >=3.8
Expand Down
2 changes: 1 addition & 1 deletion packages/web_apps/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ install_requires =
Mako
MarkupSafe
Paste
pydantic>=2,!=2.6.0,!=2.6.1
pydantic>=2.7.4
PyJWT
python-dateutil
python-multipart # required to support form parsing in FastAPI/Starlette
Expand Down
2 changes: 1 addition & 1 deletion packages/web_framework/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ install_requires =
babel
MarkupSafe
paste
pydantic>=2,!=2.6.0,!=2.6.1
pydantic>=2.7.4
requests
Routes
SQLAlchemy>=2.0,<2.1
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pillow = "*"
psutil = "*"
pulsar-galaxy-lib = ">=0.15.0.dev0"
pycryptodome = "*"
pydantic = {version = ">=2.7.0", extras = ["email"]} # https://github.com/pydantic/pydantic/issues/8760
pydantic = {version = ">=2.7.4", extras = ["email"]} # https://github.com/pydantic/pydantic/pull/9639
PyJWT = "*"
pykwalify = "*"
pylibmagic = "*"
Expand Down Expand Up @@ -175,7 +175,7 @@ Werkzeug = "*"
mypy = "*"
boto3-stubs = {version = "*", extras = ["s3"]}
lxml-stubs = "*"
pydantic = ">=2, !=2.6.0, !=2.6.1" # for pydantic.mypy plugin
pydantic = ">=2.7.4" # for pydantic.mypy plugin
types-bleach = "*"
types-boto = "*"
types-contextvars = "*"
Expand Down

0 comments on commit c3ef080

Please sign in to comment.