mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	Unlocks all things which were locked due to ARMv7, etc
This commit is contained in:
		
							parent
							
								
									3205bb3bdf
								
							
						
					
					
						commit
						d532913d56
					
				@ -1,21 +1,28 @@
 | 
				
			|||||||
 | 
					# Tool caches
 | 
				
			||||||
**/__pycache__
 | 
					**/__pycache__
 | 
				
			||||||
/src-ui/.vscode
 | 
					**/.ruff_cache/
 | 
				
			||||||
/src-ui/node_modules
 | 
					**/.mypy_cache/
 | 
				
			||||||
/src-ui/dist
 | 
					# Virtual environment & similar
 | 
				
			||||||
 | 
					.venv/
 | 
				
			||||||
 | 
					./src-ui/node_modules
 | 
				
			||||||
 | 
					./src-ui/dist
 | 
				
			||||||
 | 
					# IDE folders
 | 
				
			||||||
 | 
					.idea/
 | 
				
			||||||
 | 
					.vscode/
 | 
				
			||||||
 | 
					./src-ui/.vscode
 | 
				
			||||||
 | 
					# VCS
 | 
				
			||||||
.git
 | 
					.git
 | 
				
			||||||
/export
 | 
					# Test related
 | 
				
			||||||
/consume
 | 
					**/.pytest_cache
 | 
				
			||||||
/media
 | 
					 | 
				
			||||||
/data
 | 
					 | 
				
			||||||
/docs
 | 
					 | 
				
			||||||
.pytest_cache
 | 
					 | 
				
			||||||
/dist
 | 
					 | 
				
			||||||
/scripts
 | 
					 | 
				
			||||||
/resources
 | 
					 | 
				
			||||||
**/tests
 | 
					**/tests
 | 
				
			||||||
**/*.spec.ts
 | 
					**/*.spec.ts
 | 
				
			||||||
**/htmlcov
 | 
					**/htmlcov
 | 
				
			||||||
/src/.pytest_cache
 | 
					# Local folders
 | 
				
			||||||
.idea
 | 
					./export
 | 
				
			||||||
.venv/
 | 
					./consume
 | 
				
			||||||
.vscode/
 | 
					./media
 | 
				
			||||||
 | 
					./data
 | 
				
			||||||
 | 
					./docs
 | 
				
			||||||
 | 
					./dist
 | 
				
			||||||
 | 
					./scripts
 | 
				
			||||||
 | 
					./resources
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@ -16,7 +16,7 @@ on:
 | 
				
			|||||||
env:
 | 
					env:
 | 
				
			||||||
  # This is the version of pipenv all the steps will use
 | 
					  # This is the version of pipenv all the steps will use
 | 
				
			||||||
  # If changing this, change Dockerfile
 | 
					  # If changing this, change Dockerfile
 | 
				
			||||||
  DEFAULT_PIP_ENV_VERSION: "2023.7.23"
 | 
					  DEFAULT_PIP_ENV_VERSION: "2023.9.8"
 | 
				
			||||||
  # This is the default version of Python to use in most steps
 | 
					  # This is the default version of Python to use in most steps
 | 
				
			||||||
  # If changing this, change Dockerfile
 | 
					  # If changing this, change Dockerfile
 | 
				
			||||||
  DEFAULT_PYTHON_VERSION: "3.9"
 | 
					  DEFAULT_PYTHON_VERSION: "3.9"
 | 
				
			||||||
 | 
				
			|||||||
@ -27,7 +27,7 @@ repos:
 | 
				
			|||||||
      - id: check-case-conflict
 | 
					      - id: check-case-conflict
 | 
				
			||||||
      - id: detect-private-key
 | 
					      - id: detect-private-key
 | 
				
			||||||
  - repo: https://github.com/pre-commit/mirrors-prettier
 | 
					  - repo: https://github.com/pre-commit/mirrors-prettier
 | 
				
			||||||
    rev: 'v3.0.0'
 | 
					    rev: 'v3.0.3'
 | 
				
			||||||
    hooks:
 | 
					    hooks:
 | 
				
			||||||
      - id: prettier
 | 
					      - id: prettier
 | 
				
			||||||
        types_or:
 | 
					        types_or:
 | 
				
			||||||
