Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
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.11", "3.12"]
python-version: ["3.13", "3.14", "3.15"]
runs-on: ["ubuntu-latest", "macos-latest", "windows-latest"]

steps:
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:

- uses: "actions/setup-python@v7"
with:
python-version: "3.12"
python-version: "3.13"
allow-prereleases: true

- name: "Install docs packages"
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.13"
nodejs: "16"
jobs:
post_install:
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
# There is no other context except that warning
("py:class", "list[dict[str"),
("py:class", "botocore.client.S3"),
("py:class", "botocore.client.BaseClient"),
("py:class", "fastapi.responses.StreamingResponse"),
]

Expand Down
23 changes: 13 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = "0.4.2"
description = "Defines OGDC recipe API(s) and submits recipes to OGDC for execution"
readme = "README.md"
license.file = "LICENSE"
requires-python = ">=3.11"
requires-python = ">=3.13"
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
Expand All @@ -21,8 +21,8 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
Expand Down Expand Up @@ -52,7 +52,7 @@ dependencies = [

# NOTE: "test" and "dev" are duplicated; why do we need both?
test = [
"mypy ~=1.10.0",
"mypy ~=1.15",
"pytest >=6",
"pytest-cov >=3",
"pytest-order",
Expand Down Expand Up @@ -130,6 +130,11 @@ filterwarnings = [
"ignore:Using `httpx` with `starlette.testclient` is deprecated:DeprecationWarning",
# AnyIO deprecation alias
"ignore:The anyio\\.abc\\.BlockingPortal alias is deprecated:DeprecationWarning",
# d1_common (dataone.libclient) uses a non-raw regex string (`b"^\s*$\n"`).
# Harmless SyntaxWarning, but "error" above escalates it to a SyntaxError at
# import time on Python >=3.14. Leading ".*" because 3.14 reworded the message.
# Remove once fixed upstream in d1_python.
"ignore:.*invalid escape sequence:SyntaxWarning",
]
log_cli_level = "INFO"
testpaths = [
Expand All @@ -149,7 +154,7 @@ report.exclude_also = [

[tool.mypy]
files = ["src", "tests"]
python_version = "3.11"
python_version = "3.13"
warn_unused_configs = true
strict = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
Expand All @@ -174,16 +179,14 @@ module = [
"boto3",
"botocore.exceptions",
"botocore",
"botocore.config",
"botocore.response",
"botocore.stub",
"botocore.*",
]
ignore_missing_imports = true


[tool.ruff]
src = ["src"]
target-version = "py311"
target-version = "py313"

[tool.ruff.lint]
extend-select = [
Expand Down Expand Up @@ -226,7 +229,7 @@ isort.required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]
"noxfile.py" = ["T20"]
"**/recipe_config.py" = ["UP007"]
"**/recipe_config.py" = ["UP007", "UP040"]

[tool.hatch.metadata]
allow-direct-references = true
Expand Down
1 change: 0 additions & 1 deletion src/ogdc_runner/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ def validate_all_recipes(recipes_location: str, ref: str) -> None:
def _download_output_for_workflow(
config: Config, workflow_name: str, output_dir: Path
) -> None:

headers = {}
if config.access_mode != ACCESS_MODE_OPEN:
headers["Authorization"] = f"Bearer {_get_api_token(config)}"
Expand Down
2 changes: 1 addition & 1 deletion src/ogdc_runner/argo.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def OgdcWorkflow(
name: str,
archive_workflow: bool,
**kwargs: Any,
) -> Generator[Workflow, None, None]:
) -> Generator[Workflow]:
"""Contexts manager that yields an argo workflow with configuration driven by `recipe_config`.

kwargs:
Expand Down
2 changes: 1 addition & 1 deletion src/ogdc_runner/models/recipe_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class RecipeConfig(RecipeMeta):
# This is where the rest of the config was set from.
recipe_directory: Path

@computed_field # type: ignore[misc]
@computed_field # type: ignore[prop-decorator]
@cached_property
def id(self) -> str:
k8s_name = self.name.lower().replace(" ", "-")
Expand Down
4 changes: 2 additions & 2 deletions src/ogdc_runner/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from functools import cache

import boto3
import botocore
from botocore.client import BaseClient
from botocore.config import Config
from botocore.exceptions import ClientError
from hera.workflows import (
Expand Down Expand Up @@ -288,7 +288,7 @@ def get_s3_bucket() -> str:


@cache
def get_s3_client() -> botocore.client.S3:
def get_s3_client() -> BaseClient:
"""Return an S3 client configured from the `S3_*` environment variables."""
s3_secret_access_key_id = os.environ.get("S3_SECRET_KEY_ID")
s3_secret_access_key = os.environ.get("S3_SECRET_KEY_KEY")
Expand Down
2 changes: 1 addition & 1 deletion src/ogdc_runner/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def stage_ogdc_recipe(recipe_location: str): # type: ignore[no-untyped-def]


@contextmanager
def clone_recipes_repo(repo_url: str, ref: str = "main") -> Generator[Path, None, None]:
def clone_recipes_repo(repo_url: str, ref: str = "main") -> Generator[Path]:
"""Clone a git repository at a specific ref.

Args:
Expand Down
2 changes: 1 addition & 1 deletion src/ogdc_runner/service/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_engine() -> sqlalchemy.engine.base.Engine:


# Create a FastAPI dependency on the database session.
def _get_session() -> Generator[Session, None, None]:
def _get_session() -> Generator[Session]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - this is much clearer to me because I always have to refresh my memory on what the other two arguments are for, and why None is given.

"""Yield a database session for FastAPI routes."""
with Session(get_engine()) as session:
yield session
Expand Down
6 changes: 3 additions & 3 deletions src/ogdc_runner/workflow/viz_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import os
from collections.abc import Callable
from typing import Any, TypeAlias, cast
from typing import Any, cast

from hera.workflows import (
DAG,
Expand Down Expand Up @@ -52,8 +52,8 @@
# ruff: noqa: PLC0415

logger = logging.getLogger(__name__)
WorkflowTask: TypeAlias = Any
WorkflowScript: TypeAlias = Callable[..., WorkflowTask]
WorkflowTask = Any
WorkflowScript = Callable[..., WorkflowTask]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you try using the type keyword here? e.g., type WorkflowScript = Callable[..., WorkflowTask]? I think using that or TypeAlias is a little more explicit, although dropping clearly works. Was this something mypy or ruff caught?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this was caught by ruff


# Viz worker container image. Override via VIZ_WORKFLOW_IMAGE env var.
VIZ_WORKFLOW_IMAGE: str = os.environ.get(
Expand Down
Loading