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
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E203, E501, W503
inline-quotes = double
max-line-length = 80
select = B,C,E,F,W,T4,B9
64 changes: 21 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Install package
run: poetry install
run: uv sync --group dev

- name: Run linters
run: poetry run pre-commit run -a
run: uv run pre-commit run -a

test:
name: Python ${{ matrix.python-version }} (${{ matrix.platform }})
Expand All @@ -41,57 +39,40 @@ jobs:
include:
- python-version: "3.10"
platform: ubuntu-latest
toxenv: py310
- python-version: "3.11"
platform: ubuntu-latest
toxenv: py311
- python-version: "3.12"
platform: ubuntu-latest
toxenv: py312
- python-version: "3.13"
platform: ubuntu-latest
toxenv: py313
- python-version: "3.14"
platform: ubuntu-latest
toxenv: py314
- python-version: "3.12"
platform: macos-latest
toxenv: py312
- python-version: "3.12"
platform: windows-latest
toxenv: py312

steps:
- uses: actions/checkout@v4

- name: Install python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Export PIPX_DEFAULT_PYTHON
shell: bash
run: echo "PIPX_DEFAULT_PYTHON=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV

- name: Install poetry
run: pipx install poetry

- name: Install tox
run: pipx install tox

- name: Install package
run: poetry install
- name: Install dependencies
run: uv sync --group dev

- name: Run tests
run: tox -e ${{ matrix.toxenv }}
run: uv run pytest --cache-clear --cov=src --cov-config=pyproject.toml --cov-report=term-missing --disable-pytest-warnings

- name: Run codecov
env:
CODECOV_TOKEN:
${{ secrets.CODECOV_TOKEN }}
run: tox -e codecov

CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
uv run coverage xml --ignore-errors
uv run codecov upload-process

release:
runs-on: ubuntu-latest
Expand All @@ -103,23 +84,20 @@ jobs:
with:
fetch-depth: 0

- name: Install python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Install package
run: poetry install
run: uv sync --group dev

- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "bugmon@mozilla.com"
git config --global user.name "semantic-release"
poetry run semantic-release -v version --no-changelog
poetry run semantic-release publish

uv run semantic-release -v version --no-changelog
uv run semantic-release publish
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@ repos:
hooks:
- id: black
name: black
entry: poetry run black --check --diff
entry: uv run black --check --diff
language: system
types: [ python ]
- id: flake8
name: flake8
entry: poetry run flake8
entry: uv run flake8
language: system
types: [ python ]
require_serial: true
- id: gitlint
name: gitlint
entry: poetry run gitlint
entry: uv run gitlint
language: system
args: [--contrib=contrib-title-conventional-commits, --ignore=body-is-missing, --msg-filename]
stages: [commit-msg]
- id: mypy
name: mypy
entry: poetry run mypy src
entry: uv run mypy src
language: system
pass_filenames: false
types: [ python ]
- id: pylint
name: pylint
entry: poetry run pylint -j 0 src
entry: uv run pylint -j 0 src
language: system
pass_filenames: false
types: [ python ]
- id: toml-sort
name: toml-sort
entry: poetry run toml-sort --check -a
- id: pyproject-fmt
name: pyproject-fmt
entry: uv run pyproject-fmt --check
files: "^pyproject\\.toml$"
language: system
Loading