Skip to content

Commit

Permalink
Move from flake8, black, and isort to ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
luhn committed Oct 18, 2024
1 parent 0930d26 commit 5572e1b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 22 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Install
run: pip install .[linting]
- name: Flake8
run: flake8 pyramid_tasks tests
- name: Black
run: black --check pyramid_tasks tests
- name: isort
run: isort --check pyramid_tasks tests
- name: Lint
run: ruff check pyramid_tasks tests
- name: Format
run: ruff format --check pyramid_tasks tests
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

lint:
isort pyramid_tasks tests
black pyramid_tasks tests
flake8 pyramid_tasks tests
ruff check pyramid_tasks tests
ruff format --check pyramid_tasks tests

format:
ruff format pyramid_tasks tests

test:
pytest tests
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ requires = [
]
build-backend = "setuptools.build_meta"

[tool.black]
[tool.ruff]
line-length = 79
target-version = "py38"

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 79
[tool.ruff.lint]
select = [
"E", # flake8
"F", # pyflakes
"T20", # flake8-print
"I", # isort
]
3 changes: 1 addition & 2 deletions pyramid_tasks/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def on_preload_parsed(options, **kwargs):
ini_location = options["ini"]
ini_vars = options["ini_var"]
if ini_location is None:
print("You must provide the --ini argument")
print("You must provide the --ini argument") # noqa: T201
exit(-1)

options = {}
Expand All @@ -40,5 +40,4 @@ def on_preload_parsed(options, **kwargs):

set_global_app(celery)
# We don't do anything with this, just want to trigger configuration.
print(ini_location)
get_app(ini_location, options=options)
1 change: 1 addition & 0 deletions pyramid_tasks/taskderivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Task derivers are the task analog of Pyramid's view derivers.
"""

from pyramid.interfaces import PHASE0_CONFIG
from pyramid.util import TopologicalSorter

Expand Down
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ testing =
transaction~=5.0
zope.sqlalchemy~=3.1
linting =
black~=22.3
flake8~=4.0.1
isort~=5.10
ruff~=0.7.0
1 change: 1 addition & 0 deletions tests/pkgs/venusianapp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Test adding a task via venusian.
"""

from pyramid_tasks import task


Expand Down

0 comments on commit 5572e1b

Please sign in to comment.