From 7f1b22dab398092599e5c1338d2c412d23a97b5b Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Fri, 14 Apr 2023 19:18:00 +0000 Subject: [PATCH] Fix unit/integration install --- CONTRIBUTING.md | 12 +++++++++--- pyproject.toml | 6 ++++++ tox.ini | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 15a765d71..d93b473af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,12 +20,18 @@ this operator. the `main` branch. This also avoids merge commits and creates a linear Git commit history. ## Developing +Install `tox` and `poetry` +```shell +python3 -m pip install --user pipx +python3 -m pipx ensurepath +pipx install tox +pipx install poetry +``` -You can create an environment for development with `tox`: +You can create an environment for development: ```shell -tox devenv -e integration -source venv/bin/activate +poetry install ``` ### Testing diff --git a/pyproject.toml b/pyproject.toml index 1b3085e3e..c60b59ca7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,10 +17,16 @@ jsonschema = "^4.17.3" boto3 = "^1.26.113" cosl = "^0.0.5" +[tool.poetry.group.format] +optional = true + [tool.poetry.group.format.dependencies] black = "^23.3.0" isort = "^5.12.0" +[tool.poetry.group.lint] +optional = true + [tool.poetry.group.lint.dependencies] black = "^23.3.0" isort = "^5.12.0" diff --git a/tox.ini b/tox.ini index 405c599d0..1e32c3313 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,7 @@ commands = [testenv:unit] description = Run unit tests commands_pre = - poetry install --only unit + poetry install --only main,unit commands = poetry run coverage run --source={[vars]src_path},{[vars]lib_path} \ -m pytest -v --tb native -s {posargs} {[vars]tests_path}/unit @@ -71,6 +71,6 @@ pass_env = GCP_ACCESS_KEY GCP_SECRET_KEY commands_pre = - poetry install --only lint + poetry install --only main,integration commands = poetry run pytest -v --tb native --log-cli-level=INFO -s --ignore={[vars]tests_path}/unit/ {posargs}