Repository: iterative/dvc-task (language: python)

Issue:
Migrate from PyPI tokens to Trusted Publishers
https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers#using-trusted-publishing-with-github-actions


Discussion / hints:

Fix patch:
diff --git a/.cruft.json b/.cruft.json
index cee1de4..3c3f519 100644
--- a/.cruft.json
+++ b/.cruft.json
@@ -1,6 +1,6 @@
 {
   "template": "https://github.com/iterative/py-template",
-  "commit": "c4e24f909659b6ce9c34a1da631290f0c70ff2f2",
+  "commit": "0aac03d10cbc7b2f7e144e728de5043b7a3458cb",
   "context": {
     "cookiecutter": {
       "project_name": "dvc-task",
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index f03c79b..a05bc14 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -10,7 +10,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: Check out the repository
-        uses: actions/checkout@v3
+        uses: actions/checkout@v4
         with:
           fetch-depth: 0
 
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index bfee8df..20e499d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -10,10 +10,14 @@ env:
 
 jobs:
   release:
+    environment: pypi
+    permissions:
+      contents: read
+      id-token: write
     runs-on: ubuntu-latest
     steps:
     - name: Check out the repository
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
       with:
         fetch-depth: 0
 
@@ -34,5 +38,3 @@ jobs:
     - name: Upload package
       if: github.event_name == 'release'
       uses: pypa/gh-action-pypi-publish@release/v1
-      with:
-        password: ${{ secrets.PYPI_TOKEN }}
diff --git a/.github/workflows/update-template.yaml b/.github/workflows/update-template.yaml
index 2fe700d..59f0b2e 100644
--- a/.github/workflows/update-template.yaml
+++ b/.github/workflows/update-template.yaml
@@ -10,7 +10,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
     - name: Check out the repository
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
 
     - name: Update template
       uses: iterative/py-template@main
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 576f1d8..10603cd 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,7 +2,7 @@ default_language_version:
   python: python3
 repos:
   - repo: https://github.com/psf/black
-    rev: 23.1.0
+    rev: 23.9.1
     hooks:
       - id: black
   - repo: https://github.com/pre-commit/pre-commit-hooks
@@ -24,12 +24,12 @@ repos:
       - id: sort-simple-yaml
       - id: trailing-whitespace
   - repo: https://github.com/codespell-project/codespell
-    rev: v2.2.2
+    rev: v2.2.5
     hooks:
       - id: codespell
         additional_dependencies: ["tomli"]
   - repo: https://github.com/asottile/pyupgrade
-    rev: v3.3.1
+    rev: v3.10.1
     hooks:
       - id: pyupgrade
         args: [--py38-plus]
@@ -38,16 +38,16 @@ repos:
     hooks:
       - id: isort
   - repo: https://github.com/pycqa/flake8
-    rev: 6.0.0
+    rev: 6.1.0
     hooks:
       - id: flake8
         additional_dependencies:
-          - flake8-bugbear==23.1.20
-          - flake8-comprehensions==3.10.1
+          - flake8-bugbear==23.7.10
+          - flake8-comprehensions==3.14.0
           - flake8-debugger==4.1.2
           - flake8-string-format==0.3.0
   - repo: https://github.com/pycqa/bandit
-    rev: 1.7.4
+    rev: 1.7.5
     hooks:
       - id: bandit
         args: [-c, pyproject.toml]
diff --git a/setup.cfg b/setup.cfg
index f7f4da4..afed862 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -32,11 +32,11 @@ install_requires=
 
 [options.extras_require]
 docs =
-    mkdocs==1.3.1
-    mkdocs-gen-files==0.3.5
-    mkdocs-material==8.4.1
-    mkdocs-section-index==0.3.4
-    mkdocstrings-python==0.7.1
+    mkdocs==1.5.2
+    mkdocs-gen-files==0.5.0
+    mkdocs-material==9.3.1
+    mkdocs-section-index==0.3.6
+    mkdocstrings-python==1.6.3
 tests =
     pytest==7.2.0
     pytest-sugar==0.9.6


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index de48bb7..54f7f6e 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -27,7 +27,7 @@ jobs:
 
     steps:
     - name: Check out the repository
-      uses: actions/checkout@v3
+      uses: actions/checkout@v4
       with:
         fetch-depth: 0
 
@@ -49,7 +49,7 @@ jobs:
       run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --cov-report=xml
 
     - name: Upload coverage report
-      uses: codecov/codecov-action@v3.1.1
+      uses: codecov/codecov-action@v3.1.4
 
     - name: Build package
       run: nox -s build