Skip to content

Commit

Permalink
Use the distro's poetry
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Dec 11, 2023
1 parent 592a56c commit 12523c0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,39 @@ name: Run Tox tests
jobs:
tests-misc:
name: Misc tests 🚦
runs-on: ubuntu-latest
container: fedorapython/fedora-python-tox:latest
steps:
- uses: actions/checkout@v4
- name: Run tests
uses: fedora-python/tox-github-action@main
with:
tox_env: ${{ matrix.tox_env }}
- name: Install dependencies
run: |
dnf install -y git
pip install poetry>=1.2
- name: Mark the working directory as safe for Git
run: git config --global --add safe.directory $PWD
- name: Run the tests
run: tox -e ${{ matrix.tox_env }}
strategy:
matrix:
tox_env:
- lint
- format
- security
runs-on: ubuntu-latest

tests-unit:
name: Unit tests 🚦
runs-on: ubuntu-latest
container: fedorapython/fedora-python-tox:latest
steps:
- uses: actions/checkout@v4
- name: Run tests
uses: fedora-python/tox-github-action@main
with:
tox_env: ${{ matrix.tox_env }}
- name: Install dependencies
run: |
dnf install -y git
pip install poetry>=1.2
- name: Mark the working directory as safe for Git
run: git config --global --add safe.directory $PWD
- name: Run the tests
run: tox -e ${{ matrix.tox_env }}
strategy:
matrix:
tox_env:
Expand All @@ -38,7 +49,6 @@ jobs:
- py311
- flask1
- flask2
runs-on: ubuntu-latest

# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
build:
Expand Down
19 changes: 8 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ isolated_build = true
passenv = HOME
sitepackages = false
skip_install = true
# Use allowlist for poetry when poetry 1.2+ is more widespread
# allowlist_externals =
# poetry
deps =
poetry>=1.2
allowlist_externals =
poetry
commands_pre =
poetry install
poetry install --all-extras
commands =
poetry run pytest -vv --cov --cov-report=html --cov-report=xml --cov-report=term-missing flask_healthz {posargs}

Expand All @@ -34,17 +31,17 @@ commands =

[testenv:lint]
commands =
pre-commit run --all-files flake8
poetry run pre-commit run --all-files flake8

[testenv:format]
commands =
pre-commit run --all-files black
pre-commit run --all-files isort
poetry run pre-commit run --all-files black
poetry run pre-commit run --all-files isort

[testenv:security]
commands =
pre-commit run --all-files bandit
pre-commit run --all-files safety
poetry run pre-commit run --all-files bandit
poetry run pre-commit run --all-files safety


[flake8]
Expand Down

0 comments on commit 12523c0

Please sign in to comment.