From 750d3c07b6662cf4d67b478148494a193cae4967 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Thu, 13 Apr 2023 14:02:25 -0400 Subject: [PATCH] Update CI and toxfile to use new group structure --- .github/scripts/setup-env.sh | 9 ++++---- .github/workflows/ci.yaml | 6 ++++- Makefile | 2 +- tox.ini | 45 +++++++++++++++--------------------- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/.github/scripts/setup-env.sh b/.github/scripts/setup-env.sh index 55c493d..faefb32 100755 --- a/.github/scripts/setup-env.sh +++ b/.github/scripts/setup-env.sh @@ -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; diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8fcdbce..558ab7b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/Makefile b/Makefile index 4b14239..dd939ca 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tox.ini b/tox.ini index 5b946f6..5afcbaf 100644 --- a/tox.ini +++ b/tox.ini @@ -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