Skip to content

Commit bd4bebd

Browse files
JonZeollaclaude
andcommitted
fix(ci): clean up CI warnings and update Node.js 20 deprecated actions
- Bump actions/cache v4->v5, upload-artifact v5->v7, setup-uv v4->v7, setup-task v1->v2 to resolve Node.js 20 deprecation warnings - Remove pointless --cov addopts from root pyproject.toml (ai_native_python package only has __init__.py metadata, causing "No data collected" warning) - Add --source-name and --source-version to syft SBOM command to suppress "no explicit name and version" warning - Redirect stderr on docker buildx inspect to suppress expected ERROR when multiplatform builder doesn't exist yet - Register missing pytest.mark.slow marker in template pyproject.toml - Fix argparse prog name in template main.py (showed "main.py" instead of package name in --version output) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bf8ebc8 commit bd4bebd

10 files changed

Lines changed: 27 additions & 22 deletions

File tree

.github/actions/bootstrap/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ runs:
3232
echo "run_script=uv run --frozen" | Tee-Object -Append $env:GITHUB_ENV
3333
3434
- name: Setup uv
35-
uses: astral-sh/setup-uv@v4
35+
uses: astral-sh/setup-uv@v7
3636
with:
3737
enable-cache: true
3838
cache-dependency-glob: "**/uv.lock"
3939
python-version: ${{ inputs.python-version }}
4040

4141
- name: Install Task
42-
uses: go-task/setup-task@v1
42+
uses: go-task/setup-task@v2
4343
with:
4444
# Passing a repo token reduces the likelihood of API rate limit exceeded
4545
repo-token: ${{ inputs.token }}
@@ -102,7 +102,7 @@ runs:
102102
echo "PY=$hash" | Tee-Object -Append $env:GITHUB_ENV
103103
104104
- name: Cache pre-commit environments
105-
uses: actions/cache@v4
105+
uses: actions/cache@v5
106106
with:
107107
path: ~/.cache/pre-commit
108108
key: pre-commit|${{ env.PY }}|${{ hashFiles(format('{0}/.pre-commit-config.yaml', inputs.working-directory)) }}

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Run SBOM generation
8181
run: task -v sbom
8282
- name: Upload SBOM artifacts
83-
uses: actions/upload-artifact@v5
83+
uses: actions/upload-artifact@v7
8484
with:
8585
name: sbom-files
8686
path: |
@@ -89,15 +89,15 @@ jobs:
8989
- name: Check license compliance
9090
run: task -v license-check
9191
- name: Upload license check results
92-
uses: actions/upload-artifact@v5
92+
uses: actions/upload-artifact@v7
9393
with:
9494
name: license-check-results
9595
path: license-check.json
9696
if-no-files-found: error
9797
- name: Run vulnerability scan
9898
run: task -v vulnscan
9999
- name: Upload vulnerability scan results
100-
uses: actions/upload-artifact@v5
100+
uses: actions/upload-artifact@v7
101101
with:
102102
name: vuln-scan-results
103103
path: vulns.json
@@ -111,11 +111,11 @@ jobs:
111111
# out the repo on Windows. Instead, cookiecutter fetches the template
112112
# directly from the remote branch.
113113
- name: Setup uv
114-
uses: astral-sh/setup-uv@v4
114+
uses: astral-sh/setup-uv@v7
115115
with:
116116
python-version: ${{ env.python_version }}
117117
- name: Install Task
118-
uses: go-task/setup-task@v1
118+
uses: go-task/setup-task@v2
119119
with:
120120
repo-token: ${{ secrets.GITHUB_TOKEN }}
121121
- name: Generate project from template

Taskfile.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ tasks:
4949
# This fixes an "ERROR: Multiple platforms feature is currently not supported for docker driver" pipeline error
5050
# Only create our multiplatform builder if it doesn't already exist; otherwise list information about the one that exists
5151
# It suppresses the inspect output when it's not running in a GitHub Action
52-
- docker buildx inspect multiplatform {{if ne .GITHUB_ACTIONS "true"}}>/dev/null{{end}} || docker buildx create --name multiplatform --driver docker-container --use
52+
- docker buildx inspect multiplatform {{if ne .GITHUB_ACTIONS "true"}}>/dev/null{{end}} 2>/dev/null || docker buildx create --name multiplatform --driver docker-container --use
5353

