Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: resolve timezone-related python 3.12 deprecations #161

Merged
merged 4 commits into from
Aug 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/biocommons/seqrepo/fastadir/fastadir.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def store(self, seq_id: str, seq: str) -> str:
# <------ dir_ ----->
# <----------- path ----------->
if self._writing is None:
reldir = datetime.datetime.utcnow().strftime("%Y/%m%d/%H%M")
reldir = datetime.datetime.now(datetime.timezone.utc).strftime("%Y/%m%d/%H%M")
basename = str(time.time()) + ".fa.bgz"
relpath = os.path.join(reldir, basename)

Expand Down
4 changes: 4 additions & 0 deletions src/biocommons/seqrepo/seqaliasdb/seqaliasdb.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import logging
import sqlite3
from importlib import resources
Expand All @@ -22,6 +23,9 @@
raise ImportError(msg)


sqlite3.register_converter("timestamp", lambda val: datetime.datetime.fromisoformat(val.decode()))


class SeqAliasDB(object):
"""Implements a sqlite database of sequence aliases"""

Expand Down
Loading