diff --git a/.devcontainer.json b/.devcontainer.json index 93402104..bc20e1b9 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,7 +1,7 @@ { "name": "NabuCasa SniTun Dev", "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.8", - "postCreateCommand": "python3 -m pip install -e .[test]", + "postCreateCommand": "python3 -m pip install -e .[test,lint]", "postStartCommand": "python3 -m pip install -e .", "containerUser": "vscode", "containerEnv": { diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 331b3fc0..62e369df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,11 @@ jobs: - name: Install dependencies shell: bash run: | - pip install tox - - name: Run Tox + python3 -m pip install -e .[lint] + - name: Lint shell: bash run: | - tox -e lint,black + scripts/lint build: runs-on: ubuntu-latest @@ -46,8 +46,8 @@ jobs: - name: Install dependencies shell: bash run: | - pip install tox - - name: Run Tox + python3 -m pip install -e .[test] + - name: Test shell: bash run: | - tox -e tests + scripts/test diff --git a/pyproject.toml b/pyproject.toml index b0dbd1c6..45af2f98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,13 +35,15 @@ requires-python = ">=3.8" version = "0.36.2" [project.optional-dependencies] -test = [ - "flake8==6.1.0", +lint = [ + "aiohttp==3.9.3", + "black==23.11.0", "pylint==3.0.2", - "pytest==7.4.3", - "pytest-timeout==2.2.0", +] +test = [ "pytest-aiohttp==1.0.5", - "black==23.11.0", + "pytest-timeout==2.2.0", + "pytest==7.4.3", ] [project.urls] @@ -67,30 +69,6 @@ sections = [ ] use_parentheses = true -[tool.tox] -legacy_tox_ini = """ - [tox] - envlist = lint, tests, black - - [testenv] - basepython = python3 - deps = - -e '.[test]' - - [testenv:lint] - ignore_errors = True - commands = - pylint snitun - - [testenv:tests] - commands = - pytest tests - - [testenv:black] - commands = - black --target-version py38 --check snitun tests -""" - [tool.pylint.BASIC] disable = [ "abstract-method", diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 00000000..7a7aa292 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,6 @@ +#!/bin/sh + +cd "$(dirname "$0")/.." + +python3 -m black --target-version py38 --check snitun tests +python3 -m pylint snitun diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..2b5b7a49 --- /dev/null +++ b/scripts/test @@ -0,0 +1,5 @@ +#!/bin/sh + +cd "$(dirname "$0")/.." + +python3 -m pytest