Skip to content

Commit

Permalink
Merge pull request #5 from BrainLesion/4-update-test-action-do-use-po…
Browse files Browse the repository at this point in the history
…etry-by-default

Migrate test action to poetry
  • Loading branch information
MarcelRosier authored Oct 8, 2024
2 parents 01a296b + c64db4f commit 31096bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov
pip install -e .
python -m pip install poetry
python -m poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
python -m poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
python -m poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# TODO adapt package_name to the name of your package
- name: Test with pytest
run: |
pytest --cov package_name
python -m poetry run pytest --cov package_name
# Add the following block to upload coverage to Codecov, requires a CODECOV_TOKEN secret to be set in the repository
# - name: Upload results to Codecov
# # Only upload to Codecov after a merge to the main branch
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ python = ">=3.9"
[tool.poetry.dev-dependencies]
pytest = ">=8.0.0"
pytest-cov = ">=5.0.0"
flake8 = ">=4.0.1"

[tool.poetry.group.docs]
optional = true
Expand Down

0 comments on commit 31096bb

Please sign in to comment.