From 257c9ddb0c5f0cc777e27b37c211619331ad3481 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Wed, 17 Dec 2025 16:08:54 +0100 Subject: [PATCH 1/6] Use UV in CI suite --- .github/workflows/ci.yml | 44 ++++++++++++---------------------------- .gitignore | 3 +++ .readthedocs.yaml | 12 +++++------ pyproject.toml | 18 ++++++++++------ 4 files changed, 34 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c774766..44f32b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,14 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - with: - python-version: "3.x" - run: sudo apt-get update && sudo apt-get install -y gettext - - name: Install Python dependencies - run: python -m pip install --upgrade pip build wheel twine readme-renderer - - run: python -m build --sdist --wheel - - run: python -m twine check dist/* + - uses: astral-sh/setup-uv@v7 + - run: uvx --from build pyproject-build --sdist --wheel + - run: uvx twine check dist/* - uses: actions/upload-artifact@v6 with: path: dist/* @@ -24,12 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - with: - python-version: "3.11" - run: sudo apt-get update && sudo apt-get install -y gettext - - run: python -m pip install -e '.[docs]' - - run: python -m mkdocs build --strict + - uses: astral-sh/setup-uv@v7 + - run: uv run mkdocs build --strict SQLite: needs: [dist, docs] runs-on: ubuntu-latest @@ -54,13 +47,11 @@ jobs: django-version: "6.0" steps: - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 + - run: sudo apt-get update && sudo apt-get install -y gettext + - uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} - - run: sudo apt-get update && sudo apt-get install -y gettext - - run: python -m pip install -e '.[test]' - - run: python -m pip install Django~=${{ matrix.django-version }}.0 - - run: python -m pytest + - run: uv run --with django~=${{ matrix.django-version }}.0 pytest - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -78,14 +69,11 @@ jobs: - "7.2" steps: - uses: actions/checkout@v6 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - run: sudo apt-get update && sudo apt-get install -y gettext + - uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} - - run: sudo apt-get update && sudo apt-get install -y gettext - - run: python -m pip install -e ".[test,wagtail]" - - run: python -m pip install wagtail~=${{ matrix.wagtail-version }}.0 - - run: python -m pytest + - run: uv run --extra wagtail --with wagtail~=${{ matrix.wagtail-version }}.0 pytest - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -93,9 +81,6 @@ jobs: PostgreSQL: needs: [dist, docs] runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.x"] services: postgres: image: postgres @@ -106,13 +91,10 @@ jobs: - 5432/tcp options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - uses: actions/checkout@v6 - run: sudo apt-get update && sudo apt-get install -y gettext - - run: python -m pip install -e ".[test,postgres]" + - uses: astral-sh/setup-uv@v7 + - run: uv run --extra prosgres pytest - run: psql template1 -c "CREATE EXTENSION citext;" env: PGHOST: localhost diff --git a/.gitignore b/.gitignore index af0b24b..29d32b8 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,9 @@ target/ # mkdocs documentation /site/ +# UV +uv.lock + tests/local.py docs/_build/ venv diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1feab88..da886b1 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,11 +8,11 @@ build: python: "3" apt_packages: - gettext -python: - install: - - method: pip - path: . - extra_requirements: - - docs + jobs: + install: + - curl -LsSf https://astral.sh/uv/install.sh | sh + build: + html: + - $HOME/.local/bin/uv run mkdocs build --site-dir $READTHEDOCS_OUTPUT/html mkdocs: configuration: mkdocs.yml diff --git a/pyproject.toml b/pyproject.toml index a5d5bba..f3a9cb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,18 @@ dependencies = [ ] [project.optional-dependencies] +wagtail = [ + "wagtail>=6.3", +] +postgres = [ + "django-citext", +] + +[dependency-groups] +dev = [ + { include-group = "test" }, + { include-group = "docs" }, +] test = [ "pytest", "pytest-cov", @@ -60,12 +72,6 @@ docs = [ "markdown-callouts", "Pygments", ] -wagtail = [ - "wagtail>=6.3", -] -postgres = [ - "django-citext", -] [project.urls] Project-URL = "https://github.com/codingjoe/django-mail-auth" From 06d400a6839a590c27de0f27ec5323a8a5645118 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Wed, 17 Dec 2025 19:39:55 +0100 Subject: [PATCH 2/6] Update .github/workflows/ci.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44f32b2..7cdf2a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,7 @@ jobs: - uses: actions/checkout@v6 - run: sudo apt-get update && sudo apt-get install -y gettext - uses: astral-sh/setup-uv@v7 - - run: uv run --extra prosgres pytest + - run: uv run --extra postgres pytest - run: psql template1 -c "CREATE EXTENSION citext;" env: PGHOST: localhost From 087aa876b6719899652432177d1782e8181b1eee Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Wed, 17 Dec 2025 19:41:39 +0100 Subject: [PATCH 3/6] Drop explicit version --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cdf2a8..3e5e6a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,6 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.x"] wagtail-version: - "6.3" - "7.0" @@ -71,9 +70,7 @@ jobs: - uses: actions/checkout@v6 - run: sudo apt-get update && sudo apt-get install -y gettext - uses: astral-sh/setup-uv@v7 - with: - python-version: ${{ matrix.python-version }} - - run: uv run --extra wagtail --with wagtail~=${{ matrix.wagtail-version }}.0 pytest + - run: uv run --extra wagtail --with wagtail~=${{ matrix.wagtail-version }}.0 pytest - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} From d0e9093f6527997f1e03cc57e9d7c73fe0e3128a Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Wed, 17 Dec 2025 19:42:21 +0100 Subject: [PATCH 4/6] Fix pg --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e5e6a0..30878ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,15 +90,14 @@ jobs: steps: - uses: actions/checkout@v6 - run: sudo apt-get update && sudo apt-get install -y gettext - - uses: astral-sh/setup-uv@v7 - - run: uv run --extra postgres pytest - run: psql template1 -c "CREATE EXTENSION citext;" env: PGHOST: localhost PGPORT: ${{ job.services.postgres.ports[5432] }} PGUSER: django PGPASSWORD: django - - run: python -m pytest + - uses: astral-sh/setup-uv@v7 + - run: uv run --extra postgres pytest env: DB_PORT: ${{ job.services.postgres.ports[5432] }} DB: pg From b9270c987c1f709b417b8b671fbf8c69e68d87aa Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Wed, 17 Dec 2025 19:45:59 +0100 Subject: [PATCH 5/6] Fix wagtail support --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30878ab..86e6492 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v6 - run: sudo apt-get update && sudo apt-get install -y gettext - uses: astral-sh/setup-uv@v7 - - run: uv run --extra wagtail --with wagtail~=${{ matrix.wagtail-version }}.0 pytest + - run: uv run --extra wagtail --with wagtail~=${{ matrix.wagtail-version }}.0 --with django~=5.2.0 pytest - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} From 5a20d33cea22526f42f3383b5910c96644b2da65 Mon Sep 17 00:00:00 2001 From: Johannes Maron Date: Wed, 17 Dec 2025 19:49:25 +0100 Subject: [PATCH 6/6] use psycopg binary --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f3a9cb0..57f3339 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ wagtail = [ ] postgres = [ "django-citext", + "psycopg", ] [dependency-groups]