Skip to content

Commit

Permalink
[issue_4] implement review comments
Browse files Browse the repository at this point in the history
- add slash to directories in .gitignore
- make output from linter_and_formatting.sh consistent
- make black, isort, and flake8 dev-dependencies
- add configuration for pytest
- rename workflow
- add comment to clarify steps for poetry install

Signed-off-by: Meret Behrens <[email protected]>
  • Loading branch information
meretp committed Mar 14, 2023
1 parent 0f2f240 commit b3160b3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

name: Install and Run tests

name: Lint and Test
on:
push:
branches:
Expand Down Expand Up @@ -45,6 +44,8 @@ jobs:
path: .venv
key: pydeps-${{ matrix.os}}-${{matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

# We use a cache for the projects dependencies but want to avoid caching the projects code.
# --no-root installs all dependencies but not the project itself which we do in the next step.
- name: Install package dependencies
run: poetry install --no-interaction --no-root
if: steps.cache--deps.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -96,6 +97,8 @@ jobs:
path: .venv
key: pydeps-${{ matrix.os}}-${{matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

# We use a cache for the projects dependencies but want to avoid caching the projects code.
# --no-root installs all dependencies but not the project itself which we do in the next step.
- name: Install package dependencies
run: poetry install --no-interaction --no-root
if: steps.cache--deps.outputs.cache-hit != 'true'
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
__pycache__
__pycache__/

# test
.pytest_cache
.pytest_cache/

.DS_Store
.idea/*
.python-version
.vscode/*

.mypy_cache
.mypy_cache/

.venv
.venv/
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ python = "^3.7"

[tool.poetry.group.test.dependencies]
pytest = "^6.0.0"

[tool.poetry.group.typing.dependencies]
black = "^23.1.0"
isort = "^5.11"
flake8 = "^5"
mypy = "^1.1.1"

[tool.poetry.group.typing.dependencies]
mypy = ">=1.0"

[virtualenvs]
in-project = true

Expand All @@ -37,3 +36,6 @@ profile = "black"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true

[tool.pytest.ini_options]
testpaths = ["tests"]
1 change: 1 addition & 0 deletions scripts/linter_and_formatting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ echo "-----------------------"
poetry run black src/ tests/

echo "run flake"
echo "-----------------------"
poetry run flake8 src/ tests/

echo "running mypy"
Expand Down

0 comments on commit b3160b3

Please sign in to comment.