diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index d2404cf..a2b5ebb 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index b183d08..5b752ba 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -15,9 +15,9 @@ jobs: python-version: ['3.8', '3.9', '3.10'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -45,9 +45,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.8' - name: Install dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9e59bfd..a14d001 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,17 +21,15 @@ jobs: python-version: ['3.8', '3.9', '3.10'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install pytest flake8 - pip install . + pip install ".[test]" - name: Check code style with flake8 (lint) run: | @@ -49,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Docker build run: docker build -f docker/Dockerfile -t libretranslate . diff --git a/pyproject.toml b/pyproject.toml index 10b56c2..fb90855 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,6 @@ dependencies = [ "prometheus-client ==0.15.0", "polib ==1.1.1", ] -# package_data={'': ['static/*', 'static/**/*', 'templates/*', 'locales/**/meta.json', 'locales/**/**/*.mo']}, [project.scripts] libretranslate = "libretranslate.main:main" @@ -65,8 +64,9 @@ ltmanage = "libretranslate.manage:manage" [project.optional-dependencies] test = [ "pytest >=7.2.0", - "pytest-runner", "pytest-cov", + "flake8", + # "pytest-runner", # "mypy >=1.4.1", "types-requests", ] @@ -94,7 +94,7 @@ lint = [ # "ruff --fix", ] fmt = [ - "ruff --fix", + "ruff libretranslate scripts --fix", # "mypy", ] test = [ @@ -159,10 +159,11 @@ select = [ ignore = [ # "E741", # "B008", # do not perform function calls in argument defaults (required for FastAPI afaik) - # "E501", # line too long + "E501", # line too long # "C901", # too complex - # "S101", # Use of `assert` detected - # "T201", "T203", # remove print and pprint + "S101", # Use of `assert` detected + "T201", "T203", # remove print and pprint + "E402", # Module level import not at top of file ] [tool.ruff.per-file-ignores] @@ -170,7 +171,7 @@ ignore = [ [tool.ruff.mccabe] -max-complexity = 10 +max-complexity = 12 # [flake8] ignore = E741