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
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true

# Unix-style newlines at the bottom of every file
[*]
charset = utf-8

# Tab indentation
indent_style = space
indent_size = 4

[*.{md,sh,yaml,yml}]
indent_size = 2
75 changes: 75 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: Tests

on:
# Run tests each time a PR is opened or changed.
# Allow other Workflows (e.g., build workflows) to call this workflow.
pull_request:
workflow_call:

permissions: read-all

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12"]

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: |
uv pip install --system -e ".[dev]"

- name: Run tests with pytest
run: |
uv run pytest tests/ --cov=. --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: |
uv pip install --system -e ".[dev]"

- name: Install pre-commit
run: |
uv pip install --system pre-commit

- name: Run pre-commit hooks
run: |
pre-commit run --all-files
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Virtual environments
venv/
.venv/
ENV/
env/
.env

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Ruff
.ruff_cache/
2 changes: 1 addition & 1 deletion .idea/dependency-update-pre-commit.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
exclude_types:
- json
- id: trailing-whitespace
- id: no-commit-to-branch
- id: debug-statements
- id: requirements-txt-fixer
- id: check-executables-have-shebangs
- id: detect-private-key
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.5
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.16.1
hooks:
- id: mypy
entry: mypy src tests --config-file=pyproject.toml
additional_dependencies:
- PyYAML==6.0.2
- pytest==8.3.4
- requests==2.32.4
- types-PyYAML
- types-requests
always_run: true
pass_filenames: false
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args:
- -c=./.yamllint.yaml
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.10.0
hooks:
- id: shellcheck
- repo: https://github.com/pecigonzalo/pre-commit-shfmt
rev: v2.2.0
hooks:
- id: shell-fmt-docker
args:
- -i
- "2"
2 changes: 1 addition & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- id: update-mypy-dependencies
name: Update mypy additional_dependencies
entry: update_mypy_dependencies.py
entry: update-mypy-dependencies
language: python
files: ^(requirements.*\.txt|pyproject\.toml)$
pass_filenames: false
Expand Down
2 changes: 2 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Necessary to allow execution of source venv/bin/activate
external-sources=true
34 changes: 34 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
yaml-files:
- "*.yaml"
- "*.yml"
- ".yamllint"

rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length:
max: 120
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
new-line-at-end-of-file: enable
new-lines: disable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy: disable
15 changes: 15 additions & 0 deletions install.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
echo Install dependency-update-pre-commit.
@echo off
FOR /F "tokens=* USEBACKQ" %%F IN (`python --version`) DO SET PYTHON_VERSION=%%F

echo %PYTHON_VERSION%
if "x%PYTHON_VERSION:3.12=%"=="x%PYTHON_VERSION%" (
echo "Python Version 3.12 is not installed in environment." & cmd /K & exit
)

python -m venv .venv
call .venv\Scripts\activate
python -m pip install --upgrade pip
pip install uv
uv pip install . --python .venv
deactivate
26 changes: 26 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)

set -e
echo "Install dependency-update-pre-commit."

echo "$DIR"
cd "$DIR" || exit
WORKING_DIR=$(pwd)
VENV="$WORKING_DIR"/.venv
PYTHON="$VENV"/bin/python
PIP="$VENV"/bin/pip
UV="$VENV"/bin/uv

python3.12 -m venv "$VENV"

$PYTHON -m pip install --upgrade pip
$PIP install uv
$UV pip install . --python .venv
6 changes: 6 additions & 0 deletions install_dev.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
echo Install dependency-update-pre-commit development environment.
call install.cmd
call .venv\Scripts\activate
uv sync --dev --python .venv
pre-commit install --install-hooks
deactivate
11 changes: 11 additions & 0 deletions install_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e
echo "Install dependency-update-pre-commit development environment."

WORKING_DIR=$(pwd)

bash "$WORKING_DIR"/install.sh

uv lock --upgrade
uv sync --dev
uv run pre-commit install --install-hooks
Loading
Loading