Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Enables Python 3.11 testing

Trenton H0ef3a141a870
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b928b8634..7be31de47 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -105,7 +105,7 @@ jobs:
- pre-commit
strategy:
matrix:
- python-version: ['3.8', '3.9', '3.10']
+ python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
steps:
-
diff --git a/docs/setup.md b/docs/setup.md
index 6ade1cb96..10f260b73 100644
--- a/docs/setup.md
+++ b/docs/setup.md
@@ -255,7 +255,7 @@ supported.
1. Install dependencies. Paperless requires the following packages.
- - `python3` 3.8, 3.9
+ - `python3` - 3.8 - 3.11 are supported
- `python3-pip`
- `python3-dev`
- `default-libmysqlclient-dev` for MariaDB
diff --git a/src/documents/tests/test_migration_archive_files.py b/src/documents/tests/test_migration_archive_files.py
index 80fc04205..94e9f452c 100644
--- a/src/documents/tests/test_migration_archive_files.py
+++ b/src/documents/tests/test_migration_archive_files.py
@@ -1,4 +1,5 @@
import hashlib
+import importlib
import os
import shutil
from pathlib import Path
@@ -15,6 +16,10 @@ from documents.tests.utils import TestMigrations
STORAGE_TYPE_GPG = "gpg"
+migration_1012_obj = importlib.import_module(
+ "documents.migrations.1012_fix_archive_files",
+)
+
def archive_name_from_filename(filename):
return os.path.splitext(filename)[0] + ".pdf"
@@ -331,7 +336,7 @@ class TestMigrateArchiveFilesErrors(DirectoriesMixin, TestMigrations):
self.performMigration,
)
- @mock.patch("documents.migrations.1012_fix_archive_files.parse_wrapper")
+ @mock.patch(f"{__name__}.migration_1012_obj.parse_wrapper")
def test_parser_error(self, m):
m.side_effect = ParseError()
Document = self.apps.get_model("documents", "Document")
@@ -396,7 +401,7 @@ class TestMigrateArchiveFilesErrors(DirectoriesMixin, TestMigrations):
self.assertIsNone(doc1.archive_filename)
self.assertIsNone(doc2.archive_filename)
- @mock.patch("documents.migrations.1012_fix_archive_files.parse_wrapper")
+ @mock.patch(f"{__name__}.migration_1012_obj.parse_wrapper")
def test_parser_no_archive(self, m):
m.side_effect = fake_parse_wrapper
diff --git a/src/setup.cfg b/src/setup.cfg
index 185ac6f55..fb6ecf315 100644
--- a/src/setup.cfg
+++ b/src/setup.cfg
@@ -7,7 +7,7 @@ max-line-length = 88
[tool:pytest]
DJANGO_SETTINGS_MODULE=paperless.settings
-addopts = --pythonwarnings=all --cov --cov-report=html --cov-report=xml --numprocesses auto --quiet
+addopts = --pythonwarnings=all --cov --cov-report=html --cov-report=xml --numprocesses auto --quiet --durations=50
env =
PAPERLESS_DISABLE_DBHANDLER=true