Replace flake8, black, pylint with ruff

For now pylint checks are disabled.

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
Povilas Kanapickas 2024-03-07 18:28:05 +02:00
parent e4e5b7d461
commit a5c354d60b
4 changed files with 24 additions and 43 deletions

View File

@ -5,37 +5,18 @@ on:
- pull_request - pull_request
jobs: jobs:
lint-black: lint-ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install psf/black requirements
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-venv
- uses: psf/black@stable
with:
options: "--check --verbose"
version: "~= 23.3"
lint-pylint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] python-version: ["3.11"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} - uses: actions/checkout@v3
uses: actions/setup-python@v4 name: Set up Python ${{ matrix.python-version }}
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Analysing the code with ruff
run: | run: |
python -m pip install --upgrade pip pip install -r test-requirements.txt
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi ruff format --check
pip install pylint
- name: Analysing the code with pylint
run: |
python -m compileall podman_compose.py
pylint podman_compose.py
# pylint $(git ls-files '*.py')

15
pyproject.toml Normal file
View File

@ -0,0 +1,15 @@
[tool.ruff]
line-length = 100
target-version = "py38"
[tool.ruff.lint]
select = ["W", "E", "F", "I"]
ignore = [
]
[tool.ruff.lint.isort]
force-single-line = true
[tool.ruff.format]
preview = true # needed for quote-style
quote-style = "preserve"

View File

@ -39,15 +39,7 @@ setup(
"pyyaml", "pyyaml",
"python-dotenv", "python-dotenv",
], ],
extras_require={ extras_require={"devel": ["ruff", "pre-commit", "coverage"]},
"devel": [
"flake8",
"black",
"pylint",
"pre-commit",
"coverage"
]
}
# test_suite='tests', # test_suite='tests',
# tests_require=[ # tests_require=[
# 'coverage', # 'coverage',

View File

@ -1,8 +1,7 @@
coverage==7.4.3 coverage==7.4.3
pytest==8.0.2 pytest==8.0.2
tox==4.13.0 tox==4.13.0
black==24.2.0 ruff==0.3.1
flake8==7.0.0
# The packages below are transitive dependencies of the packages above and are included here # The packages below are transitive dependencies of the packages above and are included here
# to make testing reproducible. # to make testing reproducible.
@ -13,19 +12,13 @@ flake8==7.0.0
cachetools==5.3.3 cachetools==5.3.3
chardet==5.2.0 chardet==5.2.0
click==8.1.7
colorama==0.4.6 colorama==0.4.6
distlib==0.3.8 distlib==0.3.8
filelock==3.13.1 filelock==3.13.1
iniconfig==2.0.0 iniconfig==2.0.0
mccabe==0.7.0
mypy-extensions==1.0.0
packaging==23.2 packaging==23.2
pathspec==0.12.1
platformdirs==4.2.0 platformdirs==4.2.0
pluggy==1.4.0 pluggy==1.4.0
pycodestyle==2.11.1
pyflakes==3.2.0
pyproject-api==1.6.1 pyproject-api==1.6.1
python-dotenv==1.0.1 python-dotenv==1.0.1
PyYAML==6.0.1 PyYAML==6.0.1