Skip to content

Commit

Permalink
COM-12568: Replace pylint/black with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
rgonzalezfluendo authored and mdimopoulos committed Nov 14, 2024
1 parent 5e0db26 commit e782ae7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.6
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.6
python-version: 3.7
- name: Install dependencies
run: |
make install_deps
Expand All @@ -32,14 +32,14 @@ jobs:
pip wheel .
linux:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.13
- name: Install dependencies
run: |
make install_deps
Expand All @@ -56,10 +56,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.6
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.6
python-version: 3.7
- name: Install dependencies
run: |
make install_deps
Expand Down
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,17 @@ ifneq ($(OS),Windows_NT)
endif
@echo "\nAll test finished succesfully!"

format: ## format Python code using black
@echo "Formatting coding style with black..."
black $(PY_FILES)
format: ## format python code using ruff
@echo "Formatting coding style with ruff..."
ruff format --fix $(PY_FILES)

format-check:
@echo "Checking coding style with black... Run '$(MAKE) format' to fix if needed"
black --check $(PY_FILES)

lint: format-check ## run static analysis using pylint, flake8 and mypy
# ignore similar lines error: it's a bug when running parallel jobs - https://github.com/PyCQA/pylint/issues/4118
@echo "Checking with pylint... "
pylint --fail-under=10.0 $(PY_FILES)
@echo "Checking with flake8..."
flake8 --max-line-length=120 $(PY_FILES)
@echo "Checking coding style with ruff... Run '$(MAKE) format' to fix if needed"
ruff format $(PY_FILES)

lint: format-check ## run static python code analysis using ruff and mypy
@echo "Checking with ruff... "
ruff check $(PY_FILES)
@echo "Checking with mypy..."
mypy --strict $(PY_FILES)

Expand Down
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ maintainers = [
description = "Testing framework for decoder conformance"
readme = "README.md"
license = {file = "LICENSE"}
requires-python = ">=3.6"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.13",
"Topic :: Multimedia",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Video",
Expand Down Expand Up @@ -80,11 +80,13 @@ packages = ["fluster", "fluster.decoders"]

[project.optional-dependencies]
dev = [
"black",
"pylint",
"flake8",
"ruff",
"mypy"
]

[tool.ruff]
line-length = 120
target-version = "py37"

[project.scripts]
fluster = "fluster.main:fluster_main"
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
black
pylint
flake8
ruff
mypy

0 comments on commit e782ae7

Please sign in to comment.