Skip to content

Commit 5dbe56c

Browse files
committed
ruff does everything that flake8 does and better, so let's replace it
1 parent 2c1a22d commit 5dbe56c

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
python-version: ${{ matrix.python-version }}
2222
- name: Install dependencies
2323
run: |
24-
python -m pip install --upgrade pip setuptools flake8
24+
python -m pip install --upgrade pip setuptools ruff
2525
pip install -e '.[tests]'
2626
- name: Get versions
2727
run: |
2828
python -V
2929
pip freeze
30-
- name: flake8
31-
run: flake8 -v python_utils setup.py
30+
- name: ruff
31+
run: ruff check
3232
- name: pytest
3333
run: py.test
3434

@@ -44,12 +44,12 @@ jobs:
4444
- name: Install dependencies
4545
run: |
4646
python -m pip install --upgrade pip setuptools
47-
pip install -e '.[docs,tests]' pyright flake8 mypy
47+
pip install -e '.[docs,tests]' pyright ruff mypy
4848
- name: build docs
4949
run: make html
5050
working-directory: docs/
51-
- name: flake8
52-
run: flake8 -v python_utils setup.py
51+
- name: ruff
52+
run: ruff check
5353
- name: mypy
5454
run: mypy python_utils setup.py
5555
- name: pyright

CONTRIBUTING.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ Run tests
7474
$ py.test
7575
```
7676

77-
Note that this won't run `flake8` yet, so once all the tests succeed you can run `flake8` to check for code style errors.
77+
Note that this won't run `ruff` yet, so once all the tests succeed you can run `ruff check` to check for code style errors.
7878

7979
```bash
80-
$ flake8
80+
$ ruff check
81+
```
82+
83+
Lastly we test the types using `pyright`:
84+
85+
```bash
86+
$ pyright
8187
```

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
'python-utils',
5252
],
5353
'tests': [
54-
'flake8',
54+
'ruff',
55+
'pyright',
5556
'pytest',
5657
'pytest-cov',
5758
'pytest-mypy',

tox.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = ruff, black, py39, py310, py311, py312, py313, flake8, docs, mypy, pyright
2+
envlist = ruff, black, py39, py310, py311, py312, py313, docs, mypy, pyright
33
skip_missing_interpreters = True
44

55
[testenv]
@@ -30,11 +30,6 @@ basepython = python3
3030
deps = black
3131
commands = black --skip-string-normalization --line-length 79 {toxinidir}/setup.py {toxinidir}/_python_utils_tests {toxinidir}/python_utils
3232

33-
[testenv:flake8]
34-
basepython = python3
35-
deps = flake8
36-
commands = flake8 python_utils {posargs}
37-
3833
[testenv:pyright]
3934
basepython = python3
4035
deps =

0 commit comments

Comments
 (0)