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

Use regular ".now" instead of ".utcnow" with UTC zone #3670

Merged
merged 2 commits into from
Oct 6, 2024

Conversation

yarikoptic
Copy link
Member

It is mandated by starting to receive a DeprecationWarning in python 3.12

DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC)

discovered while addressing some other rot in heudiconv.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.87%. Comparing base (c5fa777) to head (cd4bd5b).
Report is 24 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3670   +/-   ##
=======================================
  Coverage   70.86%   70.87%           
=======================================
  Files        1276     1277    +1     
  Lines       59229    59237    +8     
  Branches     9812     9813    +1     
=======================================
+ Hits        41975    41983    +8     
  Misses      16079    16079           
  Partials     1175     1175           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yarikoptic
Copy link
Member Author

eh, it isn't in 3.8 yet, so we have to craft python version specific adapter ...

now fails some other unrelated tests so must be something else (should be string instead of bytes?)

=========================== short test summary info ============================
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_compcor - ValueError: invalid fmt: b'%.10f'
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_compcor_variance_threshold_and_metadata - ValueError: invalid fmt: b'%.10f'
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_tcompcor - ValueError: invalid fmt: b'%.10f'
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_tcompcor_no_percentile - ValueError: invalid fmt: b'%.10f'
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_compcor_no_regress_poly - ValueError: invalid fmt: b'%.10f'
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_tcompcor_asymmetric_dim - ValueError: invalid fmt: b'%.10f'
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_tcompcor_merge_intersect_masks - ValueError: invalid fmt: b'%.10f'
FAILED algorithms/tests/test_CompCor.py::TestCompCor::test_tcompcor_index_mask - ValueError: invalid fmt: b'%.10f'
FAILED interfaces/cmtk/cmtk.py::nipype.interfaces.cmtk.cmtk.length
FAILED interfaces/mixins/fixheader.py::nipype.interfaces.mixins.fixheader.CopyHeaderInterface
= 10 failed, 2724 passed, 243 skipped, 5 xfailed, 48 warnings in 142.18s (0:02:22) =

@effigies
Copy link
Member

effigies commented Oct 4, 2024

We should drop Python 3.8 in any case. It's EOL next week and we won't be releasing before that.

It is mandated by starting to receive a DeprecationWarning in python 3.12

    DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC)

discovered while addressing some other rot in heudiconv.
@effigies effigies merged commit 0375126 into nipy:master Oct 6, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants