Skip to content

Commit

Permalink
🔧 chore(nox): Replace 'reorder-python-imports' with 'isort' pre-commi…
Browse files Browse the repository at this point in the history
…t hook

Reason:
psf/black#4175 (comment)
  Black 24+ and reorder-python-imports have incompatible opinions on whether there should be a blank line after a docstring.

Enable 'mypy' session back
  • Loading branch information
hotenov committed Aug 11, 2024
1 parent 2fcfdad commit bf8d11f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ repos:
# language: system
# types: [python]
# args: [--application-directories=src]
- id: isort
name: Organize Python imports (via isort)
entry: isort
language: system
types: [python]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
Expand Down
7 changes: 5 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
"""Nox sessions."""

import shutil
import sys
from pathlib import Path
from textwrap import dedent

import nox


try:
from nox_poetry import Session
from nox_poetry import session
Expand All @@ -23,9 +25,9 @@
python_versions = ["3.11", "3.12"]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = (
# "pre-commit",
"pre-commit",
"safety",
# "mypy",
"mypy",
"tests",
"typeguard",
"xdoctest",
Expand Down Expand Up @@ -98,6 +100,7 @@ def precommit(session: Session) -> None:
"pep8-naming",
"pre-commit",
"pre-commit-hooks",
"isort",
# "reorder-python-imports",
)
session.run("pre-commit", *args)
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ classifiers = [
[tool.poetry.urls]
Changelog = "https://github.com/hotenov/LEP-downloader/releases"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"


[tool.poetry.dependencies]
python = "^3.11"
Expand Down Expand Up @@ -67,7 +71,6 @@ Pygments = "^2.18.0"
furo = ">=2024.8.6"



[tool.poetry.scripts]
lep-downloader = "lep_downloader.__main__:main"
lep-dl = "lep_downloader.__main__:main"
Expand All @@ -84,6 +87,7 @@ source = ["lep_downloader"]
show_missing = true
fail_under = 100


[tool.mypy]
strict = true
warn_unreachable = true
Expand All @@ -110,12 +114,10 @@ module = [
]
ignore_missing_imports = true

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
force_single_line = true
profile = "black"
force_sort_within_sections = false
lexicographical = true
order_by_type = false
Expand Down

0 comments on commit bf8d11f

Please sign in to comment.