@ -36,11 +36,11 @@ repos:
 | 
				
			|||||||
          - markdown
 | 
					          - markdown
 | 
				
			||||||
        exclude: "(^Pipfile\\.lock$)"
 | 
					        exclude: "(^Pipfile\\.lock$)"
 | 
				
			||||||
  # Python hooks
 | 
					  # Python hooks
 | 
				
			||||||
  - repo: https://github.com/charliermarsh/ruff-pre-commit
 | 
					  - repo: https://github.com/astral-sh/ruff-pre-commit
 | 
				
			||||||
    rev: 'v0.0.280'
 | 
					    rev: 'v0.0.287'
 | 
				
			||||||
    hooks:
 | 
					    hooks:
 | 
				
			||||||
      - id: ruff
 | 
					      - id: ruff
 | 
				
			||||||
  - repo: https://github.com/psf/black
 | 
					  - repo: https://github.com/psf/black-pre-commit-mirror
 | 
				
			||||||
    rev: 23.7.0
 | 
					    rev: 23.7.0
 | 
				
			||||||
    hooks:
 | 
					    hooks:
 | 
				
			||||||
      - id: black
 | 
					      - id: black
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +1 @@
 | 
				
			|||||||
3.8.16
 | 
					3.8.17
 | 
				
			||||||
 | 
				
			|||||||
@ -29,7 +29,7 @@ COPY Pipfile* ./
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
RUN set -eux \
 | 
					RUN set -eux \
 | 
				
			||||||
  && echo "Installing pipenv" \
 | 
					  && echo "Installing pipenv" \
 | 
				
			||||||
    && python3 -m pip install --no-cache-dir --upgrade pipenv==2023.7.23 \
 | 
					    && python3 -m pip install --no-cache-dir --upgrade pipenv==2023.9.8 \
 | 
				
			||||||
  && echo "Generating requirement.txt" \
 | 
					  && echo "Generating requirement.txt" \
 | 
				
			||||||
    && pipenv requirements > requirements.txt
 | 
					    && pipenv requirements > requirements.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -174,9 +174,6 @@ ARG TARGETVARIANT
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Can be workflow provided, defaults set for manual building
 | 
					# Can be workflow provided, defaults set for manual building
 | 
				
			||||||
ARG JBIG2ENC_VERSION=0.29
 | 
					ARG JBIG2ENC_VERSION=0.29
 | 
				
			||||||
ARG QPDF_VERSION=11.3.0
 | 
					 | 
				
			||||||
ARG PIKEPDF_VERSION=7.2.0
 | 
					 | 
				
			||||||
ARG PSYCOPG2_VERSION=2.9.6
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Install the built packages from the installer library images
 | 
					# Install the built packages from the installer library images
 | 
				
			||||||
# These change sometimes
 | 
					# These change sometimes
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										16
									
								
								Pipfile
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								Pipfile
									
									
									
									
									
								
							@ -3,10 +3,6 @@ url = "https://pypi.python.org/simple"
 | 
				
			|||||||
verify_ssl = true
 | 
					verify_ssl = true
 | 
				
			||||||
name = "pypi"
 | 
					name = "pypi"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[[source]]
 | 
					 | 
				
			||||||
url = "https://www.piwheels.org/simple"
 | 
					 | 
				
			||||||
verify_ssl = true
 | 
					 | 
				
			||||||
name = "piwheels"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
[packages]
 | 
					[packages]
 | 
				
			||||||
dateparser = "~=1.1"
 | 
					dateparser = "~=1.1"
 | 
				
			||||||
@ -55,17 +51,6 @@ pdf2image = "*"
 | 
				
			|||||||
flower = "*"
 | 
					flower = "*"
 | 
				
			||||||
bleach = "*"
 | 
					bleach = "*"
 | 
				
			||||||
