Skip to content

Commit 3d4d5bb

Browse files
authored
Fix failed tests, linter errors, and restructure (faif#477)
* Switch development dependencies to Pipenv lockfile - add Pipfile and Dependabot-compatible Pipfile.lock - update lint, tox, CI, Travis, and Makefile workflows - support Python 3.10 through 3.14 - remove the pip-tools requirements lockfile - standardize linting, type checking, and tests * Streamline GitHub Actions CI workflow - consolidate duplicate lint and PR workflows - run strict linting, type checking, and tests - test against Python 3.10 through 3.14 - install dependencies from Pipfile.lock - add caching, timeouts, minimal permissions, and concurrency control - remove ignored failures and fragile changed-file logic
1 parent 74151cf commit 3d4d5bb

61 files changed

Lines changed: 1329 additions & 1783 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
versioning-strategy: increase-if-necessary
8+
9+
- package-ecosystem: github-actions
10+
directory: /
11+
schedule:
12+
interval: weekly

.github/workflows/lint_pr.yml

Lines changed: 0 additions & 288 deletions
This file was deleted.

.github/workflows/lint_python.yml

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,62 @@
1-
name: lint_python
2-
on: [pull_request, push]
1+
name: Python CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: python-ci-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
314
jobs:
4-
lint_python:
15+
quality:
16+
name: Lint, type-check, and test
517
runs-on: ubuntu-24.04
18+
timeout-minutes: 15
619
steps:
720
- uses: actions/checkout@v6
21+
822
- uses: actions/setup-python@v6
923
with:
10-
python-version: 3.12
11-
- name: Install dependencies
24+
python-version: "3.12"
25+
cache: pip
26+
cache-dependency-path: Pipfile.lock
27+
28+
- name: Run quality checks
29+
run: ./lint.sh
30+
31+
tests:
32+
name: Test on Python ${{ matrix.python-version }}
33+
runs-on: ubuntu-24.04
34+
timeout-minutes: 15
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
python-version:
39+
- "3.10"
40+
- "3.11"
41+
- "3.12"
42+
- "3.13"
43+
- "3.14"
44+
steps:
45+
- uses: actions/checkout@v6
46+
47+
- uses: actions/setup-python@v6
48+
with:
49+
python-version: ${{ matrix.python-version }}
50+
cache: pip
51+
cache-dependency-path: Pipfile.lock
52+
53+
- name: Install locked dependencies
1254
run: |
1355
python -m pip install --upgrade pip
14-
pip install .[dev]
15-
- name: Lint with flake8
16-
run: flake8 ./patterns --count --show-source --statistics
17-
continue-on-error: true
18-
- name: Format check with isort and black
19-
run: |
20-
isort --profile black --check ./patterns
21-
black --check ./patterns
22-
continue-on-error: true
23-
- name: Type check with mypy
24-
run: mypy --ignore-missing-imports ./patterns || true
25-
continue-on-error: true
26-
- name: Run tests with pytest
27-
run: |
28-
pytest ./patterns
29-
pytest --doctest-modules ./patterns || true
30-
continue-on-error: true
31-
- name: Check Python version compatibility
32-
run: shopt -s globstar && pyupgrade --py312-plus ./patterns/**/*.py
33-
continue-on-error: true
34-
- name: Run tox
35-
run: tox
36-
continue-on-error: true
56+
python -m pip install pipenv
57+
pipenv requirements --dev > "${RUNNER_TEMP}/requirements-dev.txt"
58+
python -m pip install -r "${RUNNER_TEMP}/requirements-dev.txt"
59+
python -m pip install --no-build-isolation --no-deps -e .
60+
61+
- name: Run tests
62+
run: python -m pytest tests patterns

0 commit comments

Comments
 (0)