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
106 changes: 42 additions & 64 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: check
name: "🛠️ check"
on:
workflow_dispatch:
push:
Expand All @@ -14,65 +14,59 @@ concurrency:

jobs:
test:
name: test ${{ matrix.py }} - ${{ matrix.os }}
name: "🧪 Test ${{ matrix.py }} - ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
py:
- "pypy3.10" # ahead to start it earlier because takes longer
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "pypy3.11"
os:
- ubuntu-latest
- windows-latest
- macos-latest
- ubuntu-24.04
- windows-2025
- macos-15
exclude:
- { os: windows-2025, py: pypy3.11 }

steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install the latest version of uv
- name: "🔄 Install the latest version of uv"
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Add .local/bin to Windows PATH
if: runner.os == 'Windows'
shell: bash
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
- name: Install tox
- name: "🧪 Install tox"
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Install Python
- name: "🐍 Install Python"
run: uv python install --python-preference only-managed ${{ matrix.py }}
- name: Setup test suite
- name: "⚙️ Setup test suite"
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }}
env:
UV_PYTHON_PREFERENCE: only-managed
- name: Run test suite
if: ${{ !startsWith(matrix.py, 'pypy')}}
run: tox run --skip-pkg-install -e ${{ matrix.py }}
env:
PYTEST_ADDOPTS: "-vv --durations=20"
DIFF_AGAINST: HEAD
UV_PYTHON_PREFERENCE: only-managed
- name: Run test suite without coverage
if: ${{ startsWith(matrix.py, 'pypy')}}
run: tox run --skip-pkg-install -e ${{ matrix.py }} --
- name: "✅ Run test suite"
run: |
if [[ "${{ matrix.py }}" == pypy* ]]; then
tox run --skip-pkg-install -e ${{ matrix.py }} --
else
tox run --skip-pkg-install -e ${{ matrix.py }}
fi
shell: bash
env:
PYTEST_ADDOPTS: "-vv --durations=20"
UV_PYTHON_PREFERENCE: only-managed
- name: Rename coverage report file
DIFF_AGAINST: HEAD
- name: "📝 Rename coverage report file"
if: ${{ !startsWith(matrix.py, 'pypy')}}
run: |
import os; import sys
os.rename(f".tox/.coverage.${{ matrix.py }}", f".tox/.coverage.${{ matrix.py }}-{sys.platform}")
shell: python
- name: Upload coverage data
- name: "📦 Upload coverage data"
if: ${{ !startsWith(matrix.py, 'pypy')}}
uses: actions/upload-artifact@v4
with:
Expand All @@ -82,84 +76,68 @@ jobs:
retention-days: 3

coverage:
name: Combine coverage
runs-on: ubuntu-latest
name: "📊 Combine coverage"
runs-on: ubuntu-24.04
needs: test
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install the latest version of uv
- name: "🔄 Install the latest version of uv"
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Add .local/bin to Windows PATH
if: runner.os == 'Windows'
shell: bash
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
- name: Install hatch
- name: "🧪 Install tox"
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Build package to generate version
- name: "📦 Build package to generate version"
run: uv build --python 3.13 --python-preference only-managed --wheel . --out-dir dist
- name: Setup coverage tool
- name: "⚙️ Setup coverage tool"
run: tox -e coverage --notest
env:
UV_PYTHON_PREFERENCE: only-managed
- name: Download coverage data
- name: "⬇️ Download coverage data"
uses: actions/download-artifact@v5
with:
path: .tox
pattern: .coverage.*
merge-multiple: true
- name: Combine and report coverage
- name: "📊 Combine and report coverage"
run: tox -e coverage --skip-pkg-install
env:
UV_PYTHON_PREFERENCE: only-managed
- name: Upload HTML report
- name: "📤 Upload HTML report"
uses: actions/upload-artifact@v4
with:
name: html-report
path: .tox/htmlcov

check:
name: ${{ matrix.tox_env }} - ${{ matrix.os }}
name: "🔎 ${{ matrix.tox_env }} - ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- ubuntu-24.04
- windows-2025
tox_env:
- dev
- type
- docs
- readme
- pkg_meta
exclude:
- { os: windows-latest, tox_env: readme }
- { os: windows-2025, tox_env: pkg_meta }
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install the latest version of uv
- name: "🔄 Install the latest version of uv"
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Add .local/bin to Windows PATH
if: runner.os == 'Windows'
shell: bash
run: echo "$USERPROFILE/.local/bin" >> $GITHUB_PATH
- name: Install tox
- name: "🧪 Install tox"
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Setup test suite
- name: "⚙️ Setup test suite"
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
env:
UV_PYTHON_PREFERENCE: only-managed
- name: Run test suite
- name: "✅ Run test suite"
run: tox run --skip-pkg-install -e ${{ matrix.tox_env }}
env:
UV_PYTHON_PREFERENCE: only-managed
24 changes: 9 additions & 15 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release to PyPI
name: 🚀Release to PyPI
on:
push:
tags: ["*"]
Expand All @@ -8,20 +8,16 @@ env:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Install the latest version of uv
- name: "🔄 Install the latest version of uv"
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build package
- name: "📦 Build package"
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist
- name: Store the distribution packages
- name: "📤 Store the distribution packages"
uses: actions/upload-artifact@v4
with:
name: ${{ env.dists-artifact-name }}
Expand All @@ -30,19 +26,17 @@ jobs:
release:
needs:
- build
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
environment:
name: release
name: "🚀 Release to PyPI"
url: https://pypi.org/project/filelock/${{ github.ref_name }}
permissions:
id-token: write
steps:
- name: Download all the dists
- name: "⬇️ Download all the dists"
uses: actions/download-artifact@v5
with:
name: ${{ env.dists-artifact-name }}
path: dist/
- name: Publish to PyPI
- name: "🚀 Publish to PyPI"
uses: pypa/[email protected]
with:
attestations: true
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ repos:
hooks:
- id: codespell
additional_dependencies: ["tomli>=2.2.1"]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.6.0"
- repo: https://github.com/tox-dev/tox-toml-fmt
rev: "v1.0.0"
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
- id: tox-toml-fmt
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.6.0"
hooks:
Expand All @@ -34,8 +33,8 @@ repos:
hooks:
- id: prettier
additional_dependencies:
- prettier@3.4.2
- "@prettier/[email protected].1"
- prettier@3.6.2
- "@prettier/[email protected].2"
- repo: meta
hooks:
- id: check-hooks-apply
Expand Down
17 changes: 6 additions & 11 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
version: 2
build:
os: ubuntu-22.04
os: ubuntu-lts-latest
tools:
python: "3"
python:
install:
- method: pip
path: .
extra_requirements:
- docs
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: true
commands:
- pip install uv
- uv venv
- uv pip install tox-uv
- .venv/bin/tox run -e docs --
Loading
Loading