zxing-cpp = {version = "*", platform_machine = "== 'x86_64'"}
 | 
					zxing-cpp = {version = "*", platform_machine = "== 'x86_64'"}
 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Packages locked due to issues (try to check if these are fixed in a release every so often)
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Pin this until piwheels is building 1.9 (see https://www.piwheels.org/project/scipy/)
 | 
					 | 
				
			||||||
scipy = "==1.8.1"
 | 
					 | 
				
			||||||
# v4 brings in extra dependencies for features not used here
 | 
					 | 
				
			||||||
reportlab = "==3.6.12"
 | 
					 | 
				
			||||||
# Pin these until piwheels is building a newer version (see https://www.piwheels.org/project/{package}/)
 | 
					 | 
				
			||||||
cryptography = "==40.0.1"
 | 
					 | 
				
			||||||
pikepdf = "==7.2.0"
 | 
					 | 
				
			||||||
pillow = "==9.5.0"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
[dev-packages]
 | 
					[dev-packages]
 | 
				
			||||||
# Linting
 | 
					# Linting
 | 
				
			||||||
@ -98,7 +83,6 @@ celery-types = "*"
 | 
				
			|||||||
django-stubs = {extras= ["compatible-mypy"], version="*"}
 | 
					django-stubs = {extras= ["compatible-mypy"], version="*"}
 | 
				
			||||||
types-dateparser = "*"
 | 
					types-dateparser = "*"
 | 
				
			||||||
types-bleach = "*"
 | 
					types-bleach = "*"
 | 
				
			||||||
types-humanfriendly = "*"
 | 
					 | 
				
			||||||
types-redis = "*"
 | 
					types-redis = "*"
 | 
				
			||||||
types-tqdm = "*"
 | 
					types-tqdm = "*"
 | 
				
			||||||
types-Markdown = "*"
 | 
					types-Markdown = "*"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2107
									
								
								Pipfile.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2107
									
								
								Pipfile.lock
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -182,8 +182,8 @@ class Command(BaseCommand):
 | 
				
			|||||||
            doc_path = self.source / doc_file
 | 
					            doc_path = self.source / doc_file
 | 
				
			||||||
            if not doc_path.exists():
 | 
					            if not doc_path.exists():
 | 
				
			||||||
                raise CommandError(
 | 
					                raise CommandError(
 | 
				
			||||||
                    'The manifest file refers to "{}" which does not '
 | 
					                    f'The manifest file refers to "{doc_file}" which does not '
 | 
				
			||||||
                    "appear to be in the source directory.".format(doc_file),
 | 
					                    "appear to be in the source directory.",
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                with doc_path.open(mode="rb") as infile:
 | 
					                with doc_path.open(mode="rb") as infile:
 | 
				
			||||||
 | 
				
			|||||||
@ -530,9 +530,9 @@ class DocumentListSerializer(serializers.Serializer):
 | 
				
			|||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _validate_document_id_list(self, documents, name="documents"):
 | 
					    def _validate_document_id_list(self, documents, name="documents"):
 | 
				
			||||||
        if not type(documents) == list:
 | 
					        if not isinstance(documents, list):
 | 
				
			||||||
            raise serializers.ValidationError(f"{name} must be a list")
 | 
					            raise serializers.ValidationError(f"{name} must be a list")
 | 
				
			||||||
        if not all(type(i) == int for i in documents):
 | 
					        if not all(isinstance(i, int) for i in documents):
 | 
				
			||||||
            raise serializers.ValidationError(f"{name} must be a list of integers")
 | 
					            raise serializers.ValidationError(f"{name} must be a list of integers")
 | 
				
			||||||
        count = Document.objects.filter(id__in=documents).count()
 | 
					        count = Document.objects.filter(id__in=documents).count()
 | 
				
			||||||
        if not count == len(documents):
 | 
					        if not count == len(documents):
 | 
				
			||||||
@ -565,9 +565,9 @@ class BulkEditSerializer(DocumentListSerializer, SetPermissionsMixin):
 | 
				
			|||||||
    parameters = serializers.DictField(allow_empty=True)
 | 
					    parameters = serializers.DictField(allow_empty=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _validate_tag_id_list(self, tags, name="tags"):
 | 
					    def _validate_tag_id_list(self, tags, name="tags"):
 | 
				
			||||||
        if not type(tags) == list:
 | 
					        if not isinstance(tags, list):
 | 
				
			||||||
            raise serializers.ValidationError(f"{name} must be a list")
 | 
					            raise serializers.ValidationError(f"{name} must be a list")
 | 
				
			||||||
        if not all(type(i) == int for i in tags):
 | 
					        if not all(isinstance(i, int) for i in tags):
 | 
				
			||||||
            raise serializers.ValidationError(f"{name} must be a list of integers")
 | 
					            raise serializers.ValidationError(f"{name} must be a list of integers")
 | 
				
			||||||
        count = Tag.objects.filter(id__in=tags).count()
 | 
					        count = Tag.objects.filter(id__in=tags).count()
 | 
				
			||||||
        if not count == len(tags):
 | 
					        if not count == len(tags):
 | 
				
			||||||
@ -932,9 +932,9 @@ class AcknowledgeTasksViewSerializer(serializers.Serializer):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    def _validate_task_id_list(self, tasks, name="tasks"):
 | 
					    def _validate_task_id_list(self, tasks, name="tasks"):
 | 
				
			||||||
        pass
 | 
					        pass
 | 
				
			||||||
        if not type(tasks) == list:
 | 
					        if not isinstance(tasks, list):
 | 
				
			||||||
            raise serializers.ValidationError(f"{name} must be a list")
 | 
					            raise serializers.ValidationError(f"{name} must be a list")
 | 
				
			||||||
        if not all(type(i) == int for i in tasks):
 | 
					        if not all(isinstance(i, int) for i in tasks):
 | 
				
			||||||
            raise serializers.ValidationError(f"{name} must be a list of integers")
 | 
					            raise serializers.ValidationError(f"{name} must be a list of integers")
 | 
				
			||||||
        count = PaperlessTask.objects.filter(id__in=tasks).count()
 | 
					        count = PaperlessTask.objects.filter(id__in=tasks).count()
 | 
				
			||||||
        if not count == len(tasks):
 | 
					        if not count == len(tasks):
 | 
				
			||||||
 | 
				
			|||||||
@ -43,7 +43,7 @@ class StandardPagination(PageNumberPagination):
 | 
				
			|||||||
        if hasattr(self.page.paginator.object_list, "saved_results"):
 | 
					        if hasattr(self.page.paginator.object_list, "saved_results"):
 | 
				
			||||||
            results_page = self.page.paginator.object_list.saved_results[0]
 | 
					            results_page = self.page.paginator.object_list.saved_results[0]
 | 
				
			||||||
            if results_page is not None:
 | 
					            if results_page is not None:
 | 
				
			||||||
                for i in range(0, len(results_page.results.docs())):
 | 
					                for i in range(len(results_page.results.docs())):
 | 
				
			||||||
                    try:
 | 
					                    try:
 | 
				
			||||||
                        fields = results_page.results.fields(i)
 | 
					                        fields = results_page.results.fields(i)
 | 
				
			||||||
                        if "id" in fields:
 | 
					                        if "id" in fields:
 | 
				
			||||||
 | 
				
			|||||||
@ -151,7 +151,7 @@ class TagMailAction(BaseMailAction):
 | 
				
			|||||||
            _, self.color = parameter.split(":")
 | 
					            _, self.color = parameter.split(":")
 | 
				
			||||||
            self.color = self.color.strip()
 | 
					            self.color = self.color.strip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if self.color.lower() not in APPLE_MAIL_TAG_COLORS.keys():
 | 
					            if self.color.lower() not in APPLE_MAIL_TAG_COLORS:
 | 
				
			||||||
                raise MailError("Not a valid AppleMail tag color.")
 | 
					                raise MailError("Not a valid AppleMail tag color.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            self.keyword = None
 | 
					            self.keyword = None
 | 
				
			||||||
 | 
				
			|||||||
@ -9,7 +9,7 @@ from bleach import linkify
 | 
				
			|||||||
from django.conf import settings
 | 
					from django.conf import settings
 | 
				
			||||||
from django.utils.timezone import is_naive
 | 
					from django.utils.timezone import is_naive
 | 
				
			||||||
from django.utils.timezone import make_aware
 | 
					from django.utils.timezone import make_aware
 | 
				
			||||||
from humanfriendly import format_size
 | 
					from humanize import naturalsize
 | 
				
			||||||
from imap_tools import MailAttachment
 | 
					from imap_tools import MailAttachment
 | 
				
			||||||
from imap_tools import MailMessage
 | 
					from imap_tools import MailMessage
 | 
				
			||||||
from tika_client import TikaClient
 | 
					from tika_client import TikaClient
 | 
				
			||||||
@ -72,7 +72,7 @@ class MailDocumentParser(DocumentParser):
 | 
				
			|||||||
                "key": "attachments",
 | 
					                "key": "attachments",
 | 
				
			||||||
                "value": ", ".join(
 | 
					                "value": ", ".join(
 | 
				
			||||||
                    f"{attachment.filename}"
 | 
					                    f"{attachment.filename}"
 | 
				
			||||||
                    f"({format_size(attachment.size, binary=True)})"
 | 
					                    f"({naturalsize(attachment.size, binary=True, format='%.2f')})"
 | 
				
			||||||
                    for attachment in mail.attachments
 | 
					                    for attachment in mail.attachments
 | 
				
			||||||
                ),
 | 
					                ),
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
@ -124,7 +124,10 @@ class MailDocumentParser(DocumentParser):
 | 
				
			|||||||
            if mail_message.attachments:
 | 
					            if mail_message.attachments:
 | 
				
			||||||
                att = []
 | 
					                att = []
 | 
				
			||||||
                for a in mail.attachments:
 | 
					                for a in mail.attachments:
 | 
				
			||||||
                    att.append(f"{a.filename} ({format_size(a.size, binary=True)})")
 | 
					                    attachment_size = naturalsize(a.size, binary=True, format="%.2f")
 | 
				
			||||||
 | 
					                    att.append(
 | 
				
			||||||
 | 
					                        f"{a.filename} ({attachment_size})",
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
                fmt_text += f"Attachments: {', '.join(att)}\n\n"
 | 
					                fmt_text += f"Attachments: {', '.join(att)}\n\n"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if mail.html:
 | 
					            if mail.html:
 | 
				
			||||||
@ -247,7 +250,7 @@ class MailDocumentParser(DocumentParser):
 | 
				
			|||||||
            """
 | 
					            """
 | 
				
			||||||
            if isinstance(text, list):
 | 
					            if isinstance(text, list):
 | 
				
			||||||
                text = "\n".join([str(e) for e in text])
 | 
					                text = "\n".join([str(e) for e in text])
 | 
				
			||||||
            if type(text) != str:
 | 
					            if not isinstance(text, str):
 | 
				
			||||||
                text = str(text)
 | 
					                text = str(text)
 | 
				
			||||||
            text = escape(text)
 | 
					            text = escape(text)
 | 
				
			||||||
            text = clean(text)
 | 
					            text = clean(text)
 | 
				
			||||||
@ -275,7 +278,9 @@ class MailDocumentParser(DocumentParser):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        att = []
 | 
					        att = []
 | 
				
			||||||
        for a in mail.attachments:
 | 
					        for a in mail.attachments:
 | 
				
			||||||
            att.append(f"{a.filename} ({format_size(a.size, binary=True)})")
 | 
					            att.append(
 | 
				
			||||||
 | 
					                f"{a.filename} ({naturalsize(a.size, binary=True, format='%.2f')})",
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
        data["attachments"] = clean_html(", ".join(att))
 | 
					        data["attachments"] = clean_html(", ".join(att))
 | 
				
			||||||
        if data["attachments"]:
 | 
					        if data["attachments"]:
 | 
				
			||||||
            data["attachments_label"] = "Attachments"
 | 
					            data["attachments_label"] = "Attachments"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user