diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5de1028..238a41e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v4 with: - python-version: "3.12" + python-version: "3.14" - name: Install dependencies run: uv sync --all-extras --frozen --no-install-project - name: Run linters diff --git a/Dockerfile b/Dockerfile index 557f3d5..5c4707a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,12 @@ -FROM python:3.12-slim-bookworm - -RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* - -COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv +# python-alpine with uv +FROM ghcr.io/astral-sh/uv:python3.14-alpine3.23 WORKDIR /app COPY app/ /app/ -COPY pyproject.toml uv.lock /app/ +COPY pyproject.toml /app/ -RUN uv sync --frozen --no-dev --no-install-project +RUN uv sync --no-dev --no-install-project EXPOSE 8000 ENTRYPOINT ["/app/start.sh"] diff --git a/Makefile b/Makefile index 2f4c339..d40d729 100644 --- a/Makefile +++ b/Makefile @@ -7,3 +7,6 @@ lint: uv run isort --check . uv run flake8 . uv run mypy --namespace-packages --show-error-codes ./app + +docker-up: + docker compose up diff --git a/README.md b/README.md index e279145..0c2a8b4 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,28 @@ # Pyuploadcare Example app This example project demonstrates the pyuploadcare capabilities. -The project is based on Python 3.12 and Django 4.2.10. - -* [Installation](#installation) - * [Using docker](#using-docker) - * [Without docker](#without-docker) -* [Usage](#usage) - * [Configuration](#configuration) - * [Project section](#project-section) - * [Files section](#files-section) - * [File Groups section](#file-groups-section) - * [Files uploading](#files-uploading) - * [Conversion](#conversion) - * [Documents conversion](#documents-conversion) - * [Video conversion](#video-conversion) - * [Webhooks](#webhooks) - * [Posts section](#posts-section) -* [Useful links](#useful-links) +The project is based on Python 3.14 and Django 4.2.10. + +- [Pyuploadcare Example app](#pyuploadcare-example-app) + - [Installation](#installation) + - [Using Docker](#using-docker) + - [Without docker](#without-docker) + - [Usage](#usage) + - [Configuration](#configuration) + - [Project section](#project-section) + - [Files section](#files-section) + - [File Groups section](#file-groups-section) + - [Files uploading](#files-uploading) + - [Conversion](#conversion) + - [Documents conversion](#documents-conversion) + - [Video conversion](#video-conversion) + - [Addons](#addons) + - [Object recognition via AWS](#object-recognition-via-aws) + - [ClamAV Antivirus scan](#clamav-antivirus-scan) + - [Background removing](#background-removing) + - [Webhooks](#webhooks) + - [Posts section](#posts-section) + - [Useful links](#useful-links) ## Installation @@ -184,7 +189,7 @@ Conversion result page also includes information about how conversion is going. User can execute operations that wrapped as addons. There are three implemented addons: -- background removing +- background removing - virus scanning - object recognition @@ -197,7 +202,7 @@ You only need to choose a file to start a recognition ![Setup recogntion](./img/setup_addon_aws_recognition.png) -After all corresponding part of file's `adddata` is rendered +After all corresponding part of file's `adddata` is rendered and you can get into full file information if needed ![Recogntion results](./img/addon_aws_execution_result.png) @@ -225,7 +230,7 @@ so you may see `IN_PROGRESS` status page with refresh button ![Recogntion results](./img/addon_remove_bg_in_progress.png) -Image with removed background will be put into new file, +Image with removed background will be put into new file, so the result page has both links to the original file and created one ![Background results](./img/addon_remove_bg_result_done.png) @@ -273,10 +278,10 @@ To create a new post, click on the `Add` button in posts index page. The post fo ![Create a post](./img/post_create.png) ## Useful links -* [Uploadcare documentation](https://uploadcare.com/docs/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) -* [Upload API reference](https://uploadcare.com/api-refs/upload-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) -* [REST API reference](https://uploadcare.com/api-refs/rest-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) -* [Contributing guide](https://github.com/uploadcare/.github/blob/master/CONTRIBUTING.md) -* [Security policy](https://github.com/uploadcare/pyuploadcare/security/policy) +* [Uploadcare documentation](https://uploadcare.com/docs/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) +* [Upload API reference](https://uploadcare.com/api-refs/upload-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) +* [REST API reference](https://uploadcare.com/api-refs/rest-api/?utm_source=github&utm_medium=referral&utm_campaign=pyuploadcare) +* [Contributing guide](https://github.com/uploadcare/.github/blob/master/CONTRIBUTING.md) +* [Security policy](https://github.com/uploadcare/pyuploadcare/security/policy) * [Support](https://github.com/uploadcare/.github/blob/master/SUPPORT.md) * [A Python library for Uploadcare service](https://github.com/uploadcare/pyuploadcare) diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 91590b1..0000000 --- a/mypy.ini +++ /dev/null @@ -1,6 +0,0 @@ -[mypy] -ignore_missing_imports = True -allow_untyped_globals = True - -[mypy-*.migrations.*] -ignore_errors = True diff --git a/pyproject.toml b/pyproject.toml index d584da9..b50d89f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,27 +1,26 @@ [project] name = "pyuploadcare-example" -version = "5.0.1" +version = "5.1.0" description = "Example project for Python library for Uploadcare.com" authors = [{ name = "Uploadcare Inc", email = "hello@uploadcare.com" }] -requires-python = ">=3.12.12,<4.0" +requires-python = ">=3.14.3,<4.0" dependencies = [ "Django>=4.2.28,<5", "django-crispy-forms>=2.1", "crispy-bootstrap4>=2023.1", - "pyuploadcare @ git+https://github.com/uploadcare/pyuploadcare@v5.0.1", + "pyuploadcare>=6.2.1,<7.0.0", ] [dependency-groups] dev = [ - "flake8>=7.0.0", - "mypy>=1.8.0", - "black>=24.3.0", - "isort>=5.13.2", + "flake8>=7.3.0", + "black>=26.1.0", + "isort>=7.0.0", ] [tool.black] line-length = 100 -target-version = ['py312'] +target-version = ['py314'] exclude = ''' ( \.eggs