Skip to content

Commit

Permalink
Replace black and flake8 with ruff (#35)
Browse files Browse the repository at this point in the history
It’s simpler to use and has fewer dependencies.
  • Loading branch information
remcohaszing committed Feb 17, 2024
1 parent cb32b15 commit da59af7
Show file tree
Hide file tree
Showing 8 changed files with 411 additions and 619 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ on:
tags: ['*']

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install poetry
- run: poetry install
- run: poetry run black --check .

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -32,7 +21,7 @@ jobs:
name: dist
path: dist/

flake8:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -41,9 +30,9 @@ jobs:
python-version: '3.10'
- run: pip install poetry
- run: poetry install
- run: poetry run flake8
- run: poetry run mypy .

mypy:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -52,7 +41,8 @@ jobs:
python-version: '3.10'
- run: pip install poetry
- run: poetry install
- run: poetry run mypy .
- run: poetry run ruff check
- run: poetry run ruff format --check

unittest:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -81,10 +71,9 @@ jobs:
publish:
runs-on: ubuntu-latest
needs:
- black
- build
- flake8
- mypy
- ruff
- unittest
if: startsWith(github.ref, 'refs/tags/')
steps:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.coverage
*.lcov
.mypy_cache/
__pycache__/
*cache*/
_build/
dist/
22 changes: 11 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
import pkg_resources


project = "wakeonlan"
project = 'wakeonlan'
_dist = pkg_resources.get_distribution(project)

version = _dist.version
release = _dist.version
copyright = "2012, Remco Haszing"
copyright = '2012, Remco Haszing'


extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx_rtd_theme',
]

intersphinx_mapping = {
"python": ("https://docs.python.org/3.11", None),
'python': ('https://docs.python.org/3.11', None),
}

nitpick_ignore = [("py:class", "socket.AddressFamily")]
nitpick_ignore = [('py:class', 'socket.AddressFamily')]

nitpicky = True

default_role = "any"
default_role = 'any'
todo_include_todos = True

master_doc = "index"
html_theme = "sphinx_rtd_theme"
master_doc = 'index'
html_theme = 'sphinx_rtd_theme'
322 changes: 59 additions & 263 deletions poetry.lock

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ wakeonlan = "wakeonlan:main"
python = "^3.7"

[tool.poetry.dev-dependencies]
black = { version = "*", python = ">= 3.8" }
coverage = { version = "*", extras = ["toml"] }
flake8 = { version = "*", python = ">= 3.8" }
flake8-docstrings = { version = "*", python = ">= 3.8" }
flake8-import-order = { version = "*", python = ">= 3.8" }
mypy = { version = "*", python = ">=3.8" }
ruff = { version = "*", python = ">=3.8" }
types-setuptools = { version = "*", python = ">=3.8" }

[tool.coverage.run]
Expand All @@ -53,6 +50,19 @@ ignore_missing_imports = true
strict_optional = true
warn_return_any = true

[tool.ruff.format]
quote-style = "single"

[tool.ruff.lint]
select = ["D", "E", "F", "I", "N", "W"]
ignore = ["D200", "D212", "E501", "W505"]

[tool.ruff.lint.isort]
lines-after-imports = 2

[tool.ruff.lint.pydocstyle]
convention = "google"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

0 comments on commit da59af7

Please sign in to comment.