Skip to content

Commit

Permalink
Fix failing CI
Browse files Browse the repository at this point in the history
The `pytest-flake8` plugin broke with a recent update of `flake8`.
According to this thread: pytest-dev/pytest#9217 (comment)
running these kinds of checks within `pytest` is an anti-pattern and should be avoided.
So I've moved `black`, `mypy`, and `flake8` checks away from their pytest plugins.
  • Loading branch information
robertodr committed Aug 17, 2022
1 parent b7002cb commit 93b9a79
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ jobs:
- name: Flake8 lints
run: |
python -m pytest --flake8 parselglossy
python -m flake8 parselglossy
- name: Black lints
run: |
python -m pytest --black parselglossy
python -m black --check parselglossy
- name: Mypy lints
run: |
python -m pytest --mypy parselglossy
python -m mypy parselglossy
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
5 changes: 3 additions & 2 deletions parselglossy/grammars/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@

try:
import pyparsing as pp

if pp.__version__.split(".")[0] < "3":
# Import local copy
from . import pyparsing as pp # type: ignore
# Import local copy
from . import pyparsing as pp # type: ignore
except ImportError:
# Import local copy
from . import pyparsing as pp # type: ignore
Expand Down
5 changes: 3 additions & 2 deletions parselglossy/grammars/getkw.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@

try:
import pyparsing as pp

if pp.__version__.split(".")[0] < "3":
# Import local copy
from . import pyparsing as pp # type: ignore
# Import local copy
from . import pyparsing as pp # type: ignore
except ImportError:
# Import local copy
from . import pyparsing as pp # type: ignore
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ test = [
"coverage",
"hypothesis",
"pytest",
"pytest-black",
"pytest-cov",
"pytest-flake8",
"pytest-mypy",
"pytest-sugar",
]
dev = [
Expand Down

0 comments on commit 93b9a79

Please sign in to comment.