Skip to content

Commit

Permalink
Merge pull request #29 from breezy-team/ruff
Browse files Browse the repository at this point in the history
Migrate to ruff
  • Loading branch information
jelmer authored Apr 14, 2024
2 parents df95fb7 + ba90047 commit b062865
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip cython
pip install -U pip flake8
pip install -U pip ruff
- name: Style checks
run: |
python -m flake8
python -m ruff check .
- name: Test suite run
run: |
python -m unittest fastbencode.tests.test_suite
Expand Down
2 changes: 1 addition & 1 deletion fastbencode/tests/test_bencode.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def test_unknown_object(self):
self.assertRaises(ValueError, self.module.bdecode, b'relwjhrlewjh')

def test_unsupported_type(self):
self._run_check_error(TypeError, float(1.5))
self._run_check_error(TypeError, 1.5)
self._run_check_error(TypeError, None)
self._run_check_error(TypeError, lambda x: x)
self._run_check_error(TypeError, object)
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ include-package-data = false
version = {attr = "fastbencode.__version__"}

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

[tool.ruff.lint]
select = [
"ANN",
"D",
Expand All @@ -50,7 +54,6 @@ select = [
"I",
"UP",
]
target-version = "py37"
ignore = [
"ANN001",
"ANN002",
Expand All @@ -65,7 +68,6 @@ ignore = [
"D105",
"D107",
]
line-length = 79

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
cython_version_info = Version(cython_version)
if cython_version_info < Version(minimum_cython_version):
print("Version of Cython is too old. "
"Current is {}, need at least {}.".format(
cython_version, minimum_cython_version))
f"Current is {cython_version}, "
f"need at least {minimum_cython_version}.")
print("If the .c files are available, they will be built,"
" but modifying the .pyx files will not rebuild them.")
have_cython = False
Expand Down

0 comments on commit b062865

Please sign in to comment.