Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0ed1939
Remove license classifier since set in project metadata
rlskoeser Apr 24, 2026
2d706d5
Switch to optional dependency group for dev/test deps
rlskoeser Apr 24, 2026
b0a2ec6
Fix uv group syntax
rlskoeser Apr 24, 2026
7bafd28
Update install instructions for change to dependency groups
rlskoeser Apr 24, 2026
ee6800e
Use uv for docs install; update to use dependency groups
rlskoeser Apr 24, 2026
2d80ebd
Configure pytest as recommended by repo-review
rlskoeser Apr 24, 2026
6f41e3d
Update pre-commit config to get more help
rlskoeser Apr 24, 2026
677aa5b
Fix typos and misspellings caught by codespell
rlskoeser Apr 24, 2026
02ac0bb
Fix bad indentation in readthedocs config
rlskoeser Apr 24, 2026
401e549
Consolidate pytest configurations
rlskoeser Apr 24, 2026
59a5965
Fix pytest config & correctly set minimum version
rlskoeser Apr 24, 2026
70f5ce3
Set actions to cancel in progress for concurrency
rlskoeser Apr 24, 2026
c14fb37
Pin convertdate version to avoid deprecation warning / syntax change
rlskoeser Apr 24, 2026
737dd5d
Configure dependabot to update github actions & pre-commit hooks
rlskoeser Apr 24, 2026
67985cd
Configure dependabot to group commits
rlskoeser Apr 24, 2026
76ed1da
Configure ruff to sort imports; use to fix existing code
rlskoeser May 7, 2026
535054e
Enable and fix more ruff rules
rlskoeser May 7, 2026
a11a376
Enable and apply ruff check for pathlib use
rlskoeser May 7, 2026
ffb9652
Configure & apply more ruff fixes
rlskoeser May 7, 2026
6a89566
Configure and apply last set of ruff checks & fixes
rlskoeser May 7, 2026
89ded9b
Update github action to use ruff check/format actions
rlskoeser May 7, 2026
ee28651
Limit ruff format to check src & tests (not example notebooks)
rlskoeser May 7, 2026
8b0d650
Also limit ruff check to src & tests
rlskoeser May 7, 2026
82c78fc
Update pre-commit tool versions with autoupdate
rlskoeser May 7, 2026
708478b
Use newer versions of actions
rlskoeser May 7, 2026
3fa7de7
Clean up notebooks for github actions ruff check
rlskoeser May 7, 2026
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
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
groups:
actions:
patterns:
- "*"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"

# Enable version updates for pre-commit hooks
- package-ecosystem: "pre-commit"
directory: "/"
schedule:
interval: "weekly"
groups:
pre-commit:
patterns:
- "*"
26 changes: 17 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
Expand All @@ -16,23 +20,27 @@ jobs:

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

- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml"

- name: Install package with check dependencies
run: uv sync --extra check
run: uv sync --group check

- name: Run Ruff linter
uses: astral-sh/ruff-action@v3
with:
args: "check --output-format=github"

# check with ruff
- name: Run ruff
run: uv run ruff check
- name: Run Ruff formatter
# NOTE: ruff format does not currently support github output format
run: ruff format --check --diff src tests
# Check formatting even if the previous step failed
if: always()

# check docs build
- name: Check that documentation builds with no errors or warnings
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ name: Upload Python Package
on:
release:
types: [published]
# allow manually running on main
workflow_dispatch:

permissions:
contents: read
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ permissions:
contents: read
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
Expand Down Expand Up @@ -34,23 +38,23 @@ jobs:

# use github python action instead of uv to take advantage of caching
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
uses: astral-sh/setup-uv@v8.1.0
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'

- name: Install package with dependencies
run: pip install -e ".[test]"
- name: Install package with check dependencies
run: uv sync --group test

# for all versions but the one we use for code coverage, run normally
- name: Run unit tests without code coverage
run: pytest
run: uv run pytest
if: ${{ matrix.python != env.COV_PYTHON_VERSION }}