5454
init:
5555
desc: Initialize the repo for local use; intended to be run after git clone
@@ -152,6 +152,8 @@ tasks:
152152
-w /src \
153153
anchore/syft:latest \
154154
/src \
155+
--source-name={{.PROJECT_SLUG}} \
156+
--source-version={{.VERSION}} \
155157
-o syft-json=sbom.syft.json \
156158
-o spdx-json=sbom.spdx.json \
157159
-o cyclonedx-json=sbom.cyclonedx.json

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ignore = [
5050
plugins = []
5151

5252
[tool.pytest.ini_options]
53-
addopts = "--cov=ai_native_python --cov-append --no-cov-on-fail --cov-fail-under=0 --cov-report=html --cov-report=xml --cov-report=term-missing"
53+
addopts = ""
5454
pythonpath = ['.']
5555
markers = [
5656
"unit: marks tests as unit tests (deselect with '-m \"not unit\"')",
@@ -77,7 +77,6 @@ dev = [
7777
]
7878

7979
[tool.coverage.report]
80-
fail_under = 80
8180

8281
[tool.pyright]
8382
include = ["ai_native_python", "tests", "hooks"]

{{cookiecutter.project_name|replace(" ", "")}}/.github/actions/bootstrap/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ runs:
2424
echo "run_script=${run_script}" | tee -a "${GITHUB_ENV}"
2525
2626
- name: Setup uv
27-
uses: astral-sh/setup-uv@v4
27+
uses: astral-sh/setup-uv@v7
2828
with:
2929
enable-cache: true
3030
cache-dependency-glob: "**/uv.lock"
3131
python-version: ${{ "{{ inputs.python-version }}" }}
3232

3333
- name: Install Task
34-
uses: go-task/setup-task@v1
34+
uses: go-task/setup-task@v2
3535
with:
3636
# Passing a repo token reduces the likelihood of API rate limit exceeded
3737
repo-token: ${{ "{{ inputs.token }}" }}
@@ -74,7 +74,7 @@ runs:
7474
echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" | tee -a "${GITHUB_ENV}"
7575
7676
- name: Cache pre-commit environments
77-
uses: actions/cache@v4
77+
uses: actions/cache@v5
7878
with:
7979
path: ~/.cache/pre-commit
8080
key: pre-commit|${{ "{{ env.PY }}" }}|${{ "{{ hashFiles(format('{0}/.pre-commit-config.yaml', inputs.working-directory)) }}" }}

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
- name: Set env var for unique artifact uploads
102102
run: echo SANITIZED_PLATFORM="$(echo "${{ "{{ matrix.platform }}" }}" | sed 's/\//_/g')" | tee -a "${GITHUB_ENV}"
103103
- name: Upload SBOM artifacts
104-
uses: actions/upload-artifact@v5
104+
uses: actions/upload-artifact@v7
105105
with:
106106
name: sbom-${{ "{{ env.SANITIZED_PLATFORM }}" }}
107107
path: |
@@ -112,7 +112,7 @@ jobs:
112112
env:
113113
PLATFORM: ${{ "{{ matrix.platform }}" }}
114114
- name: Upload license check results
115-
uses: actions/upload-artifact@v5
115+
uses: actions/upload-artifact@v7
116116
with:
117117
name: license-check-${{ "{{ env.SANITIZED_PLATFORM }}" }}
118118
path: license-check.*.json
@@ -122,7 +122,7 @@ jobs:
122122
env:
123123
PLATFORM: ${{ "{{ matrix.platform }}" }}
124124
- name: Upload vulnerability scan results
125-
uses: actions/upload-artifact@v5
125+
uses: actions/upload-artifact@v7
126126
with:
127127
name: vulns-${{ "{{ env.SANITIZED_PLATFORM }}" }}
128128
path: vulns.*.json

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
- name: Set env var for unique artifact uploads
7777
run: echo SANITIZED_PLATFORM="$(echo "${{ "{{ matrix.platform }}" }}" | sed 's/\//_/g')" | tee -a "${GITHUB_ENV}"
7878
- name: Upload SBOM artifacts
79-
uses: actions/upload-artifact@v5
79+
uses: actions/upload-artifact@v7
8080
with:
8181
name: sbom-${{ "{{ env.SANITIZED_PLATFORM }}" }}
8282
path: |
@@ -87,7 +87,7 @@ jobs:
8787
env:
8888
PLATFORM: ${{ "{{ matrix.platform }}" }}
8989
- name: Upload license check results
90-
uses: actions/upload-artifact@v5
90+
uses: actions/upload-artifact@v7
9191
with:
9292
name: license-check-${{ "{{ env.SANITIZED_PLATFORM }}" }}
9393
path: license-check.*.json
@@ -97,7 +97,7 @@ jobs:
9797
env:
9898
PLATFORM: ${{ "{{ matrix.platform }}" }}
9999
- name: Upload vulnerability scan results
100-
uses: actions/upload-artifact@v5
100+
uses: actions/upload-artifact@v7
101101
with:
102102
name: vulns-${{ "{{ env.SANITIZED_PLATFORM }}" }}
103103
path: vulns.*.json

{{cookiecutter.project_name|replace(" ", "")}}/Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ tasks:
6060
# This fixes an "ERROR: Multiple platforms feature is currently not supported for docker driver" pipeline error
6161
# Only create our multiplatform builder if it doesn't already exist; otherwise list information about the one that exists
6262
# It suppresses the inspect output when it's not running in a GitHub Action
63-
- docker buildx inspect multiplatform {{ '{{if ne .GITHUB_ACTIONS "true"}}' }}>/dev/null{{ '{{end}}' }} || docker buildx create --name multiplatform --driver docker-container --use
63+
- docker buildx inspect multiplatform {{ '{{if ne .GITHUB_ACTIONS "true"}}' }}>/dev/null{{ '{{end}}' }} 2>/dev/null || docker buildx create --name multiplatform --driver docker-container --use
6464

6565
init:
6666
desc: Initialize the repo for local use; intended to be run after git clone

{{cookiecutter.project_name|replace(" ", "")}}/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pythonpath = ['src']
3535
markers = [
3636
"unit: marks tests as unit tests (deselect with '-m \"not unit\"')",
3737
"integration: marks tests as integration tests (deselect with '-m \"not integration\"')",
38+
"slow: marks tests as slow tests (deselect with '-m \"not slow\"')",
3839
]
3940

4041
[tool.uv]

{{cookiecutter.project_name|replace(" ", "")}}/src/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
def main():
1212
"""Main entry point for the application."""
13-
parser = argparse.ArgumentParser(description="{{ cookiecutter.project_short_description | replace('"', '\\"') | replace("'", "\\\\'") }}")
13+
parser = argparse.ArgumentParser(
14+
prog="{{ cookiecutter.project_slug }}",
15+
description="{{ cookiecutter.project_short_description | replace('"', '\\"') | replace("'", "\\\\'") }}",
16+
)
1417
parser.add_argument(
1518
"--version", action="version", version=f"%(prog)s {__version__}"
1619
)

0 commit comments

Comments
 (0)