Skip to content

ci: updates #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 22, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: "1"

Expand Down Expand Up @@ -34,24 +38,20 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
run: pip install tox tox-gh-actions

- name: Test packaging
run: tox -e pkg

- name: Run tests with PyTest 6
run: tox
env:
PLATFORM: ${{ matrix.os }}
PYTEST_MAJOR_VERSION: 6
PYTEST_PLUGINS: pytest_github_actions_annotate_failures

- name: Run tests with PyTest 7
run: tox
env:
PLATFORM: ${{ matrix.os }}
PYTEST_MAJOR_VERSION: 7
PYTEST_PLUGINS: pytest_github_actions_annotate_failures

Expand Down
9 changes: 2 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -13,13 +13,8 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.262"
rev: "v0.7.0"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
15 changes: 4 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ changelog = "https://github.com/pytest-dev/pytest-github-actions-annotate-failur
pytest_github_actions_annotate_failures = "pytest_github_actions_annotate_failures.plugin"


[tool.ruff]
select = [
"E", "F", "W", # flake8
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
Expand All @@ -74,17 +73,11 @@ select = [
"YTT", # flake8-2020
"EXE", # flake8-executable
]
extend-ignore = [
ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
"PT004", # Use underscore for non-returning fixture (use usefixture instead)
]
target-version = "py37"
unfixable = [
"T20", # Removes print statements
"F841", # Removes unused variables
]
isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]
10 changes: 4 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{37,38,39,310,311,312}-pytest{6,7}-{linux,windows}
py{37,38,39,310,311,312}-pytest{6,7,8}
pkg

[gh-actions]
Expand All @@ -13,21 +13,19 @@ python =
3.12: py312

[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
windows-latest: windows

PYTEST_MAJOR_VERSION =
6: pytest6
7: pytest7
8: pytest8

[testenv]
deps =
-rrequirements.txt
pytest6: pytest>=6.0.0,<7.0.0
pytest7: pytest>=7.0.0,<7.4.0
pytest8: pytest>=8.0.0,<9.0.0

commands = {envpython} -m pytest
commands = {envpython} -m pytest {posargs}

[testenv:pkg]
skip_install = true
Expand Down