diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 18b3abde0..ee82923d4 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -150,49 +150,3 @@ jobs: - name: Clean the database run: c2cciutils-k8s-db --cleanup if: always() - - audit: - name: Audit - runs-on: ubuntu-24.04 - timeout-minutes: 10 - if: "!startsWith(github.event.head_commit.message, '[skip ci] ')" - - steps: - - run: docker system prune --all --force - - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - uses: camptocamp/initialise-gopass-summon-action@v2 - with: - ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}} - github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}} - - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - run: python3 -m pip install --requirement=requirements.txt - - run: poetry build - env: - POETRY_DYNAMIC_VERSIONING_BYPASS: 0.0.0 - - - run: python3 -m venv ~/.venv - - run: ~/.venv/bin/pip install --force-reinstall dist/c2cciutils-0.0.0-py3-none-any.whl[audit] - - run: python3 -m pip install dist/c2cciutils-0.0.0-py3-none-any.whl[audit] - - - name: Check .tool-versions file existence - id: tool-versions - uses: andstor/file-existence-action@v3 - with: - files: .tool-versions - - uses: asdf-vm/actions/install@v3 - if: steps.tool-versions.outputs.files_exists == 'true' - - run: cat /tmp/python-build.*.log - if: failure() - - run: python --version - - - name: Audit - run: ~/.venv/bin/c2cciutils-audit --branch=${{ github.ref }} - env: - TEST: 'TRUE' - GITHUB_TOKEN: ${{ github.token }} diff --git a/.prospector.yaml b/.prospector.yaml index 926c1efae..97cfd0278 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -16,3 +16,9 @@ pylint: bandit: options: config: .bandit.yaml + +pycodestyle: + disable: + # Buggy checks that don't detect strings + - W604 # backticks are deprecated, use 'repr()' + - E221 # multiple spaces before operator diff --git a/Dockerfile b/Dockerfile index fe5a038d4..44b23b669 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,22 @@ -FROM ubuntu:22.04 AS base-all -LABEL maintainer Camptocamp "info@camptocamp.com" +FROM ubuntu:24.04 AS base-all +LABEL maintainer='Camptocamp "info@camptocamp.com"' + SHELL ["/bin/bash", "-o", "pipefail", "-cux"] -RUN --mount=type=cache,target=/var/lib/apt/lists --mount=type=cache,target=/var/cache \ - sed -i '/-backports /d' /etc/apt/sources.list \ - && apt-get update \ - && apt-get install --yes --no-install-recommends python3-pip binutils +RUN --mount=type=cache,target=/var/lib/apt/lists \ + --mount=type=cache,target=/var/cache,sharing=locked \ + apt-get update \ + && apt-get upgrade --yes \ + && apt-get install --yes --no-install-recommends apt-utils \ + && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --yes tzdata \ + && apt-get install --yes --no-install-recommends binutils python3-pip python3-venv \ + && python3 -m venv /venv + +ENV PATH=/venv/bin:$PATH # Used to convert the locked packages by poetry to pip requirements format # We don't directly use `poetry install` because it force to use a virtual environment. -FROM base-all as poetry +FROM base-all AS poetry # Install Poetry WORKDIR /tmp @@ -24,7 +31,7 @@ RUN poetry export --extras=checks --extras=publish --extras=audit --extras=versi && poetry export --with=dev --output=requirements-dev.txt # Base, the biggest thing is to install the Python packages -FROM base-all as base +FROM base-all AS base WORKDIR /app diff --git a/c2cciutils/lib/oidc.py b/c2cciutils/lib/oidc.py index 3a385832f..82abd5303 100755 --- a/c2cciutils/lib/oidc.py +++ b/c2cciutils/lib/oidc.py @@ -105,14 +105,15 @@ def _get_token(hostname: str) -> str: a few minutes and try again. You can monitor PyPI's status here: https://status.python.org/ -""" +""" # noqa: E702 ) # On failure, the JSON response includes the list of errors that # occurred during minting. if not mint_token_resp.ok: reasons = "\n".join( - f'* `{error["code"]}`: {error["description"]}' for error in mint_token_payload["errors"] + f'* `{error["code"]}`: {error["description"]}' + for error in mint_token_payload["errors"] # noqa: W604 ) rendered_claims = _render_claims(oidc_token) @@ -159,7 +160,7 @@ def pypi_login() -> None: pypirc_filename = os.path.expanduser("~/.pypirc") if os.path.exists(pypirc_filename): - print(f"::info::{pypirc_filename} already exists; consider as already logged in.") + print(f"::info::{pypirc_filename} already exists; consider as already logged in.") # noqa: E702 return if "ACTIONS_ID_TOKEN_REQUEST_TOKEN" not in os.environ: diff --git a/c2cciutils/scripts/k8s/wait.py b/c2cciutils/scripts/k8s/wait.py index f9ec11b6b..b46bbe361 100644 --- a/c2cciutils/scripts/k8s/wait.py +++ b/c2cciutils/scripts/k8s/wait.py @@ -54,7 +54,7 @@ def _check_container_status(pod: Any, status: Any, is_init: bool = False) -> boo status_message = status_message.strip() if status_message == "Completed": return True - print(f'::group::Container not ready in {pod["metadata"]["name"]}: {status_message}') + print(f'::group::Container not ready in {pod["metadata"]["name"]}: {status_message}') # noqa: E713 if status_message_long != status_message: print(status_message_long) print(json.dumps(status, indent=4)) @@ -68,7 +68,7 @@ def _check_pod_status(pods: Any) -> bool: for condition in pod["status"].get("conditions", []): if not condition["status"]: print( - f'::group::Pod not ready in {pod["metadata"]["name"]}: {condition.get("message", condition["type"])}' + f'::group::Pod not ready in {pod["metadata"]["name"]}: {condition.get("message", condition["type"])}' # noqa: E713 ) print(json.dumps(condition, indent=4)) print("::endgroup::") diff --git a/c2cciutils/scripts/publish.py b/c2cciutils/scripts/publish.py index 3e66a9ac4..629c1828c 100644 --- a/c2cciutils/scripts/publish.py +++ b/c2cciutils/scripts/publish.py @@ -403,7 +403,7 @@ def main() -> None: for dpkg_package, package_version in versions_image.items(): if dpkg_package not in current_versions_in_images[image]: current_versions_in_images[image][dpkg_package] = str(package_version) - for dpkg_package in current_versions_in_images[image].keys(): + for dpkg_package in list(current_versions_in_images[image].keys()): if dpkg_package not in versions_image: del current_versions_in_images[image][dpkg_package] if dpkg_config_found: diff --git a/ci/dpkg-versions.yaml b/ci/dpkg-versions.yaml index 70ebdb7e8..f0eeecce1 100644 --- a/ci/dpkg-versions.yaml +++ b/ci/dpkg-versions.yaml @@ -1,205 +1,205 @@ -# See repository list: https://repology.org/repositories/statistics - camptocamp/c2cciutils:latest: - ubuntu_22_04/adduser: 3.118ubuntu5 - ubuntu_22_04/apt: 2.4.11 - ubuntu_22_04/apt-transport-https: 2.4.11 - ubuntu_22_04/base-passwd: 3.5.52build1 - ubuntu_22_04/bash: 5.1-6ubuntu1 - ubuntu_22_04/binutils: 2.38-4ubuntu2.3 - ubuntu_22_04/binutils-common: 2.38-4ubuntu2.3 - ubuntu_22_04/binutils-x86-64-linux-gnu: 2.38-4ubuntu2.3 - ubuntu_22_04/bsdutils: 1:2.37.2-4ubuntu3 - ubuntu_22_04/ca-certificates: 20230311ubuntu0.22.04.1 - ubuntu_22_04/coreutils: 8.32-4.1ubuntu1 - ubuntu_22_04/cpp: 4:11.2.0-1ubuntu1 - ubuntu_22_04/cpp-11: 11.4.0-1ubuntu1~22.04 - ubuntu_22_04/curl: 7.81.0-1ubuntu1.14 - ubuntu_22_04/dash: 0.5.11+git20210903+057cd650a4ed-3build1 - ubuntu_22_04/debconf: 1.5.79ubuntu1 - ubuntu_22_04/debianutils: 5.5-1ubuntu2 - ubuntu_22_04/diffutils: 1:3.8-0ubuntu2 - ubuntu_22_04/dirmngr: 2.2.27-3ubuntu2.1 - ubuntu_22_04/dpkg: 1.21.1ubuntu2.2 - ubuntu_22_04/e2fsprogs: 1.46.5-2ubuntu1.1 - ubuntu_22_04/findutils: 4.8.0-1ubuntu3 - ubuntu_22_04/gcc: 4:11.2.0-1ubuntu1 - ubuntu_22_04/gcc-11: 11.4.0-1ubuntu1~22.04 - ubuntu_22_04/gcc-11-base: 11.4.0-1ubuntu1~22.04 - ubuntu_22_04/gcc-12-base: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/git: 1:2.34.1-1ubuntu1.10 - ubuntu_22_04/git-man: 1:2.34.1-1ubuntu1.10 - ubuntu_22_04/gnupg: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gnupg-l10n: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gnupg-utils: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gpg: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gpg-agent: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gpg-wks-client: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gpg-wks-server: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gpgconf: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gpgsm: 2.2.27-3ubuntu2.1 - ubuntu_22_04/gpgv: 2.2.27-3ubuntu2.1 - ubuntu_22_04/grep: 3.7-1build1 - ubuntu_22_04/gzip: 1.10-4ubuntu4.1 - ubuntu_22_04/hostname: 3.23ubuntu2 - ubuntu_22_04/init-system-helpers: '1.62' - ubuntu_22_04/libacl1: 2.3.1-1 - ubuntu_22_04/libapt-pkg6.0: 2.4.11 - ubuntu_22_04/libasan6: 11.4.0-1ubuntu1~22.04 - ubuntu_22_04/libassuan0: 2.5.5-1build1 - ubuntu_22_04/libatomic1: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libattr1: 1:2.5.1-1build1 - ubuntu_22_04/libaudit-common: 1:3.0.7-1build1 - ubuntu_22_04/libaudit1: 1:3.0.7-1build1 - ubuntu_22_04/libbinutils: 2.38-4ubuntu2.3 - ubuntu_22_04/libblkid1: 2.37.2-4ubuntu3 - ubuntu_22_04/libbrotli1: 1.0.9-2build6 - ubuntu_22_04/libbz2-1.0: 1.0.8-5build1 - ubuntu_22_04/libc-bin: 2.35-0ubuntu3.4 - ubuntu_22_04/libc-dev-bin: 2.35-0ubuntu3.4 - ubuntu_22_04/libc6: 2.35-0ubuntu3.4 - ubuntu_22_04/libc6-dev: 2.35-0ubuntu3.4 - ubuntu_22_04/libcap-ng0: 0.7.9-2.2build3 - ubuntu_22_04/libcap2: 1:2.44-1ubuntu0.22.04.1 - ubuntu_22_04/libcc1-0: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libcom-err2: 1.46.5-2ubuntu1.1 - ubuntu_22_04/libcrypt-dev: 1:4.4.27-1 - ubuntu_22_04/libcrypt1: 1:4.4.27-1 - ubuntu_22_04/libctf-nobfd0: 2.38-4ubuntu2.3 - ubuntu_22_04/libctf0: 2.38-4ubuntu2.3 - ubuntu_22_04/libcurl3-gnutls: 7.81.0-1ubuntu1.14 - ubuntu_22_04/libcurl4: 7.81.0-1ubuntu1.14 - ubuntu_22_04/libdb5.3: 5.3.28+dfsg1-0.8ubuntu3 - ubuntu_22_04/libdebconfclient0: 0.261ubuntu1 - ubuntu_22_04/liberror-perl: 0.17029-1 - ubuntu_22_04/libexpat1: 2.4.7-1ubuntu0.2 - ubuntu_22_04/libexpat1-dev: 2.4.7-1ubuntu0.2 - ubuntu_22_04/libext2fs2: 1.46.5-2ubuntu1.1 - ubuntu_22_04/libffi8: 3.4.2-4 - ubuntu_22_04/libgcc-11-dev: 11.4.0-1ubuntu1~22.04 - ubuntu_22_04/libgcc-s1: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libgcrypt20: 1.9.4-3ubuntu3 - ubuntu_22_04/libgdbm-compat4: 1.23-1 - ubuntu_22_04/libgdbm6: 1.23-1 - ubuntu_22_04/libgmp10: 2:6.2.1+dfsg-3ubuntu1 - ubuntu_22_04/libgnutls30: 3.7.3-4ubuntu1.3 - ubuntu_22_04/libgomp1: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libgpg-error0: 1.43-3 - ubuntu_22_04/libgssapi-krb5-2: 1.19.2-2ubuntu0.3 - ubuntu_22_04/libhogweed6: 3.7.3-1build2 - ubuntu_22_04/libidn2-0: 2.3.2-2build1 - ubuntu_22_04/libisl23: 0.24-2build1 - ubuntu_22_04/libitm1: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libjs-jquery: 3.6.0+dfsg+~3.5.13-1 - ubuntu_22_04/libjs-sphinxdoc: 4.3.2-1 - ubuntu_22_04/libjs-underscore: 1.13.2~dfsg-2 - ubuntu_22_04/libk5crypto3: 1.19.2-2ubuntu0.3 - ubuntu_22_04/libkeyutils1: 1.6.1-2ubuntu3 - ubuntu_22_04/libkrb5-3: 1.19.2-2ubuntu0.3 - ubuntu_22_04/libkrb5support0: 1.19.2-2ubuntu0.3 - ubuntu_22_04/libksba8: 1.6.0-2ubuntu0.2 - ubuntu_22_04/libldap-2.5-0: 2.5.16+dfsg-0ubuntu0.22.04.1 - ubuntu_22_04/liblsan0: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/liblz4-1: 1.9.3-2build2 - ubuntu_22_04/liblzma5: 5.2.5-2ubuntu1 - ubuntu_22_04/libmagic-mgc: 1:5.41-3ubuntu0.1 - ubuntu_22_04/libmagic1: 1:5.41-3ubuntu0.1 - ubuntu_22_04/libmount1: 2.37.2-4ubuntu3 - ubuntu_22_04/libmpc3: 1.2.1-2build1 - ubuntu_22_04/libmpdec3: 2.5.1-2build2 - ubuntu_22_04/libmpfr6: 4.1.0-3build3 - ubuntu_22_04/libncurses6: 6.3-2ubuntu0.1 - ubuntu_22_04/libncursesw6: 6.3-2ubuntu0.1 - ubuntu_22_04/libnettle8: 3.7.3-1build2 - ubuntu_22_04/libnghttp2-14: 1.43.0-1ubuntu0.1 - ubuntu_22_04/libnpth0: 1.6-3build2 - ubuntu_22_04/libnsl-dev: 1.3.0-2build2 - ubuntu_22_04/libnsl2: 1.3.0-2build2 - ubuntu_22_04/libp11-kit0: 0.24.0-6build1 - ubuntu_22_04/libpam-modules: 1.4.0-11ubuntu2.3 - ubuntu_22_04/libpam-modules-bin: 1.4.0-11ubuntu2.3 - ubuntu_22_04/libpam-runtime: 1.4.0-11ubuntu2.3 - ubuntu_22_04/libpam0g: 1.4.0-11ubuntu2.3 - ubuntu_22_04/libpcre2-8-0: 10.39-3ubuntu0.1 - ubuntu_22_04/libpcre3: 2:8.39-13ubuntu0.22.04.1 - ubuntu_22_04/libperl5.34: 5.34.0-3ubuntu1.3 - ubuntu_22_04/libpq-dev: 14.9-0ubuntu0.22.04.1 - ubuntu_22_04/libpq5: 14.9-0ubuntu0.22.04.1 - ubuntu_22_04/libprocps8: 2:3.3.17-6ubuntu2.1 - ubuntu_22_04/libpsl5: 0.21.0-1.2build2 - ubuntu_22_04/libpython3-dev: 3.10.6-1~22.04 - ubuntu_22_04/libpython3-stdlib: 3.10.6-1~22.04 - ubuntu_22_04/libpython3.10: 3.10.12-1~22.04.3 - ubuntu_22_04/libpython3.10-dev: 3.10.12-1~22.04.3 - ubuntu_22_04/libpython3.10-minimal: 3.10.12-1~22.04.3 - ubuntu_22_04/libpython3.10-stdlib: 3.10.12-1~22.04.3 - ubuntu_22_04/libquadmath0: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libreadline8: 8.1.2-1 - ubuntu_22_04/librtmp1: 2.4+20151223.gitfa8646d.1-2build4 - ubuntu_22_04/libsasl2-2: 2.1.27+dfsg2-3ubuntu1.2 - ubuntu_22_04/libsasl2-modules-db: 2.1.27+dfsg2-3ubuntu1.2 - ubuntu_22_04/libseccomp2: 2.5.3-2ubuntu2 - ubuntu_22_04/libselinux1: 3.3-1build2 - ubuntu_22_04/libsemanage-common: 3.3-1build2 - ubuntu_22_04/libsemanage2: 3.3-1build2 - ubuntu_22_04/libsepol2: 3.3-1build1 - ubuntu_22_04/libsmartcols1: 2.37.2-4ubuntu3 - ubuntu_22_04/libsqlite3-0: 3.37.2-2ubuntu0.1 - ubuntu_22_04/libss2: 1.46.5-2ubuntu1.1 - ubuntu_22_04/libssh-4: 0.9.6-2ubuntu0.22.04.1 - ubuntu_22_04/libssl-dev: 3.0.2-0ubuntu1.12 - ubuntu_22_04/libssl3: 3.0.2-0ubuntu1.12 - ubuntu_22_04/libstdc++6: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libsystemd0: 249.11-0ubuntu3.11 - ubuntu_22_04/libtasn1-6: 4.18.0-4build1 - ubuntu_22_04/libtinfo6: 6.3-2ubuntu0.1 - ubuntu_22_04/libtirpc-common: 1.3.2-2ubuntu0.1 - ubuntu_22_04/libtirpc-dev: 1.3.2-2ubuntu0.1 - ubuntu_22_04/libtirpc3: 1.3.2-2ubuntu0.1 - ubuntu_22_04/libtsan0: 11.4.0-1ubuntu1~22.04 - ubuntu_22_04/libubsan1: 12.3.0-1ubuntu1~22.04 - ubuntu_22_04/libudev1: 249.11-0ubuntu3.11 - ubuntu_22_04/libunistring2: 1.0-1 - ubuntu_22_04/libuuid1: 2.37.2-4ubuntu3 - ubuntu_22_04/libxxhash0: 0.8.1-1 - ubuntu_22_04/libzstd1: 1.4.8+dfsg-3build1 - ubuntu_22_04/linux-libc-dev: 5.15.0-89.99 - ubuntu_22_04/login: 1:4.8.1-2ubuntu2.1 - ubuntu_22_04/logsave: 1.46.5-2ubuntu1.1 - ubuntu_22_04/lsb-base: 11.1.0ubuntu4 - ubuntu_22_04/mawk: 1.3.4.20200120-3 - ubuntu_22_04/media-types: 7.0.0 - ubuntu_22_04/mount: 2.37.2-4ubuntu3 - ubuntu_22_04/ncurses-base: 6.3-2ubuntu0.1 - ubuntu_22_04/ncurses-bin: 6.3-2ubuntu0.1 - ubuntu_22_04/nodejs: 16.20.2-deb-1nodesource1 - ubuntu_22_04/openssl: 3.0.2-0ubuntu1.12 - ubuntu_22_04/passwd: 1:4.8.1-2ubuntu2.1 - ubuntu_22_04/perl: 5.34.0-3ubuntu1.3 - ubuntu_22_04/perl-base: 5.34.0-3ubuntu1.3 - ubuntu_22_04/perl-modules-5.34: 5.34.0-3ubuntu1.3 - ubuntu_22_04/pinentry-curses: 1.1.1-1build2 - ubuntu_22_04/procps: 2:3.3.17-6ubuntu2.1 - ubuntu_22_04/python-is-python3: 3.9.2-2 - ubuntu_22_04/python3: 3.10.6-1~22.04 - ubuntu_22_04/python3-dev: 3.10.6-1~22.04 - ubuntu_22_04/python3-distutils: 3.10.8-1~22.04 - ubuntu_22_04/python3-lib2to3: 3.10.8-1~22.04 - ubuntu_22_04/python3-minimal: 3.10.6-1~22.04 - ubuntu_22_04/python3-pip: 22.0.2+dfsg-1ubuntu0.4 - ubuntu_22_04/python3-pkg-resources: 59.6.0-1.2ubuntu0.22.04.1 - ubuntu_22_04/python3-setuptools: 59.6.0-1.2ubuntu0.22.04.1 - ubuntu_22_04/python3-wheel: 0.37.1-2ubuntu0.22.04.1 - ubuntu_22_04/python3.10: 3.10.12-1~22.04.3 - ubuntu_22_04/python3.10-dev: 3.10.12-1~22.04.3 - ubuntu_22_04/python3.10-minimal: 3.10.12-1~22.04.3 - ubuntu_22_04/readline-common: 8.1.2-1 - ubuntu_22_04/rpcsvc-proto: 1.4.2-0ubuntu6 - ubuntu_22_04/sed: 4.8-1ubuntu2 - ubuntu_22_04/sensible-utils: 0.0.17 - ubuntu_22_04/sysvinit-utils: 3.01-1ubuntu1 - ubuntu_22_04/tar: 1.34+dfsg-1ubuntu0.1.22.04.1 - ubuntu_22_04/ubuntu-keyring: 2021.03.26 - ubuntu_22_04/usrmerge: 25ubuntu2 - ubuntu_22_04/util-linux: 2.37.2-4ubuntu3 - ubuntu_22_04/zlib1g: 1:1.2.11.dfsg-2ubuntu9.2 + ubuntu_24_04/adduser: 3.137ubuntu1 + ubuntu_24_04/apt: 2.7.14build2 + ubuntu_24_04/apt-transport-https: 2.7.14build2 + ubuntu_24_04/apt-utils: 2.7.14build2 + ubuntu_24_04/base-passwd: 3.6.3build1 + ubuntu_24_04/bash: 5.2.21-2ubuntu4 + ubuntu_24_04/binutils: 2.42-4ubuntu2 + ubuntu_24_04/binutils-common: 2.42-4ubuntu2 + ubuntu_24_04/binutils-x86-64-linux-gnu: 2.42-4ubuntu2 + ubuntu_24_04/bsdutils: 1:2.39.3-9ubuntu6.1 + ubuntu_24_04/ca-certificates: '20240203' + ubuntu_24_04/coreutils: 9.4-3ubuntu6 + ubuntu_24_04/cpp: 4:13.2.0-7ubuntu1 + ubuntu_24_04/cpp-13: 13.2.0-23ubuntu4 + ubuntu_24_04/cpp-13-x86-64-linux-gnu: 13.2.0-23ubuntu4 + ubuntu_24_04/cpp-x86-64-linux-gnu: 4:13.2.0-7ubuntu1 + ubuntu_24_04/curl: 8.5.0-2ubuntu10.4 + ubuntu_24_04/dash: 0.5.12-6ubuntu5 + ubuntu_24_04/debconf: 1.5.86ubuntu1 + ubuntu_24_04/debianutils: 5.17build1 + ubuntu_24_04/diffutils: 1:3.10-1build1 + ubuntu_24_04/dirmngr: 2.4.4-2ubuntu17 + ubuntu_24_04/dpkg: 1.22.6ubuntu6.1 + ubuntu_24_04/e2fsprogs: 1.47.0-2.4~exp1ubuntu4.1 + ubuntu_24_04/findutils: 4.9.0-5build1 + ubuntu_24_04/gcc: 4:13.2.0-7ubuntu1 + ubuntu_24_04/gcc-13: 13.2.0-23ubuntu4 + ubuntu_24_04/gcc-13-base: 13.2.0-23ubuntu4 + ubuntu_24_04/gcc-13-x86-64-linux-gnu: 13.2.0-23ubuntu4 + ubuntu_24_04/gcc-14-base: 14-20240412-0ubuntu1 + ubuntu_24_04/gcc-x86-64-linux-gnu: 4:13.2.0-7ubuntu1 + ubuntu_24_04/git: 1:2.43.0-1ubuntu7.1 + ubuntu_24_04/git-man: 1:2.43.0-1ubuntu7.1 + ubuntu_24_04/gnupg: 2.4.4-2ubuntu17 + ubuntu_24_04/gnupg-utils: 2.4.4-2ubuntu17 + ubuntu_24_04/gpg: 2.4.4-2ubuntu17 + ubuntu_24_04/gpg-agent: 2.4.4-2ubuntu17 + ubuntu_24_04/gpgconf: 2.4.4-2ubuntu17 + ubuntu_24_04/gpgsm: 2.4.4-2ubuntu17 + ubuntu_24_04/gpgv: 2.4.4-2ubuntu17 + ubuntu_24_04/grep: 3.11-4build1 + ubuntu_24_04/gzip: 1.12-1ubuntu3 + ubuntu_24_04/hostname: 3.23+nmu2ubuntu2 + ubuntu_24_04/init-system-helpers: 1.66ubuntu1 + ubuntu_24_04/keyboxd: 2.4.4-2ubuntu17 + ubuntu_24_04/libacl1: 2.3.2-1build1 + ubuntu_24_04/libapt-pkg6.0t64: 2.7.14build2 + ubuntu_24_04/libasan8: 14-20240412-0ubuntu1 + ubuntu_24_04/libassuan0: 2.5.6-1build1 + ubuntu_24_04/libatomic1: 14-20240412-0ubuntu1 + ubuntu_24_04/libattr1: 1:2.5.2-1build1 + ubuntu_24_04/libaudit-common: 1:3.1.2-2.1build1 + ubuntu_24_04/libaudit1: 1:3.1.2-2.1build1 + ubuntu_24_04/libbinutils: 2.42-4ubuntu2 + ubuntu_24_04/libblkid1: 2.39.3-9ubuntu6.1 + ubuntu_24_04/libbrotli1: 1.1.0-2build2 + ubuntu_24_04/libbz2-1.0: 1.0.8-5.1build0.1 + ubuntu_24_04/libc-bin: 2.39-0ubuntu8.3 + ubuntu_24_04/libc-dev-bin: 2.39-0ubuntu8.3 + ubuntu_24_04/libc6: 2.39-0ubuntu8.3 + ubuntu_24_04/libc6-dev: 2.39-0ubuntu8.3 + ubuntu_24_04/libcap-ng0: 0.8.4-2build2 + ubuntu_24_04/libcap2: 1:2.66-5ubuntu2 + ubuntu_24_04/libcc1-0: 14-20240412-0ubuntu1 + ubuntu_24_04/libcom-err2: 1.47.0-2.4~exp1ubuntu4.1 + ubuntu_24_04/libcrypt-dev: 1:4.4.36-4build1 + ubuntu_24_04/libcrypt1: 1:4.4.36-4build1 + ubuntu_24_04/libctf-nobfd0: 2.42-4ubuntu2 + ubuntu_24_04/libctf0: 2.42-4ubuntu2 + ubuntu_24_04/libcurl3t64-gnutls: 8.5.0-2ubuntu10.4 + ubuntu_24_04/libcurl4t64: 8.5.0-2ubuntu10.4 + ubuntu_24_04/libdb5.3t64: 5.3.28+dfsg2-7 + ubuntu_24_04/libdebconfclient0: 0.271ubuntu3 + ubuntu_24_04/liberror-perl: 0.17029-2 + ubuntu_24_04/libexpat1: 2.6.1-2ubuntu0.1 + ubuntu_24_04/libexpat1-dev: 2.6.1-2ubuntu0.1 + ubuntu_24_04/libext2fs2t64: 1.47.0-2.4~exp1ubuntu4.1 + ubuntu_24_04/libffi8: 3.4.6-1build1 + ubuntu_24_04/libgcc-13-dev: 13.2.0-23ubuntu4 + ubuntu_24_04/libgcc-s1: 14-20240412-0ubuntu1 + ubuntu_24_04/libgcrypt20: 1.10.3-2build1 + ubuntu_24_04/libgdbm-compat4t64: 1.23-5.1build1 + ubuntu_24_04/libgdbm6t64: 1.23-5.1build1 + ubuntu_24_04/libgmp10: 2:6.3.0+dfsg-2ubuntu6 + ubuntu_24_04/libgnutls30t64: 3.8.3-1.1ubuntu3.2 + ubuntu_24_04/libgomp1: 14-20240412-0ubuntu1 + ubuntu_24_04/libgpg-error0: 1.47-3build2 + ubuntu_24_04/libgprofng0: 2.42-4ubuntu2 + ubuntu_24_04/libgssapi-krb5-2: 1.20.1-6ubuntu2.1 + ubuntu_24_04/libhogweed6t64: 3.9.1-2.2build1.1 + ubuntu_24_04/libhwasan0: 14-20240412-0ubuntu1 + ubuntu_24_04/libidn2-0: 2.3.7-2build1 + ubuntu_24_04/libisl23: 0.26-3build1 + ubuntu_24_04/libitm1: 14-20240412-0ubuntu1 + ubuntu_24_04/libjansson4: 2.14-2build2 + ubuntu_24_04/libjs-jquery: 3.6.1+dfsg+~3.5.14-1 + ubuntu_24_04/libjs-sphinxdoc: 7.2.6-6 + ubuntu_24_04/libjs-underscore: 1.13.4~dfsg+~1.11.4-3 + ubuntu_24_04/libk5crypto3: 1.20.1-6ubuntu2.1 + ubuntu_24_04/libkeyutils1: 1.6.3-3build1 + ubuntu_24_04/libkrb5-3: 1.20.1-6ubuntu2.1 + ubuntu_24_04/libkrb5support0: 1.20.1-6ubuntu2.1 + ubuntu_24_04/libksba8: 1.6.6-1build1 + ubuntu_24_04/libldap2: 2.6.7+dfsg-1~exp1ubuntu8 + ubuntu_24_04/liblsan0: 14-20240412-0ubuntu1 + ubuntu_24_04/liblz4-1: 1.9.4-1build1.1 + ubuntu_24_04/liblzma5: 5.6.1+really5.4.5-1build0.1 + ubuntu_24_04/libmagic-mgc: 1:5.45-3build1 + ubuntu_24_04/libmagic1t64: 1:5.45-3build1 + ubuntu_24_04/libmd0: 1.1.0-2build1 + ubuntu_24_04/libmount1: 2.39.3-9ubuntu6.1 + ubuntu_24_04/libmpc3: 1.3.1-1build1 + ubuntu_24_04/libmpfr6: 4.2.1-1build1 + ubuntu_24_04/libncursesw6: 6.4+20240113-1ubuntu2 + ubuntu_24_04/libnettle8t64: 3.9.1-2.2build1.1 + ubuntu_24_04/libnghttp2-14: 1.59.0-1ubuntu0.1 + ubuntu_24_04/libnpth0t64: 1.6-3.1build1 + ubuntu_24_04/libp11-kit0: 0.25.3-4ubuntu2.1 + ubuntu_24_04/libpam-modules: 1.5.3-5ubuntu5.1 + ubuntu_24_04/libpam-modules-bin: 1.5.3-5ubuntu5.1 + ubuntu_24_04/libpam-runtime: 1.5.3-5ubuntu5.1 + ubuntu_24_04/libpam0g: 1.5.3-5ubuntu5.1 + ubuntu_24_04/libpcre2-8-0: 10.42-4ubuntu2 + ubuntu_24_04/libperl5.38t64: 5.38.2-3.2build2 + ubuntu_24_04/libpq-dev: 16.4-0ubuntu0.24.04.2 + ubuntu_24_04/libpq5: 16.4-0ubuntu0.24.04.2 + ubuntu_24_04/libproc2-0: 2:4.0.4-4ubuntu3.1 + ubuntu_24_04/libpsl5t64: 0.21.2-1.1build1 + ubuntu_24_04/libpython3-dev: 3.12.3-0ubuntu2 + ubuntu_24_04/libpython3-stdlib: 3.12.3-0ubuntu2 + ubuntu_24_04/libpython3.12-dev: 3.12.3-1ubuntu0.2 + ubuntu_24_04/libpython3.12-minimal: 3.12.3-1ubuntu0.2 + ubuntu_24_04/libpython3.12-stdlib: 3.12.3-1ubuntu0.2 + ubuntu_24_04/libpython3.12t64: 3.12.3-1ubuntu0.2 + ubuntu_24_04/libquadmath0: 14-20240412-0ubuntu1 + ubuntu_24_04/libreadline8t64: 8.2-4build1 + ubuntu_24_04/librtmp1: 2.4+20151223.gitfa8646d.1-2build7 + ubuntu_24_04/libsasl2-2: 2.1.28+dfsg1-5ubuntu3.1 + ubuntu_24_04/libsasl2-modules-db: 2.1.28+dfsg1-5ubuntu3.1 + ubuntu_24_04/libseccomp2: 2.5.5-1ubuntu3.1 + ubuntu_24_04/libselinux1: 3.5-2ubuntu2 + ubuntu_24_04/libsemanage-common: 3.5-1build5 + ubuntu_24_04/libsemanage2: 3.5-1build5 + ubuntu_24_04/libsepol2: 3.5-2build1 + ubuntu_24_04/libsframe1: 2.42-4ubuntu2 + ubuntu_24_04/libsmartcols1: 2.39.3-9ubuntu6.1 + ubuntu_24_04/libsqlite3-0: 3.45.1-1ubuntu2 + ubuntu_24_04/libss2: 1.47.0-2.4~exp1ubuntu4.1 + ubuntu_24_04/libssh-4: 0.10.6-2build2 + ubuntu_24_04/libssl-dev: 3.0.13-0ubuntu3.4 + ubuntu_24_04/libssl3t64: 3.0.13-0ubuntu3.4 + ubuntu_24_04/libstdc++6: 14-20240412-0ubuntu1 + ubuntu_24_04/libsystemd0: 255.4-1ubuntu8.4 + ubuntu_24_04/libtasn1-6: 4.19.0-3build1 + ubuntu_24_04/libtinfo6: 6.4+20240113-1ubuntu2 + ubuntu_24_04/libtsan2: 14-20240412-0ubuntu1 + ubuntu_24_04/libubsan1: 14-20240412-0ubuntu1 + ubuntu_24_04/libudev1: 255.4-1ubuntu8.4 + ubuntu_24_04/libunistring5: 1.1-2build1 + ubuntu_24_04/libuuid1: 2.39.3-9ubuntu6.1 + ubuntu_24_04/libxxhash0: 0.8.2-2build1 + ubuntu_24_04/libzstd1: 1.5.5+dfsg2-2build1.1 + ubuntu_24_04/linux-libc-dev: 6.8.0-45.45 + ubuntu_24_04/login: 1:4.13+dfsg1-4ubuntu3.2 + ubuntu_24_04/logsave: 1.47.0-2.4~exp1ubuntu4.1 + ubuntu_24_04/mawk: 1.3.4.20240123-1build1 + ubuntu_24_04/media-types: 10.1.0 + ubuntu_24_04/mount: 2.39.3-9ubuntu6.1 + ubuntu_24_04/ncurses-base: 6.4+20240113-1ubuntu2 + ubuntu_24_04/ncurses-bin: 6.4+20240113-1ubuntu2 + ubuntu_24_04/netbase: '6.4' + ubuntu_24_04/nodejs: 20.18.0-1nodesource1 + ubuntu_24_04/openssl: 3.0.13-0ubuntu3.4 + ubuntu_24_04/passwd: 1:4.13+dfsg1-4ubuntu3.2 + ubuntu_24_04/perl: 5.38.2-3.2build2 + ubuntu_24_04/perl-base: 5.38.2-3.2build2 + ubuntu_24_04/perl-modules-5.38: 5.38.2-3.2build2 + ubuntu_24_04/pinentry-curses: 1.2.1-3ubuntu5 + ubuntu_24_04/procps: 2:4.0.4-4ubuntu3.1 + ubuntu_24_04/python-is-python3: 3.11.4-1 + ubuntu_24_04/python3: 3.12.3-0ubuntu2 + ubuntu_24_04/python3-dev: 3.12.3-0ubuntu2 + ubuntu_24_04/python3-minimal: 3.12.3-0ubuntu2 + ubuntu_24_04/python3-pip: 24.0+dfsg-1ubuntu1 + ubuntu_24_04/python3-pip-whl: 24.0+dfsg-1ubuntu1 + ubuntu_24_04/python3-pkg-resources: 68.1.2-2ubuntu1.1 + ubuntu_24_04/python3-setuptools: 68.1.2-2ubuntu1.1 + ubuntu_24_04/python3-setuptools-whl: 68.1.2-2ubuntu1.1 + ubuntu_24_04/python3-venv: 3.12.3-0ubuntu2 + ubuntu_24_04/python3-wheel: 0.42.0-2 + ubuntu_24_04/python3.12: 3.12.3-1ubuntu0.2 + ubuntu_24_04/python3.12-dev: 3.12.3-1ubuntu0.2 + ubuntu_24_04/python3.12-minimal: 3.12.3-1ubuntu0.2 + ubuntu_24_04/python3.12-venv: 3.12.3-1ubuntu0.2 + ubuntu_24_04/readline-common: 8.2-4build1 + ubuntu_24_04/rpcsvc-proto: 1.4.2-0ubuntu7 + ubuntu_24_04/sed: 4.9-2build1 + ubuntu_24_04/sensible-utils: 0.0.22 + ubuntu_24_04/sysvinit-utils: 3.08-6ubuntu3 + ubuntu_24_04/tar: 1.35+dfsg-3build1 + ubuntu_24_04/tzdata: 2024a-3ubuntu1.1 + ubuntu_24_04/ubuntu-keyring: 2023.11.28.1 + ubuntu_24_04/util-linux: 2.39.3-9ubuntu6.1 + ubuntu_24_04/zlib1g: 1:1.3.dfsg-3.1ubuntu2.1 diff --git a/example-project/Dockerfile b/example-project/Dockerfile index 80de7cedc..1206ae9d8 100644 --- a/example-project/Dockerfile +++ b/example-project/Dockerfile @@ -1,16 +1,21 @@ -FROM ubuntu:22.04 AS base-all -LABEL maintainer Camptocamp "info@camptocamp.com" +FROM ubuntu:24.04 AS base-all +LABEL maintainer='Camptocamp "info@camptocamp.com"' SHELL ["/bin/bash", "-o", "pipefail", "-cux"] RUN --mount=type=cache,target=/var/lib/apt/lists \ --mount=type=cache,target=/var/cache,sharing=locked \ - sed -i '/-backports /d' /etc/apt/sources.list \ - && apt-get update \ - && apt-get install --yes --no-install-recommends python3-pip binutils + apt-get update \ + && apt-get upgrade --yes \ + && apt-get install --yes --no-install-recommends apt-utils \ + && DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --yes tzdata \ + && apt-get install --yes --no-install-recommends binutils python3-pip python3-venv \ + && python3 -m venv /venv + +ENV PATH=/venv/bin:$PATH # Used to convert the locked packages by poetry to pip requirements format # We don't directly use `poetry install` because it force to use a virtual environment. -FROM base-all as poetry +FROM base-all AS poetry # Install Poetry WORKDIR /tmp @@ -25,7 +30,7 @@ RUN poetry export --output=requirements.txt \ && poetry export --with=dev --output=requirements-dev.txt # Base, the biggest thing is to install the Python packages -FROM base-all as base +FROM base-all AS base WORKDIR /app diff --git a/example-project/poetry.lock b/example-project/poetry.lock index 3d83a3f31..b2aefbe71 100644 --- a/example-project/poetry.lock +++ b/example-project/poetry.lock @@ -632,7 +632,11 @@ files = [ [package.dependencies] astroid = ">=3.3.4,<=3.4.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = {version = ">=0.2", markers = "python_version < \"3.11\""} +dill = [ + {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, +] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" platformdirs = ">=2.2.0" @@ -1031,5 +1035,5 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" -python-versions = ">=3.10,<3.11" -content-hash = "47f7e383f3d4b1fca29bdfdd4ed115f570109e8b074946b8aa05f223c1befd96" +python-versions = ">=3.10,<3.13" +content-hash = "b29447ffdbe2f7c6aa27148aa3e547aee63fa04d519594a2915f099517bf8196" diff --git a/example-project/pyproject.toml b/example-project/pyproject.toml index a87a1e04e..1a9ff6a15 100644 --- a/example-project/pyproject.toml +++ b/example-project/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ include = ["project/py.typed"] [tool.poetry.dependencies] -python = ">=3.10,<3.11" +python = ">=3.10,<3.13" [tool.poetry.group.dev.dependencies] prospector = { version = "1.12.0", extras = ["with_bandit", "with_mypy", "with_pyroma"] }