Skip to content

Conversation

@benmezger
Copy link
Contributor

@benmezger benmezger commented Aug 29, 2025

PR fixes Django deprecation warnings.

This PR does not fix all deprecation warnings, as the rest of the deprecation warnings are coming out from external libraries we use, i.e:

devel/tests/test_reports.py: 10 warnings
  /Users/ben/workspace/archweb/.venv/lib/python3.13/site-packages/pgpdump/packet.py:272: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    self.creation_time = datetime.utcfromtimestamp(

Ideally, once we bump Django, we would want to upgrade these modules as well.

One that made my head spin a little was the following:

packages/tests/test_views.py::test_sitemap
  /Users/ben/workspace/archweb/.venv/lib/python3.13/site-packages/django/contrib/sitemaps/__init__.py:73: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'main.models.Package'> QuerySet.
    return paginator.Paginator(self._items(), self.limit)

Though I tried ordering the Queryset, I am not fully sure where this is coming from.

@benmezger benmezger force-pushed the feat/fix-deprecation-warnings branch from a651b89 to 2e4e3d4 Compare August 29, 2025 21:36
@benmezger benmezger force-pushed the feat/fix-deprecation-warnings branch 2 times, most recently from 75f82a3 to 443a778 Compare August 30, 2025 10:52
@benmezger benmezger force-pushed the feat/fix-deprecation-warnings branch 3 times, most recently from 2e560e1 to ea7eb7a Compare August 30, 2025 15:19
@benmezger benmezger force-pushed the feat/fix-deprecation-warnings branch from ea7eb7a to 4385817 Compare September 3, 2025 08:32
@benmezger benmezger marked this pull request as ready for review September 3, 2025 08:34
@jelly
Copy link
Member

jelly commented Sep 3, 2025

Thanks!

@jelly jelly merged commit 6bc1b49 into archlinux:master Sep 3, 2025
1 check passed
@benmezger benmezger deleted the feat/fix-deprecation-warnings branch September 3, 2025 08:55
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