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
70 changes: 36 additions & 34 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,66 +13,68 @@ jobs:
matrix:
include:
- os: ubuntu-latest
python-version: '3.8'
FLASK: 3.0.2
- os: ubuntu-latest
python-version: '3.8'
FLASK: 2.3.3
- os: ubuntu-latest
python-version: '3.8'
FLASK: 2.2.5
- os: ubuntu-latest
python-version: '3.9'
FLASK: 3.0.2
- os: ubuntu-latest
python-version: '3.9'
FLASK: 2.3.3
- os: ubuntu-latest
python-version: '3.9'
FLASK: 2.2.5
python-version: '3.10'
FLASK: 3.1.2
- os: ubuntu-latest
python-version: '3.10'
FLASK: 3.0.2
FLASK: 3.0.3
- os: ubuntu-latest
python-version: '3.10'
FLASK: 2.3.3
- os: ubuntu-latest
python-version: '3.10'
FLASK: 2.2.5
python-version: '3.11'
FLASK: 3.1.2
- os: ubuntu-latest
python-version: '3.11'
FLASK: 3.0.2
FLASK: 3.0.3
- os: ubuntu-latest
python-version: '3.11'
FLASK: 2.3.3
- os: ubuntu-latest
python-version: '3.11'
FLASK: 2.2.5
python-version: '3.12'
FLASK: 3.1.2
- os: ubuntu-latest
python-version: '3.12'
FLASK: 3.0.2
FLASK: 3.0.3
- os: ubuntu-latest
python-version: '3.12'
FLASK: 2.3.3
- os: ubuntu-latest
python-version: '3.12'
FLASK: 2.2.5
python-version: '3.13'
FLASK: 3.1.2
- os: ubuntu-latest
python-version: '3.13'
FLASK: 3.0.3
- os: ubuntu-latest
python-version: '3.13'
FLASK: 2.3.3
- os: ubuntu-latest
python-version: '3.14'
FLASK: 3.1.2
- os: ubuntu-latest
python-version: '3.14'
FLASK: 3.0.3
- os: ubuntu-latest
python-version: '3.14'
FLASK: 2.3.3
steps:
- name: Install apt dependencies
run: |
set -ex
sudo apt update
sudo apt install -y ldap-utils slapd enchant-2 libldap2-dev libsasl2-dev apparmor-utils
- name: Disable AppArmor
run: sudo aa-disable /usr/sbin/slapd
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v5
run: |
sudo systemctl stop apparmor || true
sudo find /etc/apparmor.d -name "slapd*" -exec rm {} \; || true
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.slapd 2>/dev/null || true
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: '${{ matrix.python-version }}'
- uses: actions/checkout@v4
- run: pip install pytest Flask==$FLASK
- run: uv sync --all-extras --dev
- run: uv pip install Flask==$FLASK
env:
FLASK: '${{ matrix.FLASK }}'
- run: pip install -r requirements-dev.txt .
- run: pip install .
- run: pytest
- run: uv run python -m unittest
49 changes: 35 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: debug-statements
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
args: ['--fix=lf']
description: Forces to replace line ending by the UNIX 'lf' character.
- repo: https://github.com/psf/black
rev: 24.3.0
args: ["--fix=lf"]
- id: pretty-format-json
args: ["--autofix", "--indent=2", "--no-sort-keys"]
files: \.json$
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
hooks:
- id: ruff
args: ["--fix", "--exit-non-zero-on-fix"]
- id: ruff-format

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.30
hooks:
- id: black
language_version: python3
- repo: https://github.com/d-ryzhykau/pipenv-lock-pre-commit
rev: 0.5.0
- id: uv-lock
- id: uv-export
args: ["-o", "requirements.txt", "--no-hashes", "-q"]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.12.1
hooks:
- id: pipenv-lock
- id: pipenv-verify
- id: pipenv-requirements
- id: pipenv-requirements-dev
- id: pyproject-fmt
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Alexandre Ferland
Copyright (c) 2026 Alexandre Ferland

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 28 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,44 @@
.PHONY: help dev test lint pre-commit
.PHONY: help dev build test cover cover-html fmt pre-commit

.DEFAULT: help
help:
@echo "make dev"
@echo " prepare development environment"
@echo "make build"
@echo " build application"
@echo "make test"
@echo " run tests"
@echo "make lint"
@echo " run black"
@echo "make cover"
@echo " run tests and coverage"
@echo "make cover-html"
@echo " run tests, coverage and open HTML report"
@echo "make fmt"
@echo " run ruff linter and formatter"
@echo "make pre-commit"
@echo " run pre-commit hooks"

dev:
pipenv install --dev
uv sync --all-extras --dev
uv run pre-commit install

build:
uv build

test:
pipenv run pytest
uv run python -m unittest

cover:
uv run coverage run -m unittest
uv run coverage report -m

cover-html:
uv run coverage run -m unittest
uv run coverage html
open htmlcov/index.html

lint:
pipenv run black .
fmt:
uv run ruff check --fix
uv run ruff format

pre-commit:
pipenv run pre-commit
uv run pre-commit run --all-files
13 changes: 0 additions & 13 deletions Pipfile

This file was deleted.

Loading