From fb3b920c47658c54743b2d046cdb8822a0c080fa Mon Sep 17 00:00:00 2001 From: bosd Date: Sun, 26 Nov 2023 22:57:59 +0100 Subject: [PATCH] fixups --- .github/workflows/main.yml | 4 +++- pyproject.toml | 25 +++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f04bb41..72408031 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,4 +25,6 @@ jobs: - name: Install testing dependencies run: | pip install -U wheel pip - pip install -U ".[test]" \ No newline at end of file + pip install -U ".[test]" + - name: Test with pytest + run: pytest diff --git a/pyproject.toml b/pyproject.toml index cdbf95f1..d6314c2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,9 +47,10 @@ ocr = ["imagemagick", "ghostscript", "tesseract-ocr"] pdfplumber = ["pdfplumber"] pdfminer = ["pdfminer.six"] ocrmypdf = ["ocrmypdf"] +test = ["pytest", "pytest-cov", "flake8", "pdfminer.six", "pdfplumber", "tox"] [options.extras_require] -test = ["pytest", "pytest-cov", "pdfminer.six", "pdfplumber", "tox"] +test = ["pytest", "pytest-cov", "flake8", "pdfminer.six", "pdfplumber", "tox"] # pyproject.toml [tool.pytest.ini_options] @@ -59,10 +60,21 @@ testpaths = [ "tests" ] +[tool.flake8] +ignore = ["E231", "E241", "E203"] +per-file-ignores = [ + "__init__.py:F401", +] +exclude = [ + "build", "dist", ".git", ".idea", ".cache", ".tox", ".eggs" + ] +max-line-length = 120 +count = true + [tool.tox] legacy_tox_ini = """ [tox] -envlist = py38,py39,py310,py312 +envlist = py38,py39,py310,py312,flake8 skip_missing_interpreters = True [testenv] @@ -70,14 +82,11 @@ deps = pytest >= 3.0.0, <4 commands = pytest extras = test +[testenv:flake8] +commands=flake8 src tests +extras = test """ -[tool.coverage.run] -branch = true -source = ["src"] - -[tool.coverage.report] -show_missing = true [tool.setuptools.dynamic] readme = {file = ["README.md"]}