Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .github/workflows/pre-commit-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,24 @@ jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: pre-commit/action@v3.0.0
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync
- uses: pre-commit/action@v3.0.1
testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: pytest
run: |
make setup-pipenv
make install-dev
make test
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync
- run: make test
47 changes: 7 additions & 40 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,39 @@ default_language_version:
default_install_hook_types: [pre-commit, pre-push, pre-rebase]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: debug-statements
- id: double-quote-string-fixer
- id: check-added-large-files
- id: check-merge-conflict
- id: name-tests-test
# ensure tests match `test_.*\.py`
args: ['--pytest-test-first']
- id: no-commit-to-branch
args: [--branch, main]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-use-type-annotations
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.44.0
rev: v0.47.0
hooks:
- id: markdownlint
args: ['--config', 'pyproject.toml', '--fix']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.2
rev: v0.15.16
hooks:
- id: ruff
- id: ruff-check
- id: ruff-format
args: ['--check']
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies: ['types-pytz', 'types-requests']
- repo: https://github.com/PyCQA/bandit
rev: 1.8.3
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
- repo: https://github.com/pylint-dev/pylint
rev: v3.3.6
hooks:
- id: pylint
- repo: https://github.com/hadialqattan/pycln
rev: v2.5.0
hooks:
- id: pycln
- repo: https://github.com/mrtazz/checkmake.git
rev: 0.2.2
hooks:
- id: checkmake
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.1
rev: v2.11.0
hooks:
- id: pyproject-fmt
args: ['--check']
Expand All @@ -79,7 +46,7 @@ repos:
language: pygrep
entry: '^(feature|fix|docs|refactor)!?: [a-zA-Z0-9-_ ]+[a-zA-Z0-9-_ ]+.*'
args:
- --negate # fails if the entry is NOT matched
- --negate
stages:
- commit-msg
- repo: local
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
41 changes: 18 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,51 +1,46 @@
SHELL := /bin/bash

.PHONY: setup setup-pipenv install install-dev lint test run clean-setup clean-lint all clean
.PHONY: setup install install-dev lint test run clean-setup clean-lint all clean

setup: install-dev
pipenv run pre-commit install
pipenv run pre-commit install --hook-type commit-msg

setup-pipenv:
python -m pip install --upgrade pip
pip install pipenv
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg

install:
pipenv sync
uv sync --no-default-groups

install-dev:
pipenv sync --dev
dev:
uv sync --all-groups

lint:
pipenv run pre-commit run --all-files
uv run pre-commit run --all-files

test:
pipenv run pytest tests/* --cov-branch --cov=codecov --cov-report=term-missing
uv run pytest tests/* --cov-branch --cov=codecov --cov-report=term-missing

report:
pipenv run pytest tests --cov-branch --cov=codecov --cov-report=term-missing --cov-report=json:/tmp/report.json
uv run pytest tests --cov-branch --cov=codecov --cov-report=term-missing --cov-report=json:/tmp/report.json

build:
pipenv run python3 -m build
uv run python -m build

test-publish:
pipenv run python3 -m twine upload --repository testpypi dist/*
uv run python -m twine upload --repository testpypi dist/*

publish:
pipenv run python3 -m twine upload dist/*
uv run python -m twine upload dist/*

run:
pipenv run python run.py
uv run python run.py

clean-setup:
pipenv run pre-commit uninstall --hook-type commit-msg
pipenv run pre-commit uninstall
pipenv clean
uv run pre-commit uninstall --hook-type commit-msg
uv run pre-commit uninstall

clean-lint:
pipenv run pre-commit clean
pipenv run pre-commit gc
uv run pre-commit clean
uv run pre-commit gc

all: setup-pipenv setup lint
all: setup lint

clean: clean-lint clean-setup
24 changes: 0 additions & 24 deletions Pipfile

This file was deleted.

Loading
Loading