diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e78093..ed50284 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,4 +49,4 @@ jobs: if: matrix.os == 'macos-latest' - name: Run pytest - run: pipx run tox -e py3 + run: pipx run tox -e test diff --git a/pyproject.toml b/pyproject.toml index 831c2dd..a84dcfc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + [tool.poetry] name = "httpie-credential-store" version = "3.1.0" @@ -14,7 +18,16 @@ python = "^3.8" httpie = "^3.1" keyring = ">= 23.5" -[tool.poetry.dev-dependencies] +[tool.poetry.group.lint] +optional = true + +[tool.poetry.group.lint.dependencies] +ruff = "^0.4.2" + +[tool.poetry.group.test] +optional = true + +[tool.poetry.group.test.dependencies] pytest = "^7.1" responses = "^0.20" @@ -22,10 +35,6 @@ responses = "^0.20" credential-store = "httpie_credential_store:CredentialStoreAuthPlugin" creds = "httpie_credential_store:CredsAuthPlugin" -[build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" - [tool.ruff] line-length = 100 target-version = "py38" diff --git a/tox.ini b/tox.ini index 342314f..ebe6493 100644 --- a/tox.ini +++ b/tox.ini @@ -1,17 +1,16 @@ [tox] -envlist = py3, lint +envlist = lint, test [testenv] -deps = poetry +allowlist_externals = poetry skip_install = true -commands = - poetry install -v - poetry run pytest -vv + +[testenv:test] +commands_pre = poetry install --with test +commands = poetry run pytest -vv {posargs:.} [testenv:lint] -skip_install = true -deps = - ruff >= 0.4.2, < 0.5.0 +commands_pre = poetry install --only lint commands = - ruff check {args:.} - ruff format --check --diff {args:.} + ruff check {posargs:.} + ruff format --check --diff {posargs:.}