diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 19a5db6..cf5c3d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,6 +44,7 @@ jobs: shell: bash run: | pip install nox + pip install nox-poetry pip install poetry poetry config virtualenvs.in-project true @@ -81,6 +82,7 @@ jobs: shell: bash run: | pip install nox + pip install nox-poetry pip install poetry poetry config virtualenvs.in-project true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cb9aeb..e92ab88 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.3.0 hooks: - id: check-toml - id: check-yaml @@ -8,33 +8,33 @@ repos: - id: check-merge-conflict - id: check-json - id: end-of-file-fixer -- repo: https://github.com/timothycrosley/isort - rev: 5.9.3 - hooks: - - id: isort - repo: https://github.com/psf/black - rev: 21.9b0 + rev: 22.10.0 hooks: - id: black +- repo: https://github.com/timothycrosley/isort + rev: 5.10.1 + hooks: + - id: isort - repo: local hooks: - - id: flakehell - name: flakehell - description: "`Flakehell` it's a Flake8 wrapper to make it cools." - entry: flakehell + - id: flakeheaven + name: flakeheaven + description: "flakeheaven wraps flake8. (flakehell is deprecated)" + entry: flakeheaven args: [lint] language: python types: [python] require_serial: true additional_dependencies: [ - 'flake8~=3.9.2', - 'flakehell~=0.9.0', - 'flake8-builtins~=1.5.3', - 'flake8-blind-except~=0.2.0', - 'flake8-logging-format~=0.6.0', - 'flake8-bugbear~=21.9.2', - 'flake8-annotations~=2.6.2', + 'flake8>=4.0.1,<5.0.0', + 'flakeheaven~=3.2.1', + 'flake8-builtins~=2.0.1', + 'flake8-blind-except~=0.2.1', + 'flake8-logging-format~=0.9.0', + 'flake8-bugbear~=22.10.27', + 'flake8-annotations~=2.9.1', 'flake8-docstrings~=1.6.0', - 'flake8-bandit~=2.1.2', - 'darglint~=1.8.0' + 'flake8-bandit==3.0.0', + 'darglint~=1.8.1' ] diff --git a/mypy.ini b/mypy.ini index 997caec..6281f9e 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,6 +1,6 @@ [mypy] -[mypy-pytest,invoke.*,nox.*] +[mypy-pytest,invoke.*,nox.*,nox_poetry] allow_redefinition = false check_untyped_defs = true ignore_errors = false diff --git a/noxfile.py b/noxfile.py index 43eca20..0e44027 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,50 +1,18 @@ """Nox sessions.""" import platform -import tempfile -from typing import Any -import nox -from nox.sessions import Session +from nox import options +from nox_poetry import Session, session -nox.options.sessions = ["tests", "mypy"] -python_versions = ["3.7", "3.8", "3.9", "3.10"] +options.sessions = ["tests", "mypy"] +python_versions = ["3.10"] -def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> None: - """Install packages constrained by Poetry's lock file. - - This function is a wrapper for nox.sessions.Session.install. It - invokes pip to install packages inside of the session's virtualenv. - Additionally, pip is passed a constraints file generated from - Poetry's lock file, to ensure that the packages are pinned to the - versions specified in poetry.lock. This allows you to manage the - packages as Poetry development dependencies. - - Arguments: - session: The Session object. - args: Command-line arguments for pip. - kwargs: Additional keyword arguments for Session.install. - """ - with tempfile.NamedTemporaryFile(delete=False) as requirements: - session.run( - "poetry", - "export", - "--dev", - "--without-hashes", - "--format=requirements.txt", - f"--output={requirements.name}", - external=True, - ) - session.install(f"--constraint={requirements.name}", *args, **kwargs) - - -@nox.session(python=python_versions) +@session(python=python_versions) def tests(session: Session) -> None: """Run the test suite.""" - session.install(".") - install_with_constraints( - session, "invoke", "pytest", "xdoctest", "coverage[toml]", "pytest-cov" - ) + dependencies = ["invoke", "pytest", "xdoctest", "coverage[toml]", "pytest-cov"] + session.install(".", *dependencies) try: session.run( "inv", @@ -58,24 +26,26 @@ def tests(session: Session) -> None: session.notify("coverage") -@nox.session +@session def coverage(session: Session) -> None: """Produce the coverage report.""" args = session.posargs if session.posargs and len(session._runner.manifest) == 1 else [] - install_with_constraints(session, "invoke", "coverage[toml]") + dependencies = ["invoke", "coverage[toml]"] + session.install(*dependencies) session.run("inv", "coverage", *args) -@nox.session(python=python_versions) +@session(python=python_versions) def mypy(session: Session) -> None: """Type-check using mypy.""" - session.install(".") - install_with_constraints(session, "invoke", "mypy") + dependencies = ["invoke", "mypy"] + session.install(".", *dependencies) session.run("inv", "mypy") -@nox.session(python="3.10") +@session(python=python_versions) def safety(session: Session) -> None: """Scan dependencies for insecure packages.""" - install_with_constraints(session, "invoke", "safety") + dependencies = ["invoke", "safety"] + session.install(*dependencies) session.run("inv", "safety") diff --git a/poetry.lock b/poetry.lock index 9c25a17..50b77c6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -6,14 +6,6 @@ category = "dev" optional = false python-versions = "*" -[[package]] -name = "atomicwrites" -version = "1.4.1" -description = "Atomic file writes." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - [[package]] name = "attrs" version = "22.1.0" @@ -60,28 +52,23 @@ yaml = ["pyyaml"] [[package]] name = "black" -version = "21.12b0" +version = "22.10.0" description = "The uncompromising code formatter." category = "dev" optional = false -python-versions = ">=3.6.2" +python-versions = ">=3.7" [package.dependencies] -click = ">=7.1.2" +click = ">=8.0.0" mypy-extensions = ">=0.4.3" -pathspec = ">=0.9.0,<1" +pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = ">=0.2.6,<2.0.0" -typing-extensions = [ - {version = ">=3.10.0.0", markers = "python_version < \"3.10\""}, - {version = "!=3.10.0.1", markers = "python_version >= \"3.10\""}, -] +tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} [package.extras] colorama = ["colorama (>=0.4.3)"] d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -python2 = ["typed-ast (>=1.4.3)"] uvloop = ["uvloop (>=0.15.2)"] [[package]] @@ -181,11 +168,11 @@ python-versions = "*" [[package]] name = "docutils" -version = "0.17.1" +version = "0.19" description = "Docutils -- Python Documentation Utilities" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.7" [[package]] name = "dparse" @@ -211,6 +198,17 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "exceptiongroup" +version = "1.0.4" +description = "Backport of PEP 654 (exception groups)" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +test = ["pytest (>=6)"] + [[package]] name = "filelock" version = "3.8.0" @@ -225,16 +223,16 @@ testing = ["covdefaults (>=2.2)", "coverage (>=6.4.2)", "pytest (>=7.1.2)", "pyt [[package]] name = "flake8" -version = "5.0.4" +version = "4.0.1" description = "the modular source code checker: pep8 pyflakes and co" category = "dev" optional = false -python-versions = ">=3.6.1" +python-versions = ">=3.6" [package.dependencies] -mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.9.0,<2.10.0" -pyflakes = ">=2.5.0,<2.6.0" +mccabe = ">=0.6.0,<0.7.0" +pycodestyle = ">=2.8.0,<2.9.0" +pyflakes = ">=2.4.0,<2.5.0" [[package]] name = "flake8-annotations" @@ -250,14 +248,14 @@ flake8 = ">=3.7" [[package]] name = "flake8-bandit" -version = "2.1.2" +version = "3.0.0" description = "Automated security testing with bandit and flake8." category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.6" [package.dependencies] -bandit = "*" +bandit = ">=1.7.3" flake8 = "*" flake8-polyfill = "*" pycodestyle = "*" @@ -272,32 +270,32 @@ python-versions = "*" [[package]] name = "flake8-bugbear" -version = "21.11.29" +version = "22.10.27" description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] attrs = ">=19.2.0" flake8 = ">=3.0.0" [package.extras] -dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit"] +dev = ["tox", "coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit"] [[package]] name = "flake8-builtins" -version = "1.5.3" +version = "2.0.1" description = "Check for python builtins being used as variables or parameters." category = "dev" optional = false -python-versions = "*" +python-versions = ">=3.7" [package.dependencies] flake8 = "*" [package.extras] -test = ["coverage", "coveralls", "mock", "pytest", "pytest-cov"] +test = ["pytest"] [[package]] name = "flake8-docstrings" @@ -313,12 +311,16 @@ pydocstyle = ">=2.1" [[package]] name = "flake8-logging-format" -version = "0.6.0" -description = "Flake8 extension to validate (lack of) logging format strings" +version = "0.9.0" +description = "" category = "dev" optional = false python-versions = "*" +[package.extras] +lint = ["flake8"] +test = ["pytest", "pytest-cov", "pyhamcrest"] + [[package]] name = "flake8-polyfill" version = "1.0.2" @@ -331,24 +333,23 @@ python-versions = "*" flake8 = "*" [[package]] -name = "flakehell" -version = "0.9.0" -description = "Flake8 wrapper to make it nice and configurable" +name = "flakeheaven" +version = "3.2.1" +description = "FlakeHeaven is a [Flake8](https://gitlab.com/pycqa/flake8) wrapper to make it cool." category = "dev" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7,<4.0" [package.dependencies] colorama = "*" entrypoints = "*" -flake8 = ">=3.8.0" +flake8 = ">=4.0.1,<5.0.0" pygments = "*" toml = "*" urllib3 = "*" [package.extras] -docs = ["alabaster", "pygments-github-lexers", "recommonmark", "sphinx"] -dev = ["dlint", "flake8-2020", "flake8-aaa", "flake8-absolute-import", "flake8-alfred", "flake8-annotations-complexity", "flake8-bandit", "flake8-black", "flake8-broken-line", "flake8-bugbear", "flake8-builtins", "flake8-coding", "flake8-cognitive-complexity", "flake8-commas", "flake8-comprehensions", "flake8-debugger", "flake8-django", "flake8-docstrings", "flake8-eradicate", "flake8-executable", "flake8-expression-complexity", "flake8-fixme", "flake8-functions", "flake8-future-import", "flake8-import-order", "flake8-isort", "flake8-logging-format", "flake8-mock", "flake8-mutable", "flake8-mypy", "flake8-pep3101", "flake8-pie", "flake8-print", "flake8-printf-formatting", "flake8-pyi", "flake8-pytest", "flake8-pytest-style", "flake8-quotes", "flake8-requirements", "flake8-rst-docstrings", "flake8-scrapy", "flake8-spellcheck", "flake8-sql", "flake8-strict", "flake8-string-format", "flake8-tidy-imports", "flake8-todo", "flake8-use-fstring", "flake8-variables-names", "isort", "mccabe", "pandas-vet", "pep8-naming", "pylint", "pytest", "typing-extensions", "wemake-python-styleguide"] +docs = ["alabaster", "pygments-github-lexers", "sphinx", "myst-parser (>=0.18.0,<0.19.0)"] [[package]] name = "gitdb" @@ -453,28 +454,30 @@ python-versions = ">=3.7" [[package]] name = "mccabe" -version = "0.7.0" +version = "0.6.1" description = "McCabe checker, plugin for flake8" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = "*" [[package]] name = "mypy" -version = "0.910" +version = "0.991" description = "Optional static typing for Python" category = "dev" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" [package.dependencies] -mypy-extensions = ">=0.4.3,<0.5.0" -toml = "*" -typing-extensions = ">=3.7.4" +mypy-extensions = ">=0.4.3" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=3.10" [package.extras] dmypy = ["psutil (>=4.0)"] -python2 = ["typed-ast (>=1.4.0,<1.5.0)"] +install-types = ["pip"] +python2 = ["typed-ast (>=1.4.0,<2)"] +reports = ["lxml"] [[package]] name = "mypy-extensions" @@ -559,21 +562,13 @@ pyyaml = ">=5.1" toml = "*" virtualenv = ">=20.0.8" -[[package]] -name = "py" -version = "1.11.0" -description = "library with cross-python path, ini-parsing, io, code, log facilities" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - [[package]] name = "pycodestyle" -version = "2.9.1" +version = "2.8.0" description = "Python style guide checker" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "pydocstyle" @@ -591,11 +586,11 @@ toml = ["toml"] [[package]] name = "pyflakes" -version = "2.5.0" +version = "2.4.0" description = "passive checker of Python programs" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "pygments" @@ -621,24 +616,23 @@ diagrams = ["railroad-diagrams", "jinja2"] [[package]] name = "pytest" -version = "6.2.5" +version = "7.2.0" description = "pytest: simple powerful testing with Python" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] -atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" -py = ">=1.8.2" -toml = "*" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] [[package]] name = "pytest-cov" @@ -770,7 +764,7 @@ python-versions = "*" [[package]] name = "sphinx" -version = "4.5.0" +version = "5.3.0" description = "Python documentation generator" category = "dev" optional = false @@ -778,15 +772,15 @@ python-versions = ">=3.6" [package.dependencies] alabaster = ">=0.7,<0.8" -babel = ">=1.3" -colorama = {version = ">=0.3.5", markers = "sys_platform == \"win32\""} -docutils = ">=0.14,<0.18" -imagesize = "*" -Jinja2 = ">=2.3" -packaging = "*" -Pygments = ">=2.0" +babel = ">=2.9" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +docutils = ">=0.14,<0.20" +imagesize = ">=1.3" +Jinja2 = ">=3.0" +packaging = ">=21.0" +Pygments = ">=2.12" requests = ">=2.5.0" -snowballstemmer = ">=1.1" +snowballstemmer = ">=2.0" sphinxcontrib-applehelp = "*" sphinxcontrib-devhelp = "*" sphinxcontrib-htmlhelp = ">=2.0.0" @@ -796,8 +790,8 @@ sphinxcontrib-serializinghtml = ">=1.1.5" [package.extras] docs = ["sphinxcontrib-websupport"] -lint = ["flake8 (>=3.5.0)", "isort", "mypy (>=0.931)", "docutils-stubs", "types-typed-ast", "types-requests"] -test = ["pytest", "pytest-cov", "html5lib", "cython", "typed-ast"] +lint = ["flake8 (>=3.5.0)", "flake8-comprehensions", "flake8-bugbear", "flake8-simplify", "isort", "mypy (>=0.981)", "sphinx-lint", "docutils-stubs", "types-typed-ast", "types-requests"] +test = ["pytest (>=4.6)", "html5lib", "typed-ast", "cython"] [[package]] name = "sphinxcontrib-applehelp" @@ -891,11 +885,11 @@ python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" [[package]] name = "tomli" -version = "1.2.3" +version = "2.0.1" description = "A lil' TOML parser" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [[package]] name = "typing-extensions" @@ -974,11 +968,10 @@ tests-strict = ["cmake (==3.21.2)", "codecov (==2.0.15)", "ninja (==1.10.2)", "p [metadata] lock-version = "1.1" python-versions = "<3.11,>=3.10" -content-hash = "816eb9d6dd919a4c69bb8d3fc5e9bcd4bba1d80cd0737c32f2caa013ddfb3aed" +content-hash = "0ae5cb54c2d948ca91bd3c35b04410bded6ad5e3263c70df836f95427506ab76" [metadata.files] alabaster = [] -atomicwrites = [] attrs = [] babel = [] bandit = [] @@ -1002,6 +995,7 @@ distlib = [] docutils = [] dparse = [] entrypoints = [] +exceptiongroup = [] filelock = [] flake8 = [] flake8-annotations = [] @@ -1012,7 +1006,7 @@ flake8-builtins = [] flake8-docstrings = [] flake8-logging-format = [] flake8-polyfill = [] -flakehell = [] +flakeheaven = [] gitdb = [] gitpython = [] identify = [] @@ -1029,10 +1023,7 @@ isort = [ ] jinja2 = [] markupsafe = [] -mccabe = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] +mccabe = [] mypy = [] mypy-extensions = [ {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, @@ -1048,10 +1039,6 @@ pbr = [] platformdirs = [] pluggy = [] pre-commit = [] -py = [ - {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, - {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, -] pycodestyle = [] pydocstyle = [] pyflakes = [] @@ -1121,7 +1108,10 @@ toml = [ {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] -tomli = [] +tomli = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] typing-extensions = [] urllib3 = [] virtualenv = [] diff --git a/pyproject.toml b/pyproject.toml index 6dae5a7..89b3d83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,45 +24,41 @@ classifiers=[ "Programming Language :: Python :: 3.10", ] - [tool.poetry.urls] "Bug Tracker" = "https://github.com/puttehi/slacktube/issues" - - [tool.poetry.scripts] slacktube = 'slacktube.cli:main' - [tool.poetry.dependencies] python = "<3.11,>=3.10" -click = "^8.0.3" +click = "^8.1.3" [tool.poetry.dev-dependencies] -pre-commit = "^2.15.0" -invoke = "^1.6.0" -flake8 = "^5.0.4" -flakehell = "^0.9.0" -flake8-builtins = "^1.5.3" -flake8-blind-except = "^0.2.0" -flake8-logging-format = "^0.6.0" -flake8-bugbear = "^21.9.2" -flake8-annotations = "^2.6.2" +flake8 = ">=4.0.1,<5.0.0" +flakeheaven = "^3.2.1" +flake8-bandit = "3.0.0" +pre-commit = "^2.20.0" +invoke = "^1.7.3" +flake8-builtins = "^2.0.1" +flake8-blind-except = "^0.2.1" +flake8-logging-format = "^0.9.0" +flake8-bugbear = "^22.10.27" +flake8-annotations = "^2.9.1" flake8-docstrings = "^1.6.0" -flake8-bandit = "^2.1.2" -darglint = "^1.8.0" -isort = "^5.9.3" -black = "^21.9b0" +darglint = "^1.8.1" +isort = "^5.10.1" +black = "^22.10.0" safety = "^2.3.2" -mypy = "^0.910" -sphinx = "^4.2.0" +mypy = "^0.991" +Sphinx = "^5.3.0" recommonmark = "^0.7.1" bump2version = "^1.0.1" -pytest = "^6.2.5" +pytest = "^7.2.0" xdoctest = "^1.1.0" -coverage = {version = "^6.0.1", extras = ["toml"]} +coverage = {extras = ["toml"], version = "^6.5.0"} pytest-cov = "^4.0.0" -watchdog = {version = "^2.1.6", extras = ["watchmedo"]} +watchdog = {extras = ["watchmedo"], version = "^2.1.9"} [tool.coverage.paths] source = ["src", "*/site-packages"] @@ -88,21 +84,21 @@ show_missing = true [tool.coverage.html] directory = "htmlcov" -[tool.flakehell] +[tool.flakeheaven] format = "grouped" max_line_length = 99 show_source = true docstring-convention = "google" extended_default_ignore = [] -[tool.flakehell.plugins] +[tool.flakeheaven.plugins] pyflakes = ["+*"] pycodestyle = ["+*"] mccabe = ["+*"] "flake8-*" = ["+*"] darglint = ["+*"] -[tool.flakehell.exceptions."tests/"] +[tool.flakeheaven.exceptions."tests/"] flake8-bandit = ["-S101"] [tool.isort] diff --git a/tasks.py b/tasks.py index 0871565..a74926c 100644 --- a/tasks.py +++ b/tasks.py @@ -1,5 +1,4 @@ -""" -Tasks for maintaining the project. +"""Tasks for maintaining the project. Execute 'invoke --list' for guidance on using Invoke """ @@ -94,17 +93,17 @@ def hooks(c): def format_(c, check=False): # type: (Context, bool) -> None """Format code.""" - isort_options = ["--check-only", "--diff"] if check else [] - _run(c, f"poetry run isort {' '.join(isort_options)} {PYTHON_TARGETS_STR}") black_options = ["--diff", "--check"] if check else ["--quiet"] _run(c, f"poetry run black {' '.join(black_options)} {PYTHON_TARGETS_STR}") + isort_options = ["--check-only", "--diff"] if check else [] + _run(c, f"poetry run isort {' '.join(isort_options)} {PYTHON_TARGETS_STR}") @task() def flake8(c): # type: (Context) -> None """Run flake8.""" - _run(c, f"poetry run flakehell lint {PYTHON_TARGETS_STR}") + _run(c, f"poetry run flakeheaven lint {PYTHON_TARGETS_STR}") @task()