Repository: django-import-export/django-import-export (language: python)

Issue:
Update dependencies for 4.2 release
- Add python 3.13 support
- [Remove older python versions](https://devguide.python.org/versions/)
- Update upstream dependencies where required
- Official django 5.1 support





Discussion / hints:

Fix patch:
diff --git a/docs/advanced_usage.rst b/docs/advanced_usage.rst
index 31f9fdfd3..5fccf7399 100644
--- a/docs/advanced_usage.rst
+++ b/docs/advanced_usage.rst
@@ -435,9 +435,11 @@ Refer to the :class:`~.ForeignKeyWidget` documentation for more detailed informa
 
 .. note::
 
-    If you are exporting a field which uses ``ForeignKeyWidget`` then the default field value will be exported.
+    If you are exporting a field which uses ``ForeignKeyWidget`` then the default formatting for the field will be
+    applied.
     If you need better control over the format of the exported value (for example, formatting a date), then use a
-    :ref:`dehydrate<advanced_data_manipulation_on_export>` method
+    :ref:`dehydrate<advanced_data_manipulation_on_export>` method or create a subclass of ``ForeignKeyWidget``.
+    Override :meth:`~import_export.widgets.Widget.render` to create custom formatting of output.
 
 Many-to-many relations
 ----------------------
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 7de2e4ee2..60e34b95e 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -27,6 +27,7 @@ This release contains breaking changes.  Please refer to :doc:`release notes<rel
 - Fix crash for Django 5.1 when rows are skipped (`1944 <https://github.com/django-import-export/django-import-export/issues/1944>`_)
 - Allow callable in dehydrate method (`1950 <https://github.com/django-import-export/django-import-export/issues/1950>`_)
 - Fix crash when Resource fields declared incorrectly (`1963 <https://github.com/django-import-export/django-import-export/issues/1963>`_)
+- Updated dependencies (`1979 <https://github.com/django-import-export/django-import-export/issues/1979>`_)
 
 4.1.1 (2024-07-08)
 ------------------
diff --git a/pyproject.toml b/pyproject.toml
index 447e14277..9ef3e48ef 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -13,7 +13,7 @@ maintainers = [
 description = "Django application and library for importing and exporting data with included admin integration."
 keywords = ["django", "import", "export"]
 license = {file = "LICENSE"}
-requires-python = ">=3.8"
+requires-python = ">=3.9"
 readme = "README.rst"
 dynamic = ["version"]
 classifiers = [
@@ -26,19 +26,19 @@ classifiers = [
     "Operating System :: OS Independent",
     "Programming Language :: Python",
     "Programming Language :: Python :: 3",
-    "Programming Language :: Python :: 3.8",
     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
+    "Programming Language :: Python :: 3.13",
     "Programming Language :: Python :: 3 :: Only",
     "Topic :: Software Development",
 ]
 
 dependencies = [
-    "diff-match-patch",
+    "diff-match-patch==20241021",
     "Django>=4.2",
-    "tablib>=3.6.1"
+    "tablib==3.7.0"
 ]
 
 [project.optional-dependencies]
diff --git a/requirements/base.txt b/requirements/base.txt
index af81dd737..45b1f17f9 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -1,3 +1,3 @@
 Django>=4.2
-tablib>=3.6.1
-diff-match-patch
+tablib==3.7.0
+diff-match-patch==20241021
diff --git a/requirements/docs.txt b/requirements/docs.txt
index a602d26f9..3e7077e54 100644
--- a/requirements/docs.txt
+++ b/requirements/docs.txt
@@ -1,4 +1,4 @@
 -r base.txt
-sphinx==7.2.6
-sphinx-rtd-theme==1.3.0
+sphinx==8.1.3
+sphinx-rtd-theme==3.0.1
 --editable .
diff --git a/tox.ini b/tox.ini
index 7c4978549..f25ef18db 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,17 +1,17 @@
 [tox]
 min_version = 4.0
 envlist =
-       {py38,py39}-{django42}
-       {py310,py311,py312}-{django42,django50,django51,djangomain}
-       py311-djangomain-tablibdev
+       {py39}-{django42}
+       {py310,py311,py312,py313}-{django42,django50,django51,djangomain}
+       py313-djangomain-tablibdev
 
 [gh-actions]
 python =
-    3.8: py38
     3.9: py39
     3.10: py310
     3.11: py311
     3.12: py312
+    3.13: py313
 
 [testenv]
 setenv = PYTHONPATH = {toxinidir}/tests


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 93bed5d00..165408446 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -21,11 +21,11 @@ jobs:
       fail-fast: true
       matrix:
         python-version:
-          - '3.8'
           - '3.9'
           - '3.10'
           - '3.11'
           - '3.12'
+          - '3.13'
     services:
       postgres:
         image: postgres
diff --git a/requirements/test.txt b/requirements/test.txt
index 2ae9fbe3c..db3be52c2 100644
--- a/requirements/test.txt
+++ b/requirements/test.txt
@@ -1,9 +1,9 @@
-psycopg2-binary==2.9.9
-mysqlclient==2.2.0
+psycopg2-binary==2.9.10
+mysqlclient==2.2.5
 chardet==5.2.0
-pytz==2023.3
+pytz==2024.2
 memory-profiler==0.61.0
 django-extensions==3.2.3
-coverage==7.3.2
-tablib[all]>=3.6.1
-setuptools-scm==8.0.4
+coverage==7.6.4
+tablib[all]>=3.7.0
+setuptools-scm==8.1.0
diff --git a/tests/core/tests/admin_integration/test_action_export.py b/tests/core/tests/admin_integration/test_action_export.py
index 6d4b39baa..d21b29b30 100644
--- a/tests/core/tests/admin_integration/test_action_export.py
+++ b/tests/core/tests/admin_integration/test_action_export.py
@@ -161,11 +161,14 @@ def test_export_admin_action_with_restricted_pks_deprecated(self):
     def _perform_export_action_calls_modeladmin_get_queryset_test(self, data):
         # Issue #1864
         # ModelAdmin's get_queryset should be used in the ModelAdmin mixins
-        with mock.patch(
-            "core.admin.CategoryAdmin.get_queryset"
-        ) as mock_modeladmin_get_queryset, mock.patch(
-            "import_export.admin.ExportMixin.get_data_for_export"
-        ) as mock_get_data_for_export:
+        with (
+            mock.patch(
+                "core.admin.CategoryAdmin.get_queryset"
+            ) as mock_modeladmin_get_queryset,
+            mock.patch(
+                "import_export.admin.ExportMixin.get_data_for_export"
+            ) as mock_get_data_for_export,
+        ):
             mock_queryset = mock.MagicMock(name="MockQuerySet")
             mock_queryset.filter.return_value = mock_queryset
             mock_queryset.order_by.return_value = mock_queryset