Skip to content

Commit e955c7e

Browse files
committed
filter out some unuseful warnings; prevent talismac dupes
1 parent f3d72ed commit e955c7e

File tree

5 files changed

+46
-17
lines changed

5 files changed

+46
-17
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,20 @@ repos:
2424
hooks:
2525
- id: talisman-commit
2626
entry: cmd --githook pre-commit
27+
- repo: local
28+
hooks:
29+
- id: talismanrc-no-duplicate-filenames
30+
name: Fail on duplicate filenames in .talismanrc
31+
entry: >-
32+
bash -c '
33+
dupes=$(grep -E "^[[:space:]]*- filename:" .talismanrc \
34+
| sed -E "s/^[[:space:]]*- filename:[[:space:]]*//" \
35+
| sort | uniq -d);
36+
if [ -n "$dupes" ]; then
37+
echo "Duplicate filename entries in .talismanrc:";
38+
echo "$dupes";
39+
exit 1;
40+
fi'
41+
language: system
42+
files: ^\.talismanrc$
43+
pass_filenames: false

.talismanrc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
fileignoreconfig:
2-
- filename: slurm-dev-environment/configs/jwt_hs256.key
3-
checksum: cf9887754600f97f20b4afb223bcd666c3b0aa47dab9b067669c24997f398c26
4-
52
- filename: .github/workflows/release_k8s.yml
63
checksum: 0e93196d244417801fd40ad6bfa01f53a6bf04257371378a1dc3e14cbc7a04d8
74

@@ -54,7 +51,7 @@ fileignoreconfig:
5451
checksum: 3afe465b36e4e141124bd84c8459c5aa81332eedf49b691eff22c74df63a0f18
5552

5653
- filename: emgapiv2/settings.py
57-
checksum: ab0fa7cdb6cd720aedd0a4f6bb9e2940187f9de91a39967e93ed4b91ca5050c5
54+
checksum: 4113e9045da277c139530cbf71de334dc83b49a4f93a570b559e694bdd5cb0c8
5855

5956
- filename: emgapiv2/settings_test.py
6057
checksum: ded898400b4eda7e3cf75694af1b66235975a85eb5b8f49f3a2c708163a7aad4
@@ -65,6 +62,12 @@ fileignoreconfig:
6562
- filename: emgapiv2/widgets.py
6663
allowed_patterns: [key]
6764

65+
- filename: pyproject.toml
66+
allowed_patterns: [Config key]
67+
68+
- filename: slurm-dev-environment/configs/jwt_hs256.key
69+
checksum: cf9887754600f97f20b4afb223bcd666c3b0aa47dab9b067669c24997f398c26
70+
6871
- filename: slurm-dev-environment/configs/private-data-nginx.conf
6972
checksum: e3bb31e2a0f97c62ee684dd7124e5b72db364c52088ddd98331310909c6a0493
7073

@@ -155,9 +158,6 @@ fileignoreconfig:
155158
- filename: workflows/flows/update_ena_accession_from_json_flow.py
156159
allowed_patterns: [total_missing_key_or_parse_error]
157160

158-
- filename: workflows/flows/upload_assembly.py
159-
checksum: f82f92058dabd50b9b6caf557d4eadae227ec4f6a0233135653251c20cf3c64b
160-
161161
- filename: workflows/prefect_utils/env_context.py
162162
checksum: 8f5e11c7e0038bc4a648dc61ec657a679356857f77e557f744e2dd769ad88def
163163
ignore_detectors: [filename]
@@ -186,9 +186,6 @@ fileignoreconfig:
186186
- filename: workflows/data_io_utils/schemas/base.py
187187
checksum: 27b03a470da785c58f8294d2aa0aa3ef5f4e5ec5cffd97984ab446a5b8a9f337
188188

189-
- filename: Taskfile.yaml
190-
checksum: 592e19dbbafe04c136aa73a4921ac04b2d0473e654416b08d09e81d7544b8b09
191-
192189
- filename: workflows/data_io_utils/schemas/assembly.py
193190
checksum: 12b45869a636431bb6e1bfe193f02f301a6b484a0c4503bc793f5450c36c932a
194191

emgapiv2/config.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
from pydantic import AnyHttpUrl, BaseModel, Field
66
from pydantic.networks import MongoDsn, MySQLDsn
7-
from pydantic_settings import BaseSettings
7+
from pydantic_settings import (
8+
BaseSettings,
9+
SettingsConfigDict,
10+
)
811

912
from workflows.ena_utils.abstract import ENAPortalDataPortal
1013

@@ -346,7 +349,7 @@ class EMGConfig(BaseSettings):
346349
genomes: GenomeConfig = GenomeConfig()
347350
darwin_core_archive: DarwinCoreArchiveConfig = DarwinCoreArchiveConfig()
348351

349-
model_config = {
350-
"env_prefix": "emg_",
351-
"env_nested_delimiter": "__",
352-
}
352+
model_config = SettingsConfigDict(
353+
env_prefix="emg_",
354+
env_nested_delimiter="__",
355+
)

emgapiv2/settings.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,18 @@
1212

1313
import logging
1414
import os
15+
import warnings
1516
from datetime import timedelta
1617
from pathlib import Path
1718

19+
# Suppress pydantic-settings warnings that are raised because the sources for toml and pyproject.toml
20+
# are not explicitly configured, but they are included in pydantic-settings' default model_config.
21+
warnings.filterwarnings(
22+
"ignore",
23+
message="Config key `(pyproject_toml_table_header|toml_file)` is set in model_config but will be ignored",
24+
category=UserWarning,
25+
)
26+
1827
import dj_database_url
1928
from django.templatetags.static import static
2029
from django.urls import reverse_lazy

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
version = "2025.6.13"
2+
version = "2026.3.01"
33
name = "emgapi-v2"
44
requires-python = ">= 3.11"
55

@@ -17,7 +17,10 @@ env = [
1717
"PREFECT_SQLALCHEMY_POOL_SIZE=20",
1818
"PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_SIZE=20"
1919
]
20-
filterwarnings = "ignore:.*is deprecated:DeprecationWarning"
20+
filterwarnings = [
21+
"ignore:.*is deprecated:DeprecationWarning",
22+
"ignore:Config key `(pyproject_toml_table_header|toml_file)` is set in model_config but will be ignored:UserWarning"
23+
]
2124
asyncio_mode = "auto"
2225
asyncio_default_fixture_loop_scope = "function"
2326
cache_dir = "/app/.pytest-cache"

0 commit comments

Comments
 (0)