Skip to content

Conversation

yuvipanda
Copy link
Collaborator

/Users/yuvipanda/code/repo2docker/./repo2docker/buildpacks/conda/freeze.py:101: 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).

```
/Users/yuvipanda/code/repo2docker/./repo2docker/buildpacks/conda/freeze.py:101: 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).
```
@yuvipanda yuvipanda requested a review from manics February 9, 2025 21:07
@yuvipanda yuvipanda requested a review from minrk February 9, 2025 21:07
@@ -12,7 +12,7 @@
import os
import pathlib
from argparse import ArgumentParser
from datetime import datetime
from datetime import UTC, datetime
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is datetime.timezone.UTC. And timezone.UTC is a class attribute, so not directly importable which means you have to do something like

Suggested change
from datetime import UTC, datetime
from datetime import datetime, timezone
UTC = timezone.UTC

if you want UTC as a top-level variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

2 participants