diff --git a/.copier-answers.yml b/.copier-answers.yml index ec428c8e..db48cd27 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ # Autogenerated. Do not edit this by hand, use `copier update`. --- -_commit: 0.7.3 +_commit: 0.7.4 _src_path: https://github.com/lkubb/salt-extension-copier author: EITR Technologies, LLC author_email: devops@eitr.tech diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67f8c257..7680ffa9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,7 @@ jobs: steps: - name: Download Exit Status Files if: always() - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: exitstatus pattern: exitstatus-* diff --git a/.github/workflows/deploy-docs-action.yml b/.github/workflows/deploy-docs-action.yml index 566d1af0..afa62ae5 100644 --- a/.github/workflows/deploy-docs-action.yml +++ b/.github/workflows/deploy-docs-action.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Download built docs - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: ${{ inputs.artifact-name }} path: html-docs diff --git a/.github/workflows/deploy-package-action.yml b/.github/workflows/deploy-package-action.yml index 230e4b07..ba633811 100644 --- a/.github/workflows/deploy-package-action.yml +++ b/.github/workflows/deploy-package-action.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Download Python Package Artifacts - uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: name: salt-extension-${{ inputs.version }}-packages path: dist diff --git a/.github/workflows/docs-action.yml b/.github/workflows/docs-action.yml index ca98e197..d735b011 100644 --- a/.github/workflows/docs-action.yml +++ b/.github/workflows/docs-action.yml @@ -15,7 +15,7 @@ jobs: fetch-depth: 0 - name: Set up Python 3.10 For Nox - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.10" @@ -25,7 +25,7 @@ jobs: pip install "nox==$NOX_VERSION" "uv==$UV_VERSION" env: NOX_VERSION: '2025.2.9' - UV_VERSION: '0.6.10' + UV_VERSION: '0.6.15' - name: Install Doc Requirements run: | diff --git a/.github/workflows/package-action.yml b/.github/workflows/package-action.yml index 6295819e..9e6a3ae3 100644 --- a/.github/workflows/package-action.yml +++ b/.github/workflows/package-action.yml @@ -19,7 +19,7 @@ jobs: fetch-depth: 0 - name: Set up Python 3.10 - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.10" diff --git a/.github/workflows/pre-commit-action.yml b/.github/workflows/pre-commit-action.yml index 6461992b..d2bce7f5 100644 --- a/.github/workflows/pre-commit-action.yml +++ b/.github/workflows/pre-commit-action.yml @@ -14,7 +14,7 @@ jobs: name: Pre-Commit runs-on: ubuntu-24.04 container: - image: 'docker.io/library/python:3.10.16-slim-bookworm@sha256:06f6d69d229bb55fab83dded514e54eede977e33e92d855ba3f97ce0e3234abc' + image: 'docker.io/library/python:3.10.17-slim-bookworm@sha256:57038683f4a259e17fcff1ccef7ba30b1065f4b3317dabb5bd7c82640a5ed64f' steps: - name: Install System Deps diff --git a/.github/workflows/prepare-release-action.yml b/.github/workflows/prepare-release-action.yml index 1a33c396..99a9bce9 100644 --- a/.github/workflows/prepare-release-action.yml +++ b/.github/workflows/prepare-release-action.yml @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python 3.10 - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: '3.10' diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 6fe26d58..bae38711 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -25,7 +25,7 @@ jobs: fetch-depth: 2 # coverage: Issue detecting commit SHA - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} @@ -35,7 +35,7 @@ jobs: pip install "nox==$NOX_VERSION" "uv==$UV_VERSION" env: NOX_VERSION: '2025.2.9' - UV_VERSION: '0.6.10' + UV_VERSION: '0.6.15' - name: Install Test Requirements env: @@ -57,7 +57,7 @@ jobs: echo "flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")" >> "$GITHUB_OUTPUT" - name: Upload Project Code Coverage - uses: codecov/codecov-action@e96185f4044c2f0cedf0f022454acf9811cf8057 # v5.4.0 + uses: codecov/codecov-action@1f60566a86da84c4b4b64c17662a90de97fbb8d7 # v5.4.2 with: files: artifacts/coverage-project.xml disable_search: true @@ -65,10 +65,10 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},project name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project use_oidc: true - version: v10.3.0 + version: v10.4.0 - name: Upload Tests Code Coverage - uses: codecov/codecov-action@e96185f4044c2f0cedf0f022454acf9811cf8057 # v5.4.0 + uses: codecov/codecov-action@1f60566a86da84c4b4b64c17662a90de97fbb8d7 # v5.4.2 with: files: artifacts/coverage-tests.xml disable_search: true @@ -76,7 +76,7 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},tests name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests use_oidc: true - version: v10.3.0 + version: v10.4.0 - name: Upload Logs if: always() @@ -117,7 +117,7 @@ jobs: fetch-depth: 2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} @@ -127,7 +127,7 @@ jobs: pip install "nox==$env:NOX_VERSION" "uv==$env:UV_VERSION" env: NOX_VERSION: '2025.2.9' - UV_VERSION: '0.6.10' + UV_VERSION: '0.6.15' - name: Install Test Requirements shell: bash @@ -154,7 +154,7 @@ jobs: echo "flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")" >> "$GITHUB_OUTPUT" - name: Upload Project Code Coverage - uses: codecov/codecov-action@e96185f4044c2f0cedf0f022454acf9811cf8057 # v5.4.0 + uses: codecov/codecov-action@1f60566a86da84c4b4b64c17662a90de97fbb8d7 # v5.4.2 with: files: artifacts/coverage-project.xml disable_search: true @@ -162,10 +162,10 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},project name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project use_oidc: true - version: v10.3.0 + version: v10.4.0 - name: Upload Tests Code Coverage - uses: codecov/codecov-action@e96185f4044c2f0cedf0f022454acf9811cf8057 # v5.4.0 + uses: codecov/codecov-action@1f60566a86da84c4b4b64c17662a90de97fbb8d7 # v5.4.2 with: files: artifacts/coverage-tests.xml disable_search: true @@ -173,7 +173,7 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},tests name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests use_oidc: true - version: v10.3.0 + version: v10.4.0 - name: Upload Logs if: always() @@ -214,7 +214,7 @@ jobs: fetch-depth: 2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} @@ -224,7 +224,7 @@ jobs: pip install "nox==$NOX_VERSION" "uv==$UV_VERSION" env: NOX_VERSION: '2025.2.9' - UV_VERSION: '0.6.10' + UV_VERSION: '0.6.15' - name: Install Test Requirements env: @@ -246,7 +246,7 @@ jobs: echo "flags=$(python -c "import sys; print('{},{},salt_{}'.format('${{ runner.os }}'.replace('-latest', ''), 'py{}{}'.format(*sys.version_info), '_'.join(str(v) for v in '${{ matrix.salt-version }}'.replace('==', '_').split('.'))))")" >> "$GITHUB_OUTPUT" - name: Upload Project Code Coverage - uses: codecov/codecov-action@e96185f4044c2f0cedf0f022454acf9811cf8057 # v5.4.0 + uses: codecov/codecov-action@1f60566a86da84c4b4b64c17662a90de97fbb8d7 # v5.4.2 with: files: artifacts/coverage-project.xml disable_search: true @@ -254,10 +254,10 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},project name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project use_oidc: true - version: v10.3.0 + version: v10.4.0 - name: Upload Tests Code Coverage - uses: codecov/codecov-action@e96185f4044c2f0cedf0f022454acf9811cf8057 # v5.4.0 + uses: codecov/codecov-action@1f60566a86da84c4b4b64c17662a90de97fbb8d7 # v5.4.2 with: files: artifacts/coverage-tests.xml disable_search: true @@ -265,7 +265,7 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},tests name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests use_oidc: true - version: v10.3.0 + version: v10.4.0 - name: Upload Logs if: always() diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ff323f3..b4c96fb1 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -124,7 +124,7 @@ repos: require_serial: true additional_dependencies: - nox==2025.2.9 - - uv==0.6.10 # Makes this hook much faster + - uv==0.6.15 # Makes this hook much faster - id: nox alias: lint-tests @@ -135,7 +135,7 @@ repos: require_serial: true additional_dependencies: - nox==2025.2.9 - - uv==0.6.10 # Makes this hook much faster + - uv==0.6.15 # Makes this hook much faster - repo: https://github.com/Mateusz-Grzelinski/actionlint-py rev: a185be0fd5b45112845b700d91b81050c75579e2 # v1.7.7.23 diff --git a/noxfile.py b/noxfile.py index ee24e4a4..0dad5ee7 100755 --- a/noxfile.py +++ b/noxfile.py @@ -31,7 +31,7 @@ SKIP_REQUIREMENTS_INSTALL = os.environ.get("SKIP_REQUIREMENTS_INSTALL", "0") == "1" EXTRA_REQUIREMENTS_INSTALL = os.environ.get("EXTRA_REQUIREMENTS_INSTALL") -COVERAGE_REQUIREMENT = os.environ.get("COVERAGE_REQUIREMENT") or "coverage==7.7.1" +COVERAGE_REQUIREMENT = os.environ.get("COVERAGE_REQUIREMENT") or "coverage==7.8.0" SALT_REQUIREMENT = os.environ.get("SALT_REQUIREMENT") or "salt>=3006" if SALT_REQUIREMENT == "salt==master": SALT_REQUIREMENT = "git+https://github.com/saltstack/salt.git@master" @@ -98,7 +98,20 @@ def _install_requirements( session.install(no_progress, COVERAGE_REQUIREMENT, silent=PIP_INSTALL_SILENT) if install_salt: - session.install(no_progress, SALT_REQUIREMENT, silent=PIP_INSTALL_SILENT) + # Salt does not publish wheels and setuptools 75.6.0+ breaks requirements inclusion during builds, + # so we need to constrain setuptools in the build environment. uv reads this from + # pyproject.toml, but pip has no equivalent behavior. + # We need delete=False for Windows. delete_on_close would work, but is Python 3.12+ only. + with tempfile.NamedTemporaryFile(delete=False) as constraints_file: + setuptools_constraint = "setuptools<75.6.0" + constraints_file.write(setuptools_constraint.encode()) + env = { + "PIP_CONSTRAINT": constraints_file.name, + } + try: + session.install(no_progress, SALT_REQUIREMENT, silent=PIP_INSTALL_SILENT, env=env) + finally: + os.unlink(constraints_file.name) if install_test_requirements: install_extras.append("tests") diff --git a/pyproject.toml b/pyproject.toml index 78341b8f..04be368c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ Tracker = "https://github.com/salt-extensions/saltext-github/issues" [project.optional-dependencies] changelog = ["towncrier==24.8.0"] dev = [ - "nox[uv]>=2024.3", + "nox[uv]>=2024.3,!=2025.05.01", "pre-commit>=2.21.0", ] # These dependencies are used in automations. It can be helpful @@ -61,7 +61,7 @@ dev = [ dev_extra = [ "black==25.1.0", "isort==6.0.1", - "coverage==7.7.1", + "coverage==7.8.0", ] docs = [ "sphinx", diff --git a/tools/helpers/venv.py b/tools/helpers/venv.py index 3c0b9652..fc018188 100644 --- a/tools/helpers/venv.py +++ b/tools/helpers/venv.py @@ -1,3 +1,4 @@ +import tempfile from pathlib import Path from . import prompt @@ -91,7 +92,16 @@ def ensure_project_venv(project_root=".", reinstall=True, install_extras=False): # It speeds up this step a lot. local["uv"]("pip", "install", "-e", f".[{','.join(extras)}]") except CommandNotFound: - local["python"]("-m", "pip", "install", "-e", f".[{','.join(extras)}]") + # Salt does not build correctly with setuptools >= 75.6.0. + # uv reads this constraint from pyproject.toml, but pip needs this workaround. + with tempfile.NamedTemporaryFile(delete=False) as constraints_file: + setuptools_constraint = "setuptools<75.6.0" + constraints_file.write(setuptools_constraint.encode()) + try: + with local.env(PIP_CONSTRAINT=constraints_file.name): + local["python"]("-m", "pip", "install", "-e", f".[{','.join(extras)}]") + finally: + Path(constraints_file.name).unlink() if not exists or not (Path(project_root) / ".git" / "hooks" / "pre-commit").exists(): prompt.status("Installing pre-commit hooks") local["python"]("-m", "pre_commit", "install", "--install-hooks")