Skip to content

Commit

Permalink
Switch from flake8 + isort + pylint to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
akx authored and gentooboontoo committed Nov 21, 2023
1 parent 6f83186 commit 816945b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 271 deletions.
3 changes: 0 additions & 3 deletions .isort.cfg

This file was deleted.

249 changes: 0 additions & 249 deletions .pylintrc

This file was deleted.

3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ clean:
rm -fr *.egg-info

lint:
$(FLAKE8) $(PROJECT_NAME)
$(PYTEST) --isort -m isort $(PROJECT_NAME)
$(RUFF) $(PROJECT_NAME)

fix:
$(VENV)/bin/yapf -p -i pygal/**/*.py
Expand Down
2 changes: 1 addition & 1 deletion Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PROJECT_NAME = pygal
# Python env
PYTHON_VERSION ?= python
VENV = $(PWD)/.env$(if $(filter $(PYTHON_VERSION),python),,-$(PYTHON_VERSION))
FLAKE8 = $(VENV)/bin/flake8
RUFF = $(VENV)/bin/ruff
PIP = $(VENV)/bin/pip
PYTHON = $(VENV)/bin/python
PYTEST = $(VENV)/bin/py.test
Expand Down
23 changes: 23 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
extend-select = [
"E",
"F",
"I",
"W",
"PLC",
"PLE",
"PLW",
# "PLR", # TODO: enable?
]

ignore = [
"E731",
"E741",
"PLW2901", # TODO: do not ignore?
"PLW3301", # TODO: do not ignore?
]

[per-file-ignores]
"pygal/__init__.py" = [
"E402",
"F401",
]
10 changes: 0 additions & 10 deletions setup.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def run_tests(self):
tests_requirements = [
"pyquery", "flask", 'cairosvg', 'lxml', 'pygal_maps_world', 'pygal_maps_fr',
'pygal_maps_ch', 'coveralls',
'flake8',
'pytest-runner', 'pytest-cov', 'pytest-isort',
'ruff',
'pytest-runner', 'pytest-cov',
'pytest'
]

Expand Down
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ envlist = py38,py39,py310,py311,py312,pypy

[testenv]
deps =
flake8
pytest
coverage
lxml
Expand All @@ -12,10 +11,9 @@ deps =

setenv =
COVERAGE_FILE=.cov-{envname}

commands =
coverage run --source=pygal {envbindir}/py.test {posargs:pygal/test} --junitxml=junit-{envname}.xml
coverage xml -o coverage-{envname}.xml
coverage run --source=pygal {envbindir}/py.test {posargs:pygal/test} --junitxml=junit-{envname}.xml
coverage xml -o coverage-{envname}.xml

[gh]
python =
Expand Down

0 comments on commit 816945b

Please sign in to comment.