nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
751 stars 530 forks source link

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

Closed yarikoptic closed 1 month ago

yarikoptic commented 2 months ago

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.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

yarikoptic commented 2 months ago

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 commented 1 month ago

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