Skip to content

Commit

Permalink
refactor: tweak isort
Browse files Browse the repository at this point in the history
Only ignore parts of setup.py. This has two advantages: 1) If isort is applied to the file directly, e.g., by an eager IDE, it still doesn't sort the setuptools imports as needed. 2) The rest of the imports is sorted.

Also remove the configured ignore for docs/conf.py which seems to be fine.
  • Loading branch information
tilsche committed Mar 1, 2023
1 parent f2f8bfb commit 815b70a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ skip_glob = [
"**/*_pb2.pyi",
]
skip = [
"setup.py", # setuptools needs to be loaded before distutils.
# Instruct isort not to go there. There be dragons.
"docs/conf.py",
".eggs",
".git",
".hg",
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
# since the former packages its own version of the latter.
#
# See https://setuptools.readthedocs.io/en/latest/deprecated/distutils-legacy.html
# isort: off
from setuptools import Command, setup
from setuptools.command.build_py import build_py
from setuptools.command.develop import develop

# isort: on
import logging
import os
import re
Expand Down

0 comments on commit 815b70a

Please sign in to comment.