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
8 changes: 1 addition & 7 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
[flake8]
max-line-length=100
import-order-style=pycharm
application-import-names=matplotlib_window,tests
extend-ignore=
# pycodestyle
E226,
E,F,W,
# flake8-annotations
ANN002,ANN003,ANN101,ANN102,ANN204,ANN206,
extend-exclude=
.venv,
per-file-ignores =
tests/test_*.py:E501,
53 changes: 29 additions & 24 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
with:
version: "0.6.x"
version: "0.9.x"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Install dependencies
run: uv sync --all-extras --dev

Expand All @@ -38,21 +38,19 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
fail-fast: false

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.x"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Get Non-Hyphenated Python Version
id: get-pyver
run: |
echo "PYVER=$(cut -d '-' -f 1 <<< ${{ matrix.python-version }})" >> $GITHUB_OUTPUT

- name: Set up (release) Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
if: "!endsWith(matrix.python-version, '-dev')"
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -62,15 +60,22 @@ jobs:
if: endsWith(matrix.python-version, '-dev')
with:
python-version: ${{ matrix.python-version }}
tk: true

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.x"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install dependencies
run: |
uv venv
uv pip install tox-gh-actions tox-uv
uv venv --python ${{ steps.get-pyver.outputs.PYVER }}
uv pip install tox-uv

- name: Run tests w/tox
run: uv run tox
run: |
uv run tox -e ${{ steps.get-pyver.outputs.PYVER }}

- name: Cache coverage for ${{ matrix.python-version }}
uses: actions/upload-artifact@v4
Expand All @@ -85,15 +90,15 @@ jobs:
needs: test

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"

- name: Pull coverage workflow artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
path: cov_cache/

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@v7
with:
version: "0.6.x"
version: "0.9.x"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"

- name: Build package
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.12
uses: pypa/gh-action-pypi-publish@release/v1.13
with:
print-hash: true

Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ ci:
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/psf/black
rev: 25.1.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.9.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 6.0.1
rev: 6.1.0
hooks:
- id: isort
name: isort
Expand All @@ -18,7 +18,7 @@ repos:
additional_dependencies:
- flake8-annotations
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-case-conflict
- id: check-json
Expand All @@ -35,6 +35,6 @@ repos:
- id: python-check-blanket-type-ignore
- id: python-use-type-annotations
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.2
rev: v0.14.0
hooks:
- id: ruff-check
3 changes: 3 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle/flake8-docstrings
"E", # pycodestyle
"F", # Pyflakes
"FIX", # flake8-fixme
"N", # pep8-naming
"W", # pycodestyle
]

ignore = [
Expand Down Expand Up @@ -52,6 +54,7 @@ ignore = [

[lint.per-file-ignores]
"tests/test_*.py" = [
"D101",
"D103",
]
"tests/conftest.py" = [
Expand Down
19 changes: 13 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Typing :: Typed",
]

Expand All @@ -32,17 +33,18 @@ Repository = "https://github.com/sco1/matplotlib-window.git"
Issues = "https://github.com/sco1/matplotlib-window/issues"
Changelog = "https://github.com/sco1/matplotlib-window/blob/main/CHANGELOG.md"

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"black~=25.0",
"flake8~=7.1",
"flake8-annotations~=3.1",
"flake8-define-class-attributes~=0.2",
"isort~=6.0",
"mypy~=1.11",
"pre-commit~=4.0",
"pytest~=8.3",
"pytest-cov~=6.0",
"pytest-randomly~=3.15",
"pytest-cov~=7.0",
"pytest-randomly~=4.0",
"ruff~=0.7",
"sco1-bumper~=2.0",
"tox~=4.18",
Expand All @@ -65,6 +67,7 @@ disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
enable_error_code = "exhaustive-match"
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
Expand All @@ -73,6 +76,10 @@ warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

[tool.uv.build-backend]
module-name = "matplotlib_window"
module-root = ""

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["uv_build"]
build-backend = "uv_build"
14 changes: 4 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,20 @@ exclude_also =
if __name__ == "__main__":

[tox]
envlist = clean,py{311,312,313}
skip_missing_interpreters = True
minversion = 3.14.0
envlist = clean,py{3.11,3.12,3.13,3.14}
isolated_build = True
skip_missing_interpreters = True
requires =
tox >= 4.0

[testenv]
commands = python -m pytest
deps =
pytest
pytest-check
pytest-cov
pytest-randomly

[testenv:clean]
deps = coverage
skip_install = true
commands = coverage erase

[gh-actions] # For tox GHA
python =
3.11: py311
3.12: py312
3.13: py313
Loading