# run code coverage in one version only
- name: Run unit tests with code coverage reporting
run: pytest --cov=.
run: uv run pytest --cov=.
if: ${{ matrix.python == env.COV_PYTHON_VERSION }}

- name: Upload coverage to Codecov
Expand Down
34 changes: 29 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
files: \.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

pre-commit config top-level files regex semantics default applied to hooks

💡 Result:

In pre-commit's .pre-commit-config.yaml, top-level 'files' and 'exclude' options are Python regular expressions matched against file paths relative to the repository root using re.search semantics (substring match anywhere in the path, not full path anchored unless ^/$ used). - 'files': optional global include pattern (default: empty string ''). An empty regex matches all files (re.search('', path) succeeds for any path). - 'exclude': optional global exclude pattern (default: '^$', which matches only empty strings, excluding nothing). These apply before hook-level filters. Global 'files' selects candidates, then global 'exclude' removes matches from them, then hook-specific 'files'/'exclude' etc. apply. Hook-level 'files'/'exclude' use the same regex semantics. Source: Official pre-commit docs confirm defaults and top-level application; regex section explicitly states "The patterns for files and exclude are python regular expressions and are matched with re.search." Examples show multiline (?x) regexes for complex patterns.

Citations:


🏁 Script executed:

cat -n .pre-commit-config.yaml

Repository: dh-tech/undate-python

Length of output: 1716


Critical: top-level files: \.py silently disables every new non-Python hook.

The global files regex on line 1 applies to every hook that does not override it. check-merge-conflict, check-yaml, yamlfmt, codespell, and action-validator have no local files overrides and will only match files ending in .py, rendering them no-ops—these tools are meant to validate YAML, workflows, text, and merge conflicts, not Python source.

Remove the top-level filter (recommended—individual hooks already declare types/types_or appropriately) or override files per-hook that needs non-Python coverage.

Proposed fix
-files: \.py
 repos:

If a subset of existing hooks really did need to be restricted to *.py, re-declare files: on those individual hooks instead of globally.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
files: \.py
repos:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml at line 1, The top-level "files: \.py" entry in
.pre-commit-config.yaml is restricting all hooks (including
check-merge-conflict, check-yaml, yamlfmt, codespell, action-validator) to
Python files only; remove the global "files: \.py" key or delete that line and
instead add per-hook "files:" filters only on the specific hooks that truly need
Python-only filtering (or leave hooks without a files filter so they respect
their own types/types_or), ensuring YAML/workflow/text hooks run on non-.py
files.

repos:
# ruff for linting and formatting python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
rev: v0.15.12
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- id: ruff-check
args: [ --fix, --show-fixes, --exit-non-zero-on-fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v6.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-yaml
- id: name-tests-test
args: [--pytest-test-first]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v2.0.0
hooks:
- id: mypy
additional_dependencies: [numpy]
# yamlfmt for formatting YAML files
- repo: https://github.com/google/yamlfmt
rev: v0.21.0
hooks:
- id: yamlfmt
# Codespell for spell checking
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude_types: ["css", "html", "javascript", "json"]
# Validate GitHub Actions workflow files
- repo: https://github.com/mpalmer/action-validator
rev: v0.9.0
hooks:
- id: action-validator
10 changes: 5 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
install:
- method: uv
command: sync
groups:
- docs
8 changes: 7 additions & 1 deletion DEVELOPER_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ source .venv/bin/activate
Install an editable version of the local package along with python dependencies needed for testing and development.

```sh
pip install -e ".[dev]"
pip install -e . --group=dev
```
Comment thread
rlskoeser marked this conversation as resolved.

If using `uv`, use

```sh
uv sync --group test
```

### Install pre-commit hooks

We use [pre-commit](https://pre-commit.com/) for automated checks and consistent formatting. If you're planning to contribute, please install these when you set up your local development.
Expand Down
Loading
Loading