File tree Expand file tree Collapse file tree 5 files changed +55
-69
lines changed
Expand file tree Collapse file tree 5 files changed +55
-69
lines changed Original file line number Diff line number Diff line change 1616
1717 - uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
1818 with :
19- path : ~/.cache/pre-commit
20- key : pre-commit -${{ hashFiles('.pre-commit-config.yaml') }}
19+ path : ~/.cache/prek
20+ key : prek -${{ hashFiles('.pre-commit-config.yaml') }}
2121
2222 - name : Set up the environment
2323 uses : ./.github/actions/setup-python-env
Original file line number Diff line number Diff line change 22install : # # Install the virtual environment and install the pre-commit hooks
33 @echo " 🚀 Creating virtual environment using uv"
44 @uv sync
5- @uv run pre-commit install
5+ @uv run prek install
66
77.PHONY : gen-all
88gen-all : # # Generate all code from schema
@@ -13,8 +13,8 @@ gen-all: ## Generate all code from schema
1313check : # # Run code quality tools.
1414 @echo " 🚀 Checking lock file consistency with 'pyproject.toml'"
1515 @uv lock --locked
16- @echo " 🚀 Linting code: Running pre-commit"
17- @uv run pre-commit run -a
16+ @echo " 🚀 Linting code: Running pre-commit via prek "
17+ @uv run prek run -a
1818 @echo " 🚀 Static type checking: Running ty"
1919 @uv run ty check --exclude " src/acp/meta.py" --exclude " src/acp/schema.py" --exclude " examples/*.py"
2020 @echo " 🚀 Checking for obsolete dependencies: Running deptry"
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ dev = [
3232 " datamodel-code-generator>=0.25" ,
3333 " pytest>=7.2.0" ,
3434 " pytest-asyncio>=0.21.0" ,
35- " pre-commit>=2.20.0" ,
3635 " tox-uv>=1.11.3" ,
3736 " deptry>=0.23.0" ,
3837 " ty>=0.0.1a16" ,
@@ -41,6 +40,7 @@ dev = [
4140 " mkdocs-material>=8.5.10" ,
4241 " mkdocstrings[python]>=0.26.1" ,
4342 " python-dotenv>=1.1.1" ,
43+ " prek>=0.2.17" ,
4444]
4545
4646[project .optional-dependencies ]
@@ -117,3 +117,6 @@ exclude = [
117117 " src/acp/meta.py" ,
118118 " src/acp/schema.py" ,
119119]
120+
121+ [tool .deptry .package_module_name_map ]
122+ opentelemetry-sdk = " opentelemetry"
Original file line number Diff line number Diff line change 66from typing import Any , cast
77
88try :
9- from logfire import span as logfire_span
10- except Exception : # pragma: no cover - logfire is optional
9+ from logfire import span as logfire_span # type: ignore[unresolved-import]
10+ except ModuleNotFoundError : # pragma: no cover - logfire is optional
1111 logfire_span = None # type: ignore[assignment]
1212else : # pragma: no cover - optional
1313 os .environ .setdefault ("LOGFIRE_IGNORE_NO_CONFIG" , "1" )
1414
1515try : # pragma: no cover - opentelemetry is optional
16- from opentelemetry .trace import get_tracer as otel_get_tracer
17- except Exception : # pragma: no cover - opentelemetry is optional
16+ from opentelemetry .trace import get_tracer as otel_get_tracer # type: ignore[unresolved-import]
17+ except ModuleNotFoundError : # pragma: no cover - opentelemetry is optional
1818 otel_get_tracer = None # type: ignore[assignment]
1919
2020DEFAULT_TAGS = ["acp" ]
You can’t perform that action at this time.
0 commit comments