Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: From black/pylint to ruff #161

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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