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
46 changes: 23 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
branches:
- main
- release/**
workflow_dispatch: {}

jobs:
Expand All @@ -13,47 +12,49 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- run: pip install --group lint -e .
- run: pre-commit run --all-files
- run: mypy looptime --strict
- run: uv sync --no-dev --group lint
- run: uv run --no-sync pre-commit run --all-files
- run: uv run --no-sync mypy

unit-tests:
strategy:
fail-fast: false
matrix:
# Assumption: if free-threaded works in one version, it works in all versions.
python-version: [ "3.11", "3.12", "3.13", "3.14", "3.14t" ]
name: Python ${{ matrix.python-version }}${{ matrix.install-extras && ', ' || '' }}${{ matrix.install-extras }}
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-26.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- run: pip install --group dev -e .
- run: pip install "${{ matrix.install-extras }}"
if: ${{ matrix.install-extras }}
- run: pytest --color=yes --cov=looptime --cov-branch
- run: uv sync --no-dev --group test
- run: uv run --no-sync coverage run --branch --source=looptime -m pytest --color=yes

- name: Publish coverage to Coveralls.io
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: ${{ matrix.python-version }}
if: success()
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true
continue-on-error: true # tends to fail with no code changes (e.g. only CI/docs)
- name: Publish coverage to CodeCov.io
uses: codecov/codecov-action@v3
if: success()
uses: codecov/codecov-action@v7
env:
PYTHON: ${{ matrix.python-version }}
with:
flags: unit
env_vars: PYTHON
token: ${{ secrets.CODECOV_TOKEN }}
if: success()
continue-on-error: true

# No coverage: PyPy performs extremely poorly with tracing/coverage.
Expand All @@ -67,21 +68,20 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- run: pip install --group dev -e .
- run: pytest --color=yes --no-cov
- run: uv sync --no-dev --group test
- run: uv run --no-sync pytest --color=yes --no-cov

coveralls-finish:
name: Finalize coveralls.io
needs: [unit-tests]
runs-on: ubuntu-26.04
steps:
- uses: actions/setup-python@v7
- run: pip install coveralls
- run: coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true
- name: Finish coverage at Coveralls.io
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
42 changes: 22 additions & 20 deletions .github/workflows/thorough.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
push:
branches:
- main
- release/**
schedule:
- cron: "13 3 * * 6"
workflow_dispatch: {}
Expand All @@ -15,12 +14,13 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
- uses: actions/setup-python@v7
with:
python-version: "3.14"
- run: pip install --group dev --group lint -e .
- run: pre-commit run --all-files
- run: mypy looptime --strict
- run: uv sync --no-dev --group lint
- run: uv run --no-sync pre-commit run --all-files
- run: uv run --no-sync mypy

unit-tests:
strategy:
Expand All @@ -33,27 +33,30 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- run: pip install --group dev -e .
- run: pytest --color=yes --cov=looptime --cov-branch
- run: uv sync --no-dev --group test
- run: uv run --no-sync coverage run --branch --source=looptime -m pytest --color=yes

- name: Publish coverage to Coveralls.io
uses: coverallsapp/github-action@v2
with:
parallel: true
flag-name: ${{ matrix.python-version }}
if: success()
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true
continue-on-error: true # tends to fail with no code changes (e.g. only CI/docs)
- name: Publish coverage to CodeCov.io
uses: codecov/codecov-action@v3
if: success()
uses: codecov/codecov-action@v7
env:
PYTHON: ${{ matrix.python-version }}
with:
flags: unit
env_vars: PYTHON
token: ${{ secrets.CODECOV_TOKEN }}
if: success()
continue-on-error: true

# No coverage: PyPy performs extremely poorly with tracing/coverage.
Expand All @@ -67,21 +70,20 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.2.0
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- run: pip install --group dev -e .
- run: pytest --color=yes --no-cov
- run: uv sync --no-dev --group test
- run: uv run --no-sync pytest --color=yes --no-cov

coveralls-finish:
name: Finalize coveralls.io
needs: [unit-tests]
runs-on: ubuntu-26.04
steps:
- uses: actions/setup-python@v7
- run: pip install coveralls
- run: coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
continue-on-error: true
- name: Finish coverage at Coveralls.io
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
27 changes: 25 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ docs = [
"sphinx-llm>=0.1.4",
"furo",
]
dev = [
test = [
"async-timeout",
"codecov",
"coverage",
Expand All @@ -61,19 +61,42 @@ dev = [
"pytest-mock",
]
lint = [
{include-group = "dev"},
{include-group = "test"},
"mypy==2.3.1",
"pre-commit",
"isort",
]
dev = [
{include-group = "docs"},
{include-group = "lint"},
{include-group = "test"},
]

[tool.setuptools_scm]
version_file = "looptime/_version.py"

[tool.uv]
exclude-newer = "7 days"
# MyPy is pinned, so the intent is explicit, no need for time constraints.
exclude-newer-package = { mypy=false }

[tool.mypy]
strict = true
packages = ["looptime"]
exclude = ['(^|/)test_.*\.py$']
python_version = "3.11"
exclude_gitignore = true
warn_unused_configs = true
ignore_missing_imports = true

[tool.pytest]
minversion = "9.0"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
log_format = "%(asctime)s %(levelname)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
addopts = ["--strict-markers"]

[tool.isort]
line_length = 120
multi_line_output = 11
Expand Down
Loading