From 55f1599a7a1155d2471ea4b616564289e18a93be Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Fri, 29 Jul 2022 12:59:41 +0200 Subject: [PATCH] Setup tox --- .gitignore | 1 + .vscode/settings.json | 1 + .vscode/tasks.json | 22 +++++++++++++++++++--- pyproject.toml | 7 +++---- tox.ini | 13 +++++++++++++ 5 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index 679a4eb..837ce85 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ __pycache__ *.egg-info build tracing_database.json +.tox diff --git a/.vscode/settings.json b/.vscode/settings.json index 6bacb24..9554956 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -68,6 +68,7 @@ "**/.pytest_cache": true, "**/*.egg-info": true, "**/*.cache": true, + "**/*.tox": true, "**/tracing_database.json": true }, "notebook.output.textLineLimit": 400, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c6db301..2d97920 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -18,11 +18,27 @@ } }, { - "label": "Test", + "label": "Test (quick)", "type": "shell", - "command": "source .env/bin/activate && python3 -m pytest . --doctest-modules", + "command": "source .env/bin/activate && python3 -m pytest . --doctest-modules --asyncio-mode=strict", "windows": { - "command": ".env\\bin\\activate.bat; python3 -m pytest . --doctest-modules" + "command": ".env\\bin\\activate.bat; python3 -m pytest . --doctest-modules --asyncio-mode=strict" + }, + "group": "test", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "Test (all Python versions)", + "type": "shell", + "command": "source .env/bin/activate && python3 -m tox", + "windows": { + "command": ".env\\bin\\activate.bat; python3 -m tox" }, "group": "test", "presentation": { diff --git a/pyproject.toml b/pyproject.toml index 1e9b0cb..d4eaf67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Natural Language :: English", ] keywords = ["SE4ML", "MLOps", "AI engineering", "general", "robust", "end-to-end", "automated", "trustworthy", "ai", "deployment"] -requires-python = ">= 3.8" +requires-python = ">= 3.7" dependencies = [ "scikit-learn", "matplotlib", @@ -43,8 +43,7 @@ dependencies = [ "typeguard >= 2.10.0", "pymongo >= 4.0.0", "dill >= 0.3.5.0", - 'tqdm', - "async_lru >= 1.0.0", + "tqdm", "httpx >= 0.20.0", ] @@ -61,9 +60,9 @@ dev = [ "black[jupyter]", "mypy", "flake8", + "tox", "pytest", "pytest-cov", - "pytest-subtests", "pytest-asyncio", ] diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..f853c1f --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ +[tox] +envlist = py37,py38,py39,py310 +isolated_build = True + +[testenv] +alwayscopy = True +setenv = + PY_IGNORE_IMPORTMISMATCH = 1 +deps = + pytest + pytest-cov + pytest-asyncio +commands = pytest --doctest-modules --asyncio-mode=strict