Skip to content

Commit 6924be0

Browse files
PasteurBotdionhaefnerjpbrodrick89
authored
chore: 📦 Update dependencies (#613)
This PR updates the lockfile to the latest versions of the dependencies. Please review the changes and merge when ready. --------- Co-authored-by: Dion Häfner <dion.haefner@simulation.science> Co-authored-by: Jonathan Brodrick <jonathanbrodrick@gmail.com>
1 parent 685de1b commit 6924be0

9 files changed

Lines changed: 326 additions & 196 deletions

File tree

.github/workflows/build_docs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ jobs:
3434
run: |
3535
uv sync --extra docs --frozen
3636
37+
# TEMPORARY: sphinx-click cannot introspect typer's vendored click (typer
38+
# >= 0.26), which breaks the CLI reference pages. Pin to the last real-click
39+
# typer for the docs build only (does not affect the shipped package) until
40+
# we settle on a long-term docs fix. See the docs CLI reference pages.
41+
- name: Pin typer < 0.26 for docs build (sphinx-click compatibility)
42+
run: uv pip install 'typer<0.26'
43+
3744
- name: Build docs
3845
working-directory: docs
3946
run: |

demo/_showcase/ansys-shapeopt/jax_fem/tesseract_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: |
1010
build_config:
1111
target_platform: "native"
1212
# conda-forge has binaries for gmsh and friends, even on ARM64
13-
base_image: "condaforge/miniforge3:latest"
13+
base_image: "condaforge/miniforge3:26.1.1-3"
1414
requirements:
1515
provider: conda
1616
extra_packages:

demo/fem-shape-optimization/fem_tess/tesseract_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: |
1010
build_config:
1111
target_platform: "native"
1212
# conda-forge has binaries for gmsh and friends, even on ARM64
13-
base_image: "condaforge/miniforge3:latest"
13+
base_image: "condaforge/miniforge3:26.1.1-3"
1414
requirements:
1515
provider: conda
1616
extra_packages:

examples/conda/tesseract_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ version: "1.0.0"
33
description: "Custom venv creation."
44

55
build_config:
6-
base_image: "condaforge/miniforge3:latest"
6+
base_image: "condaforge/miniforge3:26.1.1-3"
77
requirements:
88
provider: conda

production.uv.lock

Lines changed: 280 additions & 171 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ authors = [
88
license = { text = "Apache-2.0" }
99
requires-python = ">=3.10,<3.15"
1010
dependencies = [
11-
"click",
1211
"jinja2",
1312
"rich",
14-
"typer",
13+
"typer>=0.16",
1514
"pyyaml",
1615
"pydantic",
1716
"numpy",
@@ -44,8 +43,10 @@ runtime = [
4443
"fastapi<=0.136.3,>=0.115",
4544
"requests<=2.34.2,>=2.32.4",
4645
"uvicorn<=0.48.0,>=0.34",
47-
"click<=8.4.1,>=8.1",
48-
"typer<=0.25.1,>=0.15",
46+
# NOTE: typer 0.15.0 ships a TyperArgument.make_metavar() without the ``ctx``
47+
# arg that click >= 8.2 passes, and declares no click upper bound, so it is
48+
# broken with modern click. 0.16.0 is the first version that supports it.
49+
"typer<=0.26.4,>=0.16",
4950
"fsspec[http,s3]<=2026.4.0,>=2024.12",
5051
"pybase64<=1.4.3,>=1.4",
5152
"orjson<=3.11.9,>=3.10",

requirements.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@ certifi==2026.5.20
88
# via requests
99
charset-normalizer==3.4.7
1010
# via requests
11-
click==8.4.1
12-
# via
13-
# tesseract-core
14-
# typer
1511
colorama==0.4.6 ; sys_platform == 'win32'
16-
# via click
17-
idna==3.16
12+
# via typer
13+
idna==3.17
1814
# via requests
1915
jinja2==3.1.6
2016
# via tesseract-core
@@ -34,7 +30,7 @@ orjson==3.11.9
3430
# via tesseract-core
3531
packaging==26.2
3632
# via tesseract-core
37-
pip==26.1.1
33+
pip==26.1.2
3834
# via tesseract-core
3935
pybase64==1.4.3
4036
# via tesseract-core
@@ -54,7 +50,7 @@ rich==15.0.0
5450
# typer
5551
shellingham==1.5.4
5652
# via typer
57-
typer==0.25.1
53+
typer==0.26.4
5854
# via tesseract-core
5955
typing-extensions==4.15.0
6056
# via

tesseract_core/runtime/cli.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
get_origin,
2020
)
2121

22-
import click
2322
import typer
2423
from pydantic import ValidationError
2524
from pydantic_core import from_json
@@ -45,6 +44,15 @@
4544
check_gradients as check_gradients_,
4645
)
4746

47+
# typer >= 0.26 vendors its own click (and drops the click dependency), so the
48+
# Context type and exceptions must come from the click typer actually runs;
49+
# fall back to real click on older typer (which still ships it).
50+
try:
51+
from typer._click.core import Context
52+
from typer._click.exceptions import BadParameter, UsageError
53+
except ImportError: # typer < 0.26
54+
from click import BadParameter, Context, UsageError
55+
4856
CONFIG_FIELDS = {
4957
str(field_name): field.annotation
5058
for field_name, field in RuntimeConfig.model_fields.items()
@@ -66,7 +74,7 @@ def _enum_to_val(val: Any) -> Any:
6674
class SpellcheckedTyperGroup(typer.core.TyperGroup):
6775
"""A Typer group that suggests similar commands if a command is not found."""
6876

69-
def get_command(self, ctx: click.Context, invoked_command: str) -> Any:
77+
def get_command(self, ctx: Context, invoked_command: str) -> Any:
7078
"""Get a command from the Typer group, suggesting similar commands if the command is not found."""
7179
import difflib
7280

@@ -76,7 +84,7 @@ def get_command(self, ctx: click.Context, invoked_command: str) -> Any:
7684
invoked_command, possible_commands, n=1, cutoff=0.6
7785
)
7886
if close_match:
79-
raise click.UsageError(
87+
raise UsageError(
8088
f"No such command '{invoked_command}'. Did you mean '{close_match[0]}'?",
8189
ctx,
8290
)
@@ -111,7 +119,7 @@ def _parse_payload(value: Any) -> dict[str, Any]:
111119
try:
112120
value = read_from_path(value[1:]).decode("utf-8")
113121
except Exception as e:
114-
raise click.BadParameter(f"Could not read data from path {value}.") from e
122+
raise BadParameter(f"Could not read data from path {value}.") from e
115123

116124
# Use pydantic from_json here because it is much faster, and the payload may be large.
117125
return from_json(value)
@@ -407,7 +415,7 @@ def _callback_wrapper(**kwargs: Any):
407415
context={"base_dir": input_path},
408416
)
409417
except ValidationError as e:
410-
raise click.BadParameter(
418+
raise BadParameter(
411419
str(e),
412420
param_hint="payload",
413421
) from e

tesseract_core/sdk/cli.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from types import SimpleNamespace
1919
from typing import Annotated, Any, NoReturn
2020

21-
import click
2221
import typer
2322
import yaml
2423
from jinja2 import Environment, PackageLoader, StrictUndefined
@@ -48,6 +47,16 @@
4847
from .exceptions import UserError
4948
from .logs import DEFAULT_CONSOLE, set_logger
5049

50+
# typer >= 0.26 vendors its own click (and drops the click dependency), so the
51+
# Context type, exceptions, and context lookups must come from the click typer
52+
# actually runs; fall back to real click on older typer (which still ships it).
53+
try:
54+
from typer._click.core import Context
55+
from typer._click.exceptions import UsageError
56+
from typer._click.globals import get_current_context
57+
except ImportError: # typer < 0.26
58+
from click import Context, UsageError, get_current_context
59+
5160
logger = getLogger("tesseract")
5261

5362
# Jinja2 Template Environment
@@ -62,7 +71,7 @@
6271
class SpellcheckedTyperGroup(typer.core.TyperGroup):
6372
"""A Typer group that suggests similar commands if a command is not found."""
6473

65-
def get_command(self, ctx: click.Context, invoked_command: str) -> Any:
74+
def get_command(self, ctx: Context, invoked_command: str) -> Any:
6675
"""Get a command from the Typer group, suggesting similar commands if the command is not found."""
6776
import difflib
6877

@@ -72,7 +81,7 @@ def get_command(self, ctx: click.Context, invoked_command: str) -> Any:
7281
invoked_command, possible_commands, n=1, cutoff=0.6
7382
)
7483
if close_match:
75-
raise click.UsageError(
84+
raise UsageError(
7685
f"No such command '{invoked_command}'. Did you mean '{close_match[0]}'?",
7786
ctx,
7887
)
@@ -1124,7 +1133,7 @@ def run_container(
11241133

11251134
if not tesseract_image:
11261135
if invoke_help:
1127-
click.get_current_context().get_help()
1136+
get_current_context().get_help()
11281137
return
11291138
raise typer.BadParameter(
11301139
"Tesseract image name is required.",
@@ -1133,7 +1142,7 @@ def run_container(
11331142

11341143
if not cmd:
11351144
if invoke_help:
1136-
click.get_current_context().get_help()
1145+
get_current_context().get_help()
11371146
return
11381147
else:
11391148
error_string = f"Command is required. Are you sure your Tesseract image name is `{tesseract_image}`?"

0 commit comments

Comments
 (0)