diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f64a3478..01a542c8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v7 with: - python-version: 3.14 + python-version: 3.15 cache: 'pip' - name: Lint sources uses: yorickdowne/pc-action@14ede0db48efa22fe0f9d70a47d23d811e2ba946 # v3.0.2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e765834d..c7fc9f46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ --- default_language_version: - python: python3.14 + python: python3.15 repos: - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8db9b741..40d18cb1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,16 @@ Contributions are welcome. All contributed code will be covered by the Apache Li Eth Docker CI uses [pre-commit](https://pre-commit.com/) to lint all code within the repo. Add it to your local copy with `apt install pre-commit` and `pre-commit install`. +Install uv +``` +curl -LsSf https://astral.sh/uv/install.sh | sh +``` +Python 3.15 needs to be installed on the host. If you don't have it, use `uv` to install a local copy. +``` +uv python install 3.15 +uv python update-shell +``` + This repo uses a squash-and-merge workflow to avoid extra merge commits. Create a branch for your feature or fix, and work on this branch, then offer a PR from there. A `rebase -i origin/main` on your PR that squashes everything into one commit is friendly. If you end up working on `main`, you can create an `upstream` remote with diff --git a/traefik-utils/Dockerfile b/traefik-utils/Dockerfile index 66f4b177..83abdd09 100644 --- a/traefik-utils/Dockerfile +++ b/traefik-utils/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.14-alpine +FROM python:3.15-alpine WORKDIR /app diff --git a/traefik-utils/app/cf_provider.py b/traefik-utils/app/cf_provider.py index 3f98ea45..035053b1 100644 --- a/traefik-utils/app/cf_provider.py +++ b/traefik-utils/app/cf_provider.py @@ -1,11 +1,9 @@ -__lazy_modules__ = ["cloudflare"] - import logging from collections.abc import Mapping from typing import Any, cast -from cloudflare import Cloudflare -from cloudflare.types.dns import RecordResponse +lazy from cloudflare import Cloudflare +lazy from cloudflare.types.dns import RecordResponse from base import DNSProvider, RecordType, normalize_fqdn diff --git a/traefik-utils/app/pyproject.toml b/traefik-utils/app/pyproject.toml index 083f22e2..b7b467c3 100644 --- a/traefik-utils/app/pyproject.toml +++ b/traefik-utils/app/pyproject.toml @@ -1,6 +1,12 @@ [project] name = "ddns" -requires-python = ">=3.14,<4" +requires-python = ">=3.15,<4" +dependencies = [ + "boto3", + "cloudflare", + "requests", + "tenacity", +] dynamic = ["version"] [project.optional-dependencies] diff --git a/traefik-utils/app/requirements.in b/traefik-utils/app/requirements.in deleted file mode 100644 index 0933da3f..00000000 --- a/traefik-utils/app/requirements.in +++ /dev/null @@ -1,4 +0,0 @@ -boto3 -cloudflare -requests -tenacity diff --git a/traefik-utils/app/requirements.txt b/traefik-utils/app/requirements.txt index 36add65b..47428774 100644 --- a/traefik-utils/app/requirements.txt +++ b/traefik-utils/app/requirements.txt @@ -1,9 +1,5 @@ -# -# This file is autogenerated by pip-compile with Python 3.14 -# by the following command: -# -# pip-compile --generate-hashes --output-file=requirements.txt --strip-extras requirements.in -# +# This file was autogenerated by uv via the following command: +# uv pip compile pyproject.toml --generate-hashes --output-file requirements.txt annotated-types==0.7.0 \ --hash=sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53 \ --hash=sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89 @@ -19,7 +15,7 @@ boto3==1.43.62 \ --hash=sha256:0bb298e7ffd72b91615df44bf71c417df80a29d844971e5d665b8bd743a4bb35 \ --hash=sha256:0bf920e0739346e81c7310b685a3f783bf1fcc62ce7d5c7016508fa25c0d261f \ --hash=sha256:0bf920e0739346e81c7310b685a3f783bf1fcc62ce7d5c7016508fa25c0d261f - # via -r app/requirements.in + # via ddns (pyproject.toml) botocore==1.43.63 \ --hash=sha256:854e45247f00b0732496ea1f0c5d0cf3c31d58b48eb052c31c27ab1087dfddf1 \ --hash=sha256:8deed86feacc8f8d2491f1d170562af191f8b33924052d834f4217d5d797e5a9 @@ -117,7 +113,7 @@ charset-normalizer==3.4.3 \ cloudflare==5.6.0 \ --hash=sha256:b8c81586aecd0ce48f0daaa859cce554f7b975b01d312b60d1a91ad0ea4b67ff \ --hash=sha256:d3b5ab79a03bd858380c8a56cc09362d744b7c9e9abb27890206624a64887305 - # via -r app/requirements.in + # via ddns (pyproject.toml) distro==1.9.0 \ --hash=sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed \ --hash=sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2 @@ -280,7 +276,7 @@ python-dateutil==2.9.0.post0 \ requests==2.34.2 \ --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 \ --hash=sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed - # via -r app/requirements.in + # via ddns (pyproject.toml) s3transfer==0.19.0 \ --hash=sha256:777cc2415536f1debadb5c2ef7779275d0fc0fe0e042411cdd6caebeb2685262 \ --hash=sha256:ce436931687addc4c1712d52d40b32f53e88315723f107ffa20ba82b05a0f685 @@ -296,7 +292,7 @@ sniffio==1.3.1 \ tenacity==9.1.4 \ --hash=sha256:6095a360c919085f28c6527de529e76a06ad89b23659fa881ae0649b867a9d55 \ --hash=sha256:adb31d4c263f2bd041081ab33b498309a57c77f9acf2db65aadf0898179cf93a - # via -r app/requirements.in + # via ddns (pyproject.toml) typing-extensions==4.15.0 \ --hash=sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466 \ --hash=sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548 diff --git a/traefik-utils/app/route53_provider.py b/traefik-utils/app/route53_provider.py index 5238053d..fbd6282f 100644 --- a/traefik-utils/app/route53_provider.py +++ b/traefik-utils/app/route53_provider.py @@ -1,12 +1,10 @@ -__lazy_modules__ = ["boto3", "botocore.exceptions"] - import os import logging from typing import cast, TYPE_CHECKING from collections.abc import Mapping -import boto3 -from botocore.exceptions import ClientError +lazy import boto3 +lazy from botocore.exceptions import ClientError from base import DNSProvider, RecordType, normalize_fqdn if TYPE_CHECKING: