diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index d21a7c3b..00000000 --- a/.coveragerc +++ /dev/null @@ -1,10 +0,0 @@ -[run] -source = dependency_injector -omit = tests/unit -plugins = Cython.Coverage - -[report] -show_missing = true - -[html] -directory=reports/unittests/ diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 679c86b4..00000000 --- a/.pylintrc +++ /dev/null @@ -1,49 +0,0 @@ -[MASTER] - -# Add to the black list. It should be a base name, not a -# path. You may set this option multiple times. -ignore=utils,tests - -[MESSAGES CONTROL] - -# Disable the message(s) with the given id(s). -# disable-msg= - -[SIMILARITIES] - -# Minimum lines number of a similarity. -min-similarity-lines=5 - -[TYPECHECK] -ignore-mixin-members=yes -# ignored-classes= -zope=no -# generated-members=providedBy,implementedBy,rawDataReceived - -[DESIGN] -# Maximum number of arguments for function / method -max-args=10 - -# Maximum number of locals for function / method body -max-locals=20 - -# Maximum number of return / yield for function / method body -max-returns=10 - -# Maximum number of branch for function / method body -max-branchs=10 - -# Maximum number of statements in function / method body -max-statements=60 - -# Maximum number of parents for a class (see R0901). -max-parents=10 - -# Maximum number of attributes for a class (see R0902). -max-attributes=30 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=0 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=30 diff --git a/Makefile b/Makefile index 7bbfb06b..84d0ef86 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ VERSION := $(shell python setup.py --version) +export COVERAGE_RCFILE := pyproject.toml clean: # Clean sources @@ -35,9 +36,9 @@ uninstall: test: # Unit tests with coverage report coverage erase - coverage run --rcfile=./.coveragerc -m pytest -c tests/.configs/pytest.ini - coverage report --rcfile=./.coveragerc - coverage html --rcfile=./.coveragerc + coverage run -m pytest -c tests/.configs/pytest.ini + coverage report + coverage html check: flake8 src/dependency_injector/ diff --git a/pyproject.toml b/pyproject.toml index 1f46515f..cf317aba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,3 +77,25 @@ dependency_injector = ["*.pxd", "*.pyi", "py.typed"] [tool.setuptools.dynamic] version = {attr = "dependency_injector.__version__"} + +[tool.coverage.run] +branch = false +relative_files = true +source_pkgs = ["dependency_injector"] +plugins = ["Cython.Coverage"] + +[tool.coverage.html] +directory = "reports/unittests/" + +[tool.coverage.report] +show_missing = true + +[tool.isort] +profile = "black" + +[tool.pylint.main] +ignore = ["tests"] + +[tool.pylint.design] +min-public-methods = 0 +max-public-methods = 30 diff --git a/requirements-dev.txt b/requirements-dev.txt index 9dbb9a7a..bc533741 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,6 +5,7 @@ pytest-asyncio tox coverage flake8 +flake8-pyproject pydocstyle sphinx_autobuild pip diff --git a/tox.ini b/tox.ini index 75a5020a..4e5d08aa 100644 --- a/tox.ini +++ b/tox.ini @@ -23,6 +23,8 @@ extras= yaml commands = pytest -c tests/.configs/pytest.ini python_files = test_*_py3*.py +setenv = + COVERAGE_RCFILE = pyproject.toml [testenv:.pkg] passenv = DEPENDENCY_INJECTOR_* @@ -37,8 +39,8 @@ deps= coveralls>=4 commands= coverage erase - coverage run --rcfile=./.coveragerc -m pytest -c tests/.configs/pytest.ini - coverage report --rcfile=./.coveragerc + coverage run -m pytest -c tests/.configs/pytest.ini + coverage report coveralls [testenv:pypy3.9] @@ -63,7 +65,7 @@ deps= flask<2.2 werkzeug<=2.2.2 commands= - - pylint -f colorized --rcfile=./.pylintrc src/dependency_injector + - pylint -f colorized src/dependency_injector [testenv:flake8] deps=