Update CI and toxfile to use new group structure

This commit is contained in:
Ethan Paul 2023-04-13 14:02:25 -04:00
parent ac342d4dc6
commit 750d3c07b6
4 changed files with 29 additions and 33 deletions

View File

@ -8,7 +8,7 @@
set -e;
CI_CACHE=$HOME/.cache;
POETRY_VERSION=1.2.2;
INSTALL_POETRY_VERSION="${POETRY_VERSION:-1.4.1}";
mkdir --parents "$CI_CACHE";
@ -26,9 +26,10 @@ poetry --version --no-ansi;
poetry run pip --version;
poetry install \
--quiet \
--remove-untracked \
--no-ansi;
--sync \
--no-ansi \
--no-root \
--only ci;
poetry env info;
poetry run tox --version;

View File

@ -5,9 +5,11 @@ on:
types: ["opened", "synchronize"]
push:
branches: ["devel"]
env:
POETRY_VERSION: 1.4.1
jobs:
Test:
name: Test with Python ${{ matrix.python.version }}
name: Python ${{ matrix.python.version }}
runs-on: ubuntu-latest
strategy:
matrix:
@ -20,6 +22,8 @@ jobs:
toxenv: py39
- version: "3.10"
toxenv: py310
- version: "3.11"
toxenv: py311
fail-fast: true
steps:
- name: Checkout

View File

@ -39,5 +39,5 @@ publish: clean test build ## Build and upload to pypi (requires $PYPI_API_KEY be
@poetry publish --username __token__ --password $(PYPI_API_KEY)
dev: ## Create local dev environment
poetry install --sync
poetry install --sync --with dev --with ci --with test --with security --with static
poetry run pre-commit install

45
tox.ini
View File

@ -11,11 +11,8 @@ skip_missing_interpreters = true
description = Run the tests
require_locked_deps = true
require_poetry = true
locked_deps =
pytest
pytest-cov
ruamel.yaml
toml
poetry_dep_groups =
test
commands =
pytest {toxinidir}/tests/ \
--cov peewee_plus \
@ -26,16 +23,8 @@ commands =
description = Static formatting and quality enforcement
basepython = python3.10
ignore_errors = true
locked_deps =
black
blacken-docs
mdformat
mdformat-gfm
mypy
reorder-python-imports
pre-commit
pre-commit-hooks
pylint
poetry_dep_groups =
static
commands =
pre-commit run \
--all-files
@ -49,11 +38,9 @@ commands =
description = Static formatting and quality enforcement for the tests
basepython = python3.10
ignore_errors = true
locked_deps =
mypy
pylint
pytest
types-toml
poetry_dep_groups =
static
test
commands =
pylint {toxinidir}/tests/ \
--rcfile {toxinidir}/.pylintrc
@ -66,10 +53,8 @@ description = Security checks
basepython = python3.10
skip_install = true
ignore_errors = true
locked_deps =
bandit
safety
poetry
poetry_dep_groups =
security
commands =
bandit {toxinidir}/peewee_plus.py \
--recursive \
@ -82,7 +67,13 @@ commands =
--format requirements.txt \
--output {envtmpdir}/requirements.txt \
--without-hashes \
--dev
--with ci \
--with test \
--with security \
--with static \
--with dev
safety check \
--json \
--file {envtmpdir}/requirements.txt
--file {envtmpdir}/requirements.txt \
--output text \
# https://github.com/pytest-dev/py/issues/287
--ignore 51457