Skip to content

Commit

Permalink
Merge pull request #2303 from zas/isort_fix
Browse files Browse the repository at this point in the history
Isort fix
  • Loading branch information
zas authored Sep 7, 2023
2 parents f15b7f2 + 46e554c commit b100eb1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Developers may install few extra tools using:
pip install -r requirements-dev.txt
```

To fix or preserve imports style, one can use `isort -rc .` command (requires the [isort](https://github.com/timothycrosley/isort) tool, see `.isort.cfg`).
To fix or preserve imports style, one can use `isort .` command (requires the [isort](https://github.com/PyCQA/isort) tool, see `.isort.cfg`).

It is recommended to add a pre-commit hook to check whether imports in changed code
follow the conventions. Add a file `.git/hooks/pre-commit` with the following content
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ build-backend = "setuptools.build_meta"

[tool.isort]
sections = [
"FUTURE", "STDLIB", "THIRDPARTY", "QT", "TEST", "PICARD", "LOCALFOLDER",
"FUTURE", "STDLIB", "FIRSTPARTY", "THIRDPARTY", "QT", "TEST", "PICARD", "LOCALFOLDER",
"RESOURCES", "PICARD_UI"
]
default_section = "LOCALFOLDER"
known_first_party = []
known_picard = ["picard"]
known_picard_ui = ["picard.ui"]
known_qt = ["PyQt5"]
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
from setuptools.command.install import install
from setuptools.dist import Distribution


try:
from setuptools.command.build import build
except ImportError:
Expand Down Expand Up @@ -401,7 +402,10 @@ def compile_ui(uifile, pyfile):
if newer(uifile, pyfile):
compile_ui(uifile, pyfile)

from resources import compile, makeqrc
from resources import (
compile,
makeqrc,
)
makeqrc.main()
compile.main()

Expand Down

0 comments on commit b100eb1

Please sign in to comment.