Skip to content

Commit

Permalink
update template
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Mar 25, 2024
1 parent 8e74d4e commit 9e181fb
Show file tree
Hide file tree
Showing 27 changed files with 271 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
@@ -1,6 +1,6 @@
{
"template": "https://github.com/iterative/py-template",
"commit": "efb0a22625c1d83e687f2bd284f3e96a20d16711",
"commit": "e4ec95f4cfd03d4af0a8604d462ee11d07d63b42",
"context": {
"cookiecutter": {
"project_name": "dvc-task",
Expand Down
13 changes: 0 additions & 13 deletions .github/dependabot.yml
Expand Up @@ -7,23 +7,10 @@ updates:
interval: "weekly"
labels:
- "maintenance"
# Update via cruft
ignore:
- dependency-name: "mkdocs*"
- dependency-name: "pytest*"
- dependency-name: "pylint"
- dependency-name: "mypy"

- directory: "/"
package-ecosystem: "github-actions"
schedule:
interval: "weekly"
labels:
- "maintenance"
# Update via cruft
ignore:
- dependency-name: "actions/checkout"
- dependency-name: "actions/setup-python"
- dependency-name: "pypa/gh-action-pypi-publish"
- dependency-name: "codecov/codecov-action"
- dependency-name: "peter-evans/create-pull-request"
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/release.yml
Expand Up @@ -16,25 +16,25 @@ jobs:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Upgrade pip and nox
run: |
pip install --upgrade pip nox
pip --version
nox --version
- name: Upgrade pip and nox
run: |
pip install --upgrade pip nox
pip --version
nox --version
- name: Build package
run: nox -s build
- name: Build package
run: nox -s build

- name: Upload package
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
- name: Upload package
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
50 changes: 25 additions & 25 deletions .github/workflows/tests.yml
Expand Up @@ -21,38 +21,38 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
pyv: ['3.8', '3.9', '3.10', '3.11']
pyv: ['3.8', '3.9', '3.10', '3.11', '3.12']
include:
- {os: ubuntu-latest, pyv: 'pypy3.8'}
- {os: ubuntu-latest, pyv: 'pypy3.8'}

steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.pyv }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyv }}
- name: Set up Python ${{ matrix.pyv }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyv }}

- name: Upgrade pip and nox
run: |
python -m pip install --upgrade pip nox
pip --version
nox --version
- name: Upgrade pip and nox
run: |
python -m pip install --upgrade pip nox
pip --version
nox --version
- name: Lint code and check dependencies
run: nox -s lint safety
- name: Lint code and check dependencies
run: nox -s lint safety

- name: Run tests
run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --cov-report=xml
- name: Run tests
run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --cov-report=xml

- name: Upload coverage report
uses: codecov/codecov-action@v3.1.4
- name: Upload coverage report
uses: codecov/codecov-action@v3

- name: Build package
run: nox -s build
- name: Build package
run: nox -s build

- name: Build docs
run: nox -s docs
- name: Build docs
run: nox -s docs
8 changes: 4 additions & 4 deletions .github/workflows/update-template.yaml
Expand Up @@ -9,8 +9,8 @@ jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Check out the repository
uses: actions/checkout@v4

- name: Update template
uses: iterative/py-template@main
- name: Update template
uses: iterative/py-template@main
44 changes: 14 additions & 30 deletions .pre-commit-config.yaml
@@ -1,12 +1,8 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -17,38 +13,26 @@ repos:
args: ['--assume-in-merge']
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
args: ['--fix=lf']
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.3.4'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies: ["tomli"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- 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.5
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.12.0
hooks:
- id: bandit
args: [-c, pyproject.toml]
additional_dependencies: ["bandit[toml]"]
- id: pretty-format-toml
args: [--autofix, --no-sort]
- id: pretty-format-yaml
args: [--autofix, --indent, '2', '--offset', '2', --preserve-quotes]
24 changes: 12 additions & 12 deletions mkdocs.yml
Expand Up @@ -19,15 +19,15 @@ extra:
link: https://github.com/iterative/

plugins:
- search
- gen-files:
scripts:
- docs/gen_ref_pages.py
- section-index
- mkdocstrings:
handlers:
python:
rendering:
show_submodules: no
watch:
- src/dvc_task
- search
- gen-files:
scripts:
- docs/gen_ref_pages.py
- section-index
- mkdocstrings:
handlers:
python:
rendering:
show_submodules: no
watch:
- src/dvc_task
2 changes: 1 addition & 1 deletion noxfile.py
@@ -1,4 +1,5 @@
"""Automation using nox."""

import glob
import os

Expand Down Expand Up @@ -35,7 +36,6 @@ def lint(session: nox.Session) -> None:
args = *(session.posargs or ("--show-diff-on-failure",)), "--all-files"
session.run("pre-commit", "run", *args)
session.run("python", "-m", "mypy")
session.run("python", "-m", "pylint", *locations)


@nox.session
Expand Down

0 comments on commit 9e181fb

Please sign in to comment.