From 8711358eb384a75bb46ed6e3462c7bc4547f8e1e Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sun, 29 Oct 2023 22:56:49 +0800 Subject: [PATCH] =?UTF-8?q?build:=20add=20`isort`=20dev=20dependency,=20an?= =?UTF-8?q?d=20add=20to=20`lint.sh`;=20update=20dev=20dependencies=20?= =?UTF-8?q?=F0=9F=93=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- poetry.lock | 30 ++++++++++++++++++++++++++---- pyproject.toml | 3 ++- requirements-dev.txt | 3 ++- scripts/lint.sh | 2 ++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 5b0f99a..c6da772 100644 --- a/poetry.lock +++ b/poetry.lock @@ -72,6 +72,28 @@ type = "legacy" url = "https://mirrors.aliyun.com/pypi/simple" reference = "aliyun" +[[package]] +name = "isort" +version = "5.12.0" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.12.0-py3-none-any.whl", hash = "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6"}, + {file = "isort-5.12.0.tar.gz", hash = "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504"}, +] + +[package.extras] +colors = ["colorama (>=0.4.3)"] +pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] +plugins = ["setuptools"] +requirements-deprecated-finder = ["pip-api", "pipreqs"] + +[package.source] +type = "legacy" +url = "https://mirrors.aliyun.com/pypi/simple" +reference = "aliyun" + [[package]] name = "mccabe" version = "0.7.0" @@ -295,13 +317,13 @@ reference = "aliyun" [[package]] name = "pytest" -version = "7.4.2" +version = "7.4.3" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.2-py3-none-any.whl", hash = "sha256:1d881c6124e08ff0a1bb75ba3ec0bfd8b5354a01c194ddd5a0a870a48d99b002"}, - {file = "pytest-7.4.2.tar.gz", hash = "sha256:a766259cfab564a2ad52cb1aae1b881a75c3eb7e34ca3779697c23ed47c47069"}, + {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, + {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, ] [package.dependencies] @@ -355,4 +377,4 @@ reference = "aliyun" [metadata] lock-version = "2.0" python-versions = "^3.8.1" -content-hash = "03259fe7883d3c15b5c6b1d47a84f048eb013f2b4567546d1bee0aef4c9dba28" +content-hash = "dbe6b7ee3e7e2c6b20e108f6ccb60ce309f5c5599129b71afcb4cfee1b16b2e1" diff --git a/pyproject.toml b/pyproject.toml index 999ca90..1f2bbb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,8 +12,9 @@ pyobjc-framework-Quartz = "^10.0" [tool.poetry.group.dev.dependencies] pytest = "^7.4.2" -flake8 = "^6.1.0" mypy = "^1.6.1" +flake8 = "^6.1.0" +isort = "^5.12.0" [[tool.poetry.source]] diff --git a/requirements-dev.txt b/requirements-dev.txt index 633dc42..cfcae46 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,6 +2,7 @@ colorama==0.4.6 ; python_full_version >= "3.8.1" and python_full_version < "4.0. exceptiongroup==1.1.3 ; python_full_version >= "3.8.1" and python_version < "3.11" flake8==6.1.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" iniconfig==2.0.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" +isort==5.12.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" mccabe==0.7.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" mypy-extensions==1.0.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" mypy==1.6.1 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" @@ -12,6 +13,6 @@ pyflakes==3.1.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0. pyobjc-core==10.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" pyobjc-framework-cocoa==10.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" pyobjc-framework-quartz==10.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" -pytest==7.4.2 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" +pytest==7.4.3 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" tomli==2.0.1 ; python_full_version >= "3.8.1" and python_version < "3.11" typing-extensions==4.8.0 ; python_full_version >= "3.8.1" and python_full_version < "4.0.0" diff --git a/scripts/lint.sh b/scripts/lint.sh index 881da4c..ef736f4 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -6,6 +6,8 @@ source scripts/_utils.sh log_and_run flake8 --count --statistics --show-source --max-complexity=10 --max-line-length=120 ./*.py tests +log_and_run isort --line-length=120 --check-only --diff ./*.py tests + # https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports # https://mypy.readthedocs.io/en/stable/existing_code.html#ignoring-errors-from-certain-modules log_and_run mypy ./*.py tests