Skip to content

Commit 7563e0b

Browse files
authored
Merge pull request #167 from ecmwf-projects/template-update
Template update
2 parents 0d24d6e + 0d283ab commit 7563e0b

File tree

6 files changed

+17
-12
lines changed

6 files changed

+17
-12
lines changed

.cruft.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/ecmwf-projects/cookiecutter-conda-package",
3-
"commit": "af202c60305a4e3fa11507357dc908cc49379a3d",
3+
"commit": "ce9afbb8510935c0206746d26f05f6b80e9d0087",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {

.github/workflows/on-push.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333

3434
steps:
3535
- uses: actions/checkout@v4
36+
- uses: actions/setup-python@v4
37+
with:
38+
python-version: 3.x
3639
- name: Install conda-merge
3740
run: |
3841
python -m pip install conda-merge
@@ -186,6 +189,9 @@ jobs:
186189
187190
steps:
188191
- uses: actions/checkout@v4
192+
- uses: actions/setup-python@v4
193+
with:
194+
python-version: '3.10'
189195
- name: Install package
190196
run: |
191197
python -m pip install --upgrade pip

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ repos:
88
- id: check-yaml
99
- id: check-toml
1010
- id: check-added-large-files
11+
- id: check-merge-conflict
1112
- id: debug-statements
1213
- id: mixed-line-ending
1314
- repo: https://github.com/keewis/blackdoc
1415
rev: v0.3.9
1516
hooks:
1617
- id: blackdoc
17-
additional_dependencies: [black==22.3.0]
18+
additional_dependencies: [black==23.11.0]
1819
- repo: https://github.com/astral-sh/ruff-pre-commit
1920
rev: v0.1.5
2021
hooks:

cads_processing_api_service/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333

3434

3535
def get_auth_header(
36-
pat: str
37-
| None = fastapi.Header(
36+
pat: str | None = fastapi.Header(
3837
None, description="Personal Access Token", alias="PRIVATE-TOKEN"
3938
),
40-
jwt: str
41-
| None = fastapi.Header(None, description="JSON Web Token", alias="Authorization"),
39+
jwt: str | None = fastapi.Header(
40+
None, description="JSON Web Token", alias="Authorization"
41+
),
4242
) -> tuple[str, str]:
4343
"""Get authentication header from the incoming HTTP request.
4444

cads_processing_api_service/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class JobSortCriterion(str, enum.Enum):
4949
created_at_desc: str = "-created"
5050

5151

52-
@cachetools.cached( # type: ignore
52+
@cachetools.cached(
5353
cache=cachetools.TTLCache(
5454
maxsize=config.ensure_settings().cache_resources_maxsize,
5555
ttl=config.ensure_settings().cache_resources_ttl,
@@ -98,7 +98,7 @@ def lookup_resource_by_id(
9898
return row
9999

100100

101-
@cachetools.cached( # type: ignore
101+
@cachetools.cached(
102102
cache=cachetools.TTLCache(
103103
maxsize=config.ensure_settings().cache_resources_maxsize,
104104
ttl=config.ensure_settings().cache_resources_ttl,

tests/test_30_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,8 @@ def test_get_job_from_broker_db() -> None:
220220
test_job_id = "1234"
221221
mock_session = unittest.mock.Mock(spec=sqlalchemy.orm.Session)
222222
with unittest.mock.patch("cads_broker.database.get_request") as mock_get_request:
223-
mock_get_request.return_value = (
224-
cads_broker.database.SystemRequest( # type:ignore
225-
request_uid=test_job_id
226-
)
223+
mock_get_request.return_value = cads_broker.database.SystemRequest( # type:ignore
224+
request_uid=test_job_id
227225
)
228226
job = utils.get_job_from_broker_db(test_job_id, session=mock_session)
229227
assert isinstance(job, cads_broker.SystemRequest)

0 commit comments

Comments
 (0)