mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-21 15:31:00 +00:00
Update checkout and setup-python actions version in workflow and improve ruff config
This commit is contained in:
parent
f0943dada1
commit
19fb149112
4 changed files with 17 additions and 18 deletions
2
.github/workflows/publish-docker.yml
vendored
2
.github/workflows/publish-docker.yml
vendored
|
@ -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
|
||||
|
|
8
.github/workflows/publish-package.yml
vendored
8
.github/workflows/publish-package.yml
vendored
|
@ -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
|
||||
|
|
10
.github/workflows/run-tests.yml
vendored
10
.github/workflows/run-tests.yml
vendored
|
@ -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 .
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue