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

Add Python 3.12 to supported versions and test against on GitHub Actions; upgrade versioneer #1330

Merged
merged 8 commits into from
Nov 24, 2023
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dandi/_version.py export-subst
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- 3.9
- '3.10' # Needs quotes so YAML doesn't think it's 3.1
- '3.11'
- '3.12'
mode:
- normal
include:
Expand Down
346 changes: 250 additions & 96 deletions dandi/_version.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dandi/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Commands definition for DANDI command line interface
"""

from datetime import datetime
from datetime import datetime, timezone
import logging
import os
import os.path
Expand Down Expand Up @@ -99,7 +99,7 @@ def main(ctx, log_level, pdb=False):

logdir = platformdirs.user_log_dir("dandi-cli", "dandi")
logfile = os.path.join(
logdir, f"{datetime.utcnow():%Y%m%d%H%M%SZ}-{os.getpid()}.log"
logdir, f"{datetime.now(timezone.utc):%Y%m%d%H%M%SZ}-{os.getpid()}.log"
)
os.makedirs(logdir, exist_ok=True)
handler = logging.FileHandler(logfile, encoding="utf-8")
Expand Down
2 changes: 1 addition & 1 deletion dandi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_utcnow_datetime(microseconds: bool = True) -> datetime.datetime:

If string representation is desired, just "apply" .isoformat()
"""
ret = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).astimezone()
ret = datetime.datetime.now(datetime.timezone.utc).astimezone()
if microseconds:
return ret
else:
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Topic :: Scientific/Engineering
license = Apache 2.0
description = Command line client for interaction with DANDI archive elements
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ filterwarnings =
ignore:the imp module is deprecated:DeprecationWarning
ignore:`Unit` has been deprecated:DeprecationWarning:humanize
ignore:The distutils package is deprecated:DeprecationWarning:joblib
ignore:datetime.datetime.utcfromtimestamp\(\) is deprecated.*:DeprecationWarning:dateutil
ignore:.*Value with data type .* is being converted:hdmf.build.warnings.DtypeConversionWarning
ignore:.*find_spec\(\) not found:ImportWarning
ignore:'cgi' is deprecated:DeprecationWarning:botocore
ignore:.*unclosed.*:ResourceWarning:vcr
# addressed in joblib 0.8.2-826-g05caf07
ignore:(ast.Num|Attribute n) is deprecated.*:DeprecationWarning:joblib

[coverage:run]
parallel = True
Expand Down
Loading
Loading