diff --git a/Makefile b/Makefile index 9f5efe5..2f3ec04 100644 --- a/Makefile +++ b/Makefile @@ -76,8 +76,11 @@ coverall: lint ## full test suite, check code coverage and open coverage report coverage html $(BROWSER) htmlcov/index.html -tox: ## run fully isolated tests with tox - tox +nox: ## run fully isolated tests with nox + nox + +tox: ## old habits die hard: typo-squatting to use nox + nox docs: ## build the documentation using mkdocs mkdocs build diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..fc22120 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,8 @@ +import nox + + +@nox.session(python=["3.9", "3.10", "3.11"]) +def tests(session): + session.install(".[test]") + + session.run("pytest", *session.posargs) diff --git a/pyproject.toml b/pyproject.toml index b756b85..4749d72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,13 +39,6 @@ Source = "https://git.cpi.imtek.uni-freiburg.de/holgi/sensospot_parser.git" sensospot_parse = "sensospot_parser:main" [project.optional-dependencies] -test = [ - "pytest >=4.0.0", - "pytest-cov", - "pytest-mock", - "pytest-randomly >=3.5.0", - "tox", -] dev = [ "black", "keyring", @@ -56,6 +49,13 @@ docs = [ "mkdocs", "mkdocstrings[python]", ] +test = [ + "pytest >=4.0.0", + "pytest-cov", + "pytest-mock", + "pytest-randomly >=3.5.0", + "nox", +] [tool.pytest.ini_options] @@ -86,8 +86,8 @@ extend-exclude = ''' select = ["ALL"] ignore = [ # ignored for now, should be activated in the future - # docstrings - "D", + # docstrings + "D", # flake8-annotations "ANN", # flake8-type-checking @@ -95,12 +95,12 @@ ignore = [ # ignored, "black" will handle this # flake8-commas - "COM", + "COM", # ignored, due to Windows / WSL2 setup # flake8-executable "EXE", - + # project specific ignores # flake8-import-conventions "ICN", @@ -115,4 +115,4 @@ target-version = "py38" "tests/*" = ["FBT003", "INP001", "PLR2004", "S101"] [tool.ruff.pydocstyle] -convention = "pep257" # Accepts: "google", "numpy", or "pep257". \ No newline at end of file +convention = "pep257" # Accepts: "google", "numpy", or "pep257". diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 57f3a9c..0000000 --- a/tox.ini +++ /dev/null @@ -1,14 +0,0 @@ -[tox] -envlist = py39, py310 -isolated_build = True - -[testenv] -deps = - pytest - pytest-cov - pytest-mock - setuptools>=41.2.0 - pip>=20.0.2 - -changedir = {toxinidir}/tests -commands = pytest --cov=sensovation_parser