From a036087457e4d953849fe29d10212639adae7e48 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:03:01 +0000 Subject: [PATCH] Apply updates from cookiecutter This automated commit applies the latest updates from our cookiecutters [1] to this repo. [1]: https://github.com/hypothesis/cookiecutters --- .github/workflows/ci.yml | 2 ++ pyproject.toml | 4 ++-- setup.cfg | 1 - tests/pyproject.toml | 4 ++-- tox.ini | 10 ++++++---- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b194864..e15fb56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,8 @@ jobs: python-version: ${{ matrix.python-version }} - run: python -m pip install 'tox<4' - run: tox -e tests + env: + COVERAGE_FILE: .coverage.${{ matrix.python-version }} - name: Upload coverage file uses: actions/upload-artifact@v3 with: diff --git a/pyproject.toml b/pyproject.toml index bdb0861..47cc225 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,9 +74,7 @@ jobs = 0 # Use one process for CPU. load-plugins = [ "pylint.extensions.bad_builtin", "pylint.extensions.check_elif", - "pylint.extensions.comparetozero", "pylint.extensions.docparams", - "pylint.extensions.emptystring", "pylint.extensions.mccabe", "pylint.extensions.overlapping_exceptions", "pylint.extensions.redefined_variable_type", @@ -95,6 +93,8 @@ enable = [ "deprecated-pragma", "useless-suppression", "use-symbolic-message-instead", + "use-implicit-booleaness-not-comparison-to-zero", + "use-implicit-booleaness-not-comparison-to-string", ] disable = [ # Docstrings are encouraged but we don't want to enforce that everything diff --git a/setup.cfg b/setup.cfg index 5bb96db..d2797ac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,6 @@ package_dir = packages = find: python_requires = >=3.8 install_requires = - importlib_metadata;python_version<"3.8." sentry-sdk pyramid diff --git a/tests/pyproject.toml b/tests/pyproject.toml index 4b374da..f3a7c5e 100644 --- a/tests/pyproject.toml +++ b/tests/pyproject.toml @@ -4,9 +4,7 @@ jobs = 0 # Use one process for CPU. load-plugins = [ "pylint.extensions.bad_builtin", "pylint.extensions.check_elif", - "pylint.extensions.comparetozero", "pylint.extensions.docparams", - "pylint.extensions.emptystring", "pylint.extensions.mccabe", "pylint.extensions.overlapping_exceptions", "pylint.extensions.redefined_variable_type", @@ -25,6 +23,8 @@ enable = [ "deprecated-pragma", "useless-suppression", "use-symbolic-message-instead", + "use-implicit-booleaness-not-comparison-to-zero", + "use-implicit-booleaness-not-comparison-to-string", ] disable = [ # Docstrings are encouraged but we don't want to enforce that everything diff --git a/tox.ini b/tox.ini index 617517d..a0b637b 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,7 @@ setenv = dev: NEW_RELIC_ENVIRONMENT = {env:NEW_RELIC_ENVIRONMENT:dev} dev,tests,functests: PYTHONDEVMODE = {env:PYTHONDEVMODE:1} tests,functests: PYTEST_PLUGINS = tests.pytest_plugins.factory_boy + tests: COVERAGE_FILE = {env:COVERAGE_FILE:.coverage.{envname}} passenv = HOME PYTEST_ADDOPTS @@ -31,12 +32,13 @@ deps = format,checkformatting: black format,checkformatting: isort lint: toml - lint: pylint + lint: pylint>=3.0.0 lint: pydocstyle lint: pycodestyle lint,tests: pytest-mock - lint,tests,coverage: coverage[toml] lint,tests,functests: pytest + tests: pytest-coverage + coverage: coverage[toml] lint,tests,functests: factory-boy lint,tests,functests: pytest-factoryboy lint,tests,functests: h-matchers @@ -56,8 +58,8 @@ commands = lint: pylint --rcfile=tests/pyproject.toml tests lint: pydocstyle src tests bin lint: pycodestyle src tests bin - tests: coverage run -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/unit/} + tests: python -m pytest --cov --cov-report= --cov-fail-under=0 --failed-first --new-first --no-header --quiet {posargs:tests/unit/} functests: python -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/functional/} - coverage: -coverage combine + coverage: coverage combine coverage: coverage report template: python3 bin/make_template {posargs}