diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 30f6d33f41..f8769543d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml index a87c87308b..faaf2e62ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] diff --git a/setup.py b/setup.py index 2e3998d7aa..73b108be68 100644 --- a/setup.py +++ b/setup.py @@ -57,6 +57,7 @@ from setuptools.command.install import install from setuptools.dist import Distribution + try: from setuptools.command.build import build except ImportError: @@ -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()