Skip to content

Commit

Permalink
Run flake8 and isort separately
Browse files Browse the repository at this point in the history
The old pytest command had issues with relative .. imports and requires flake8 to be pinned to <4.
PyCQA/flake8#1419
tholo/pytest-flake8#81
  • Loading branch information
sherbang committed Jan 4, 2022
1 parent 70a4ed4 commit fc7b1db
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ flake8 = "*"
isort = "*"
pipfile = "*"
pytest = "*"
pytest-flake8 = "*"
pytest-isort = "*"
python-dotenv = "*"
sh = "*"
4 changes: 1 addition & 3 deletions dev-scripts/build-python.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def run_command(*args):
# https://gitlab.com/gozynta/gcloud-tagging-docker/-/blob/master/gitlab-ci-template.yml
run_command("isort", "-c", source_dir)
run_command("black", "--check", "--diff", "--color", source_dir)

# Lint source only (Uses pytest-isort and pytest-flake8)
run_command("pytest", source_dir, "--ignore", test_dir)
run_command("flake8", source_dir, test_dir)

# Run tests under coverage
run_command("coverage", "run", f"--source={source_dir}", "-m", "pytest", test_dir)
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ max-line-length = 119
# so if you add a pytest config section elsewhere,
# you will need to delete this section from setup.cfg.
addopts =
--isort
--flake8
--cache-clear
norecursedirs =
.git
Expand Down

0 comments on commit fc7b1db

Please sign in to comment.