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

View File

@ -5,9 +5,11 @@ on:
types: ["opened", "synchronize"] types: ["opened", "synchronize"]
push: push:
branches: ["devel"] branches: ["devel"]
env:
POETRY_VERSION: 1.4.1
jobs: jobs:
Test: Test:
name: Test with Python ${{ matrix.python.version }} name: Python ${{ matrix.python.version }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
@ -20,6 +22,8 @@ jobs:
toxenv: py39 toxenv: py39
- version: "3.10" - version: "3.10"
toxenv: py310 toxenv: py310
- version: "3.11"
toxenv: py311
fail-fast: true fail-fast: true
steps: steps:
- name: Checkout - 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) @poetry publish --username __token__ --password $(PYPI_API_KEY)
dev: ## Create local dev environment 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 poetry run pre-commit install

45
tox.ini
View File

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