Skip to content

Commit

Permalink
build!: require python >= 3.11 (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Nov 20, 2024
1 parent a788ffe commit 4ebb504
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
THERAPY_TEST: true
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ classifiers = [
"Topic :: Scientific/Engineering :: Bio-Informatics",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.10"
requires-python = ">=3.11"
description = "VICC normalization routines for therapeutics"
license = {file = "LICENSE"}
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion src/therapy/database/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ def delete_source(self, src_name: SourceName) -> None:
"concept_id": record["concept_id"],
}
)
except ClientError as e: # noqa: PERF203
except ClientError as e:
raise DatabaseWriteError(e) from e

def complete_write_transaction(self) -> None:
Expand Down
4 changes: 1 addition & 3 deletions src/therapy/etl/wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ def _get_latest_version() -> str:
:return: formatted string for the current date
"""
return datetime.datetime.now(tz=datetime.timezone.utc).strftime(
DATE_VERSION_PATTERN
)
return datetime.datetime.now(tz=datetime.UTC).strftime(DATE_VERSION_PATTERN)

def _get_data_handler(self, data_path: Path | None = None) -> DataSource:
"""Construct data handler instance for source. Overwrites base class method
Expand Down
8 changes: 4 additions & 4 deletions src/therapy/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _fetch_records(
raise KeyError(msg)
(response, src) = self._add_record(response, match, match_type)
matched_sources.add(src)
except ClientError as e: # noqa: PERF203
except ClientError as e:
logger.error(e.response["Error"]["Message"])

return response, matched_sources
Expand Down Expand Up @@ -339,7 +339,7 @@ def search(
response = self._get_search_response(query_str, query_sources, infer)

response["service_meta_"] = ServiceMeta(
response_datetime=datetime.datetime.now(tz=datetime.timezone.utc),
response_datetime=datetime.datetime.now(tz=datetime.UTC),
).model_dump()
return SearchService(**response)

Expand All @@ -358,7 +358,7 @@ def _add_merged_meta(self, response: NormalizationService) -> NormalizationServi
for src in sources:
try:
src_name = SourceName(PREFIX_LOOKUP[src])
except KeyError: # noqa: PERF203
except KeyError:
# not an imported source
continue
else:
Expand Down Expand Up @@ -522,7 +522,7 @@ def _prepare_normalized_response(self, query: str) -> dict[str, Any]:
"match_type": MatchType.NO_MATCH,
"warnings": self._emit_char_warnings(query),
"service_meta_": ServiceMeta(
response_datetime=datetime.datetime.now(tz=datetime.timezone.utc)
response_datetime=datetime.datetime.now(tz=datetime.UTC)
),
}

Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/build_wikidata_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
test_data.append(params)

TEST_DATA_DIR = Path(__file__).resolve().parents[1] / "data" / "wikidata"
date = datetime.datetime.now(tz=datetime.timezone.utc).strftime("%Y-%m-%d")
date = datetime.datetime.now(tz=datetime.UTC).strftime("%Y-%m-%d")
outfile_path = TEST_DATA_DIR / f"wikidata_{date}.json"
with outfile_path.open("w+") as f:
json.dump(test_data, f, indent=2)

0 comments on commit 4ebb504

Please sign in to comment.