From a4d0d4d304180deee4a040fb98005b83ee3e1c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Mon, 3 Jul 2023 17:07:52 +0200 Subject: [PATCH] Change: Use ruff instead of pylint Use ruff for linting instead of pylint because it's so much faster. --- poetry.lock | 250 ++++------------------- pontos/changelog/__init__.py | 5 +- pontos/github/actions/__init__.py | 1 + pontos/github/actions/argparser.py | 2 +- pontos/github/actions/core.py | 4 +- pontos/github/actions/event.py | 2 +- pontos/github/api/artifacts.py | 2 +- pontos/github/api/release.py | 8 +- pontos/github/api/teams.py | 4 +- pontos/github/models/__init__.py | 2 + pontos/models/__init__.py | 4 +- pontos/nvd/__init__.py | 2 +- pontos/nvd/cve/__init__.py | 2 +- pontos/release/__init__.py | 1 + pontos/release/main.py | 2 +- pontos/release/sign.py | 4 +- pontos/version/__init__.py | 1 + pontos/version/commands/_python.py | 10 +- pontos/version/main.py | 1 - pyproject.toml | 8 +- tests/git/test_git.py | 2 +- tests/github/actions/test_core.py | 6 +- tests/github/api/test_pull_requests.py | 3 +- tests/github/api/test_tags.py | 1 + tests/github/models/test_organization.py | 1 + tests/github/models/test_tag.py | 1 + tests/nvd/cpe/test_api.py | 1 + tests/nvd/models/test_cpe.py | 1 + tests/nvd/models/test_cve.py | 1 + tests/test_helper.py | 15 +- tests/testing/test_testing.py | 24 +-- tests/version/commands/test_java.py | 1 + 32 files changed, 107 insertions(+), 265 deletions(-) diff --git a/poetry.lock b/poetry.lock index 770f7d683..4ee9f9444 100644 --- a/poetry.lock +++ b/poetry.lock @@ -32,25 +32,6 @@ doc = ["Sphinx (>=6.1.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "s test = ["anyio[trio]", "coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "mock (>=4)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (<0.22)"] -[[package]] -name = "astroid" -version = "2.15.5" -description = "An abstract syntax tree for Python with inference support." -optional = false -python-versions = ">=3.7.2" -files = [ - {file = "astroid-2.15.5-py3-none-any.whl", hash = "sha256:078e5212f9885fa85fbb0cf0101978a336190aadea6e13305409d099f71b2324"}, - {file = "astroid-2.15.5.tar.gz", hash = "sha256:1039262575027b441137ab4a62a793a9b43defb42c32d5670f38686207cd780f"}, -] - -[package.dependencies] -lazy-object-proxy = ">=1.4.0" -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} -wrapt = [ - {version = ">=1.11,<2", markers = "python_version < \"3.11\""}, - {version = ">=1.14,<2", markers = "python_version >= \"3.11\""}, -] - [[package]] name = "autohooks" version = "23.4.0" @@ -98,19 +79,19 @@ autohooks = ">=21.6.0" isort = ">=5.8.0,<6.0.0" [[package]] -name = "autohooks-plugin-pylint" -version = "23.4.0" -description = "An autohooks plugin for python code linting via pylint" +name = "autohooks-plugin-ruff" +version = "23.6.1" +description = "An autohooks plugin for python code formatting via ruff" optional = false python-versions = ">=3.7.2,<4.0.0" files = [ - {file = "autohooks_plugin_pylint-23.4.0-py3-none-any.whl", hash = "sha256:2dd581c3764949ef9c1041f5a34206cac796a342a900f47e5f42346e80598009"}, - {file = "autohooks_plugin_pylint-23.4.0.tar.gz", hash = "sha256:746c24a73bb312e9883f531d13db16da4bd05949969e7adeee3e8d1105a9c6c2"}, + {file = "autohooks_plugin_ruff-23.6.1-py3-none-any.whl", hash = "sha256:8afad5fe0d70eadc805e0c2b7b35e50e3e2d21ec45549a1fba721792cff6e28c"}, + {file = "autohooks_plugin_ruff-23.6.1.tar.gz", hash = "sha256:460fd343d113a8e20eade1c64aca673c07b930c5ee4d77938574911923cfbbf9"}, ] [package.dependencies] -autohooks = ">=2.2.0" -pylint = ">=2.8.3" +autohooks = ">=23.4.0" +ruff = ">=0.0.272" [[package]] name = "babel" @@ -396,20 +377,6 @@ files = [ [package.extras] toml = ["tomli"] -[[package]] -name = "dill" -version = "0.3.6" -description = "serialize all of python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "dill-0.3.6-py3-none-any.whl", hash = "sha256:a07ffd2351b8c678dfc4a856a3005f8067aea51d6ba6c700796a4d9e280f39f0"}, - {file = "dill-0.3.6.tar.gz", hash = "sha256:e5db55f3687856d8fbdab002ed78544e1c4559a130302693d839dfe8f93f2373"}, -] - -[package.extras] -graph = ["objgraph (>=1.7.2)"] - [[package]] name = "docutils" version = "0.20.1" @@ -423,13 +390,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.1.1" +version = "1.1.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"}, - {file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"}, + {file = "exceptiongroup-1.1.2-py3-none-any.whl", hash = "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f"}, + {file = "exceptiongroup-1.1.2.tar.gz", hash = "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5"}, ] [package.extras] @@ -620,51 +587,6 @@ MarkupSafe = ">=2.0" [package.extras] i18n = ["Babel (>=2.7)"] -[[package]] -name = "lazy-object-proxy" -version = "1.9.0" -description = "A fast and thorough lazy object proxy." -optional = false -python-versions = ">=3.7" -files = [ - {file = "lazy-object-proxy-1.9.0.tar.gz", hash = "sha256:659fb5809fa4629b8a1ac5106f669cfc7bef26fbb389dda53b3e010d1ac4ebae"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b40387277b0ed2d0602b8293b94d7257e17d1479e257b4de114ea11a8cb7f2d7"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8c6cfb338b133fbdbc5cfaa10fe3c6aeea827db80c978dbd13bc9dd8526b7d4"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:721532711daa7db0d8b779b0bb0318fa87af1c10d7fe5e52ef30f8eff254d0cd"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:66a3de4a3ec06cd8af3f61b8e1ec67614fbb7c995d02fa224813cb7afefee701"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1aa3de4088c89a1b69f8ec0dcc169aa725b0ff017899ac568fe44ddc1396df46"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-win32.whl", hash = "sha256:f0705c376533ed2a9e5e97aacdbfe04cecd71e0aa84c7c0595d02ef93b6e4455"}, - {file = "lazy_object_proxy-1.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:ea806fd4c37bf7e7ad82537b0757999264d5f70c45468447bb2b91afdbe73a6e"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:946d27deaff6cf8452ed0dba83ba38839a87f4f7a9732e8f9fd4107b21e6ff07"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79a31b086e7e68b24b99b23d57723ef7e2c6d81ed21007b6281ebcd1688acb0a"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f699ac1c768270c9e384e4cbd268d6e67aebcfae6cd623b4d7c3bfde5a35db59"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bfb38f9ffb53b942f2b5954e0f610f1e721ccebe9cce9025a38c8ccf4a5183a4"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:189bbd5d41ae7a498397287c408617fe5c48633e7755287b21d741f7db2706a9"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-win32.whl", hash = "sha256:81fc4d08b062b535d95c9ea70dbe8a335c45c04029878e62d744bdced5141586"}, - {file = "lazy_object_proxy-1.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:f2457189d8257dd41ae9b434ba33298aec198e30adf2dcdaaa3a28b9994f6adb"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d9e25ef10a39e8afe59a5c348a4dbf29b4868ab76269f81ce1674494e2565a6e"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cbf9b082426036e19c6924a9ce90c740a9861e2bdc27a4834fd0a910742ac1e8"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f5fa4a61ce2438267163891961cfd5e32ec97a2c444e5b842d574251ade27d2"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:8fa02eaab317b1e9e03f69aab1f91e120e7899b392c4fc19807a8278a07a97e8"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e7c21c95cae3c05c14aafffe2865bbd5e377cfc1348c4f7751d9dc9a48ca4bda"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win32.whl", hash = "sha256:f12ad7126ae0c98d601a7ee504c1122bcef553d1d5e0c3bfa77b16b3968d2734"}, - {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win_amd64.whl", hash = "sha256:edd20c5a55acb67c7ed471fa2b5fb66cb17f61430b7a6b9c3b4a1e40293b1671"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0daa332786cf3bb49e10dc6a17a52f6a8f9601b4cf5c295a4f85854d61de63"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cd077f3d04a58e83d04b20e334f678c2b0ff9879b9375ed107d5d07ff160171"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:660c94ea760b3ce47d1855a30984c78327500493d396eac4dfd8bd82041b22be"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:212774e4dfa851e74d393a2370871e174d7ff0ebc980907723bb67d25c8a7c30"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f0117049dd1d5635bbff65444496c90e0baa48ea405125c088e93d9cf4525b11"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-win32.whl", hash = "sha256:0a891e4e41b54fd5b8313b96399f8b0e173bbbfc03c7631f01efbe29bb0bcf82"}, - {file = "lazy_object_proxy-1.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:9990d8e71b9f6488e91ad25f322898c136b008d87bf852ff65391b004da5e17b"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9e7551208b2aded9c1447453ee366f1c4070602b3d932ace044715d89666899b"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f83ac4d83ef0ab017683d715ed356e30dd48a93746309c8f3517e1287523ef4"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7322c3d6f1766d4ef1e51a465f47955f1e8123caee67dd641e67d539a534d006"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:18b78ec83edbbeb69efdc0e9c1cb41a3b1b1ed11ddd8ded602464c3fc6020494"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:09763491ce220c0299688940f8dc2c5d05fd1f45af1e42e636b2e8b2303e4382"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-win32.whl", hash = "sha256:9090d8e53235aa280fc9239a86ae3ea8ac58eff66a705fa6aa2ec4968b95c821"}, - {file = "lazy_object_proxy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:db1c1722726f47e10e0b5fdbf15ac3b8adb58c091d12b3ab713965795036985f"}, -] - [[package]] name = "livereload" version = "2.6.3" @@ -855,17 +777,6 @@ files = [ {file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"}, ] -[[package]] -name = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" -optional = false -python-versions = ">=3.6" -files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, -] - [[package]] name = "mdit-py-plugins" version = "0.4.0" @@ -984,35 +895,6 @@ files = [ [package.extras] plugins = ["importlib-metadata"] -[[package]] -name = "pylint" -version = "2.17.4" -description = "python code static checker" -optional = false -python-versions = ">=3.7.2" -files = [ - {file = "pylint-2.17.4-py3-none-any.whl", hash = "sha256:7a1145fb08c251bdb5cca11739722ce64a63db479283d10ce718b2460e54123c"}, - {file = "pylint-2.17.4.tar.gz", hash = "sha256:5dcf1d9e19f41f38e4e85d10f511e5b9c35e1aa74251bf95cdd8cb23584e2db1"}, -] - -[package.dependencies] -astroid = ">=2.15.4,<=2.17.0-dev0" -colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -dill = [ - {version = ">=0.2", markers = "python_version < \"3.11\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\""}, -] -isort = ">=4.2.5,<6" -mccabe = ">=0.6,<0.8" -platformdirs = ">=2.2.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -tomlkit = ">=0.10.1" -typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} - -[package.extras] -spelling = ["pyenchant (>=3.2,<4.0)"] -testutils = ["gitpython (>3)"] - [[package]] name = "python-dateutil" version = "2.8.2" @@ -1156,6 +1038,32 @@ dev = ["build (>=0.7.0)", "pre-commit (>=2.20.0)", "pytest (>=7.0.1)", "pytest-t doc = ["pytoolconfig[doc]", "sphinx (>=4.5.0)", "sphinx-autodoc-typehints (>=1.18.1)", "sphinx-rtd-theme (>=1.0.0)"] release = ["pip-tools (>=6.12.1)", "toml (>=0.10.2)", "twine (>=4.0.2)"] +[[package]] +name = "ruff" +version = "0.0.275" +description = "An extremely fast Python linter, written in Rust." +optional = false +python-versions = ">=3.7" +files = [ + {file = "ruff-0.0.275-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:5e6554a072e7ce81eb6f0bec1cebd3dcb0e358652c0f4900d7d630d61691e914"}, + {file = "ruff-0.0.275-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:1cc599022fe5ffb143a965b8d659eb64161ab8ab4433d208777eab018a1aab67"}, + {file = "ruff-0.0.275-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5206fc1cd8c1c1deadd2e6360c0dbcd690f1c845da588ca9d32e4a764a402c60"}, + {file = "ruff-0.0.275-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0c4e6468da26f77b90cae35319d310999f471a8c352998e9b39937a23750149e"}, + {file = "ruff-0.0.275-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0dbdea02942131dbc15dd45f431d152224f15e1dd1859fcd0c0487b658f60f1a"}, + {file = "ruff-0.0.275-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:22efd9f41af27ef8fb9779462c46c35c89134d33e326c889971e10b2eaf50c63"}, + {file = "ruff-0.0.275-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2c09662112cfa22d7467a19252a546291fd0eae4f423e52b75a7a2000a1894db"}, + {file = "ruff-0.0.275-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80043726662144876a381efaab88841c88e8df8baa69559f96b22d4fa216bef1"}, + {file = "ruff-0.0.275-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5859ee543b01b7eb67835dfd505faa8bb7cc1550f0295c92c1401b45b42be399"}, + {file = "ruff-0.0.275-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:c8ace4d40a57b5ea3c16555f25a6b16bc5d8b2779ae1912ce2633543d4e9b1da"}, + {file = "ruff-0.0.275-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:8347fc16aa185aae275906c4ac5b770e00c896b6a0acd5ba521f158801911998"}, + {file = "ruff-0.0.275-py3-none-musllinux_1_2_i686.whl", hash = "sha256:ec43658c64bfda44fd84bbea9da8c7a3b34f65448192d1c4dd63e9f4e7abfdd4"}, + {file = "ruff-0.0.275-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:508b13f7ca37274cceaba4fb3ea5da6ca192356323d92acf39462337c33ad14e"}, + {file = "ruff-0.0.275-py3-none-win32.whl", hash = "sha256:6afb1c4422f24f361e877937e2a44b3f8176774a476f5e33845ebfe887dd5ec2"}, + {file = "ruff-0.0.275-py3-none-win_amd64.whl", hash = "sha256:d9b264d78621bf7b698b6755d4913ab52c19bd28bee1a16001f954d64c1a1220"}, + {file = "ruff-0.0.275-py3-none-win_arm64.whl", hash = "sha256:a19ce3bea71023eee5f0f089dde4a4272d088d5ac0b675867e074983238ccc65"}, + {file = "ruff-0.0.275.tar.gz", hash = "sha256:a63a0b645da699ae5c758fce19188e901b3033ec54d862d93fcd042addf7f38d"}, +] + [[package]] name = "semver" version = "3.0.1" @@ -1441,90 +1349,6 @@ secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17. socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] -[[package]] -name = "wrapt" -version = "1.15.0" -description = "Module for decorators, wrappers and monkey patching." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -files = [ - {file = "wrapt-1.15.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:ca1cccf838cd28d5a0883b342474c630ac48cac5df0ee6eacc9c7290f76b11c1"}, - {file = "wrapt-1.15.0-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e826aadda3cae59295b95343db8f3d965fb31059da7de01ee8d1c40a60398b29"}, - {file = "wrapt-1.15.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5fc8e02f5984a55d2c653f5fea93531e9836abbd84342c1d1e17abc4a15084c2"}, - {file = "wrapt-1.15.0-cp27-cp27m-manylinux2010_i686.whl", hash = "sha256:96e25c8603a155559231c19c0349245eeb4ac0096fe3c1d0be5c47e075bd4f46"}, - {file = "wrapt-1.15.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:40737a081d7497efea35ab9304b829b857f21558acfc7b3272f908d33b0d9d4c"}, - {file = "wrapt-1.15.0-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:f87ec75864c37c4c6cb908d282e1969e79763e0d9becdfe9fe5473b7bb1e5f09"}, - {file = "wrapt-1.15.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:1286eb30261894e4c70d124d44b7fd07825340869945c79d05bda53a40caa079"}, - {file = "wrapt-1.15.0-cp27-cp27mu-manylinux2010_i686.whl", hash = "sha256:493d389a2b63c88ad56cdc35d0fa5752daac56ca755805b1b0c530f785767d5e"}, - {file = "wrapt-1.15.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:58d7a75d731e8c63614222bcb21dd992b4ab01a399f1f09dd82af17bbfc2368a"}, - {file = "wrapt-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:21f6d9a0d5b3a207cdf7acf8e58d7d13d463e639f0c7e01d82cdb671e6cb7923"}, - {file = "wrapt-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ce42618f67741d4697684e501ef02f29e758a123aa2d669e2d964ff734ee00ee"}, - {file = "wrapt-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41d07d029dd4157ae27beab04d22b8e261eddfc6ecd64ff7000b10dc8b3a5727"}, - {file = "wrapt-1.15.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54accd4b8bc202966bafafd16e69da9d5640ff92389d33d28555c5fd4f25ccb7"}, - {file = "wrapt-1.15.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2fbfbca668dd15b744418265a9607baa970c347eefd0db6a518aaf0cfbd153c0"}, - {file = "wrapt-1.15.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:76e9c727a874b4856d11a32fb0b389afc61ce8aaf281ada613713ddeadd1cfec"}, - {file = "wrapt-1.15.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e20076a211cd6f9b44a6be58f7eeafa7ab5720eb796975d0c03f05b47d89eb90"}, - {file = "wrapt-1.15.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a74d56552ddbde46c246b5b89199cb3fd182f9c346c784e1a93e4dc3f5ec9975"}, - {file = "wrapt-1.15.0-cp310-cp310-win32.whl", hash = "sha256:26458da5653aa5b3d8dc8b24192f574a58984c749401f98fff994d41d3f08da1"}, - {file = "wrapt-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:75760a47c06b5974aa5e01949bf7e66d2af4d08cb8c1d6516af5e39595397f5e"}, - {file = "wrapt-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ba1711cda2d30634a7e452fc79eabcadaffedf241ff206db2ee93dd2c89a60e7"}, - {file = "wrapt-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:56374914b132c702aa9aa9959c550004b8847148f95e1b824772d453ac204a72"}, - {file = "wrapt-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a89ce3fd220ff144bd9d54da333ec0de0399b52c9ac3d2ce34b569cf1a5748fb"}, - {file = "wrapt-1.15.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bbe623731d03b186b3d6b0d6f51865bf598587c38d6f7b0be2e27414f7f214e"}, - {file = "wrapt-1.15.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3abbe948c3cbde2689370a262a8d04e32ec2dd4f27103669a45c6929bcdbfe7c"}, - {file = "wrapt-1.15.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b67b819628e3b748fd3c2192c15fb951f549d0f47c0449af0764d7647302fda3"}, - {file = "wrapt-1.15.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:7eebcdbe3677e58dd4c0e03b4f2cfa346ed4049687d839adad68cc38bb559c92"}, - {file = "wrapt-1.15.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:74934ebd71950e3db69960a7da29204f89624dde411afbfb3b4858c1409b1e98"}, - {file = "wrapt-1.15.0-cp311-cp311-win32.whl", hash = "sha256:bd84395aab8e4d36263cd1b9308cd504f6cf713b7d6d3ce25ea55670baec5416"}, - {file = "wrapt-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:a487f72a25904e2b4bbc0817ce7a8de94363bd7e79890510174da9d901c38705"}, - {file = "wrapt-1.15.0-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:4ff0d20f2e670800d3ed2b220d40984162089a6e2c9646fdb09b85e6f9a8fc29"}, - {file = "wrapt-1.15.0-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:9ed6aa0726b9b60911f4aed8ec5b8dd7bf3491476015819f56473ffaef8959bd"}, - {file = "wrapt-1.15.0-cp35-cp35m-manylinux2010_i686.whl", hash = "sha256:896689fddba4f23ef7c718279e42f8834041a21342d95e56922e1c10c0cc7afb"}, - {file = "wrapt-1.15.0-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:75669d77bb2c071333417617a235324a1618dba66f82a750362eccbe5b61d248"}, - {file = "wrapt-1.15.0-cp35-cp35m-win32.whl", hash = "sha256:fbec11614dba0424ca72f4e8ba3c420dba07b4a7c206c8c8e4e73f2e98f4c559"}, - {file = "wrapt-1.15.0-cp35-cp35m-win_amd64.whl", hash = "sha256:fd69666217b62fa5d7c6aa88e507493a34dec4fa20c5bd925e4bc12fce586639"}, - {file = "wrapt-1.15.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b0724f05c396b0a4c36a3226c31648385deb6a65d8992644c12a4963c70326ba"}, - {file = "wrapt-1.15.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bbeccb1aa40ab88cd29e6c7d8585582c99548f55f9b2581dfc5ba68c59a85752"}, - {file = "wrapt-1.15.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:38adf7198f8f154502883242f9fe7333ab05a5b02de7d83aa2d88ea621f13364"}, - {file = "wrapt-1.15.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:578383d740457fa790fdf85e6d346fda1416a40549fe8db08e5e9bd281c6a475"}, - {file = "wrapt-1.15.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:a4cbb9ff5795cd66f0066bdf5947f170f5d63a9274f99bdbca02fd973adcf2a8"}, - {file = "wrapt-1.15.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:af5bd9ccb188f6a5fdda9f1f09d9f4c86cc8a539bd48a0bfdc97723970348418"}, - {file = "wrapt-1.15.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b56d5519e470d3f2fe4aa7585f0632b060d532d0696c5bdfb5e8319e1d0f69a2"}, - {file = "wrapt-1.15.0-cp36-cp36m-win32.whl", hash = "sha256:77d4c1b881076c3ba173484dfa53d3582c1c8ff1f914c6461ab70c8428b796c1"}, - {file = "wrapt-1.15.0-cp36-cp36m-win_amd64.whl", hash = "sha256:077ff0d1f9d9e4ce6476c1a924a3332452c1406e59d90a2cf24aeb29eeac9420"}, - {file = "wrapt-1.15.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5c5aa28df055697d7c37d2099a7bc09f559d5053c3349b1ad0c39000e611d317"}, - {file = "wrapt-1.15.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a8564f283394634a7a7054b7983e47dbf39c07712d7b177b37e03f2467a024e"}, - {file = "wrapt-1.15.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:780c82a41dc493b62fc5884fb1d3a3b81106642c5c5c78d6a0d4cbe96d62ba7e"}, - {file = "wrapt-1.15.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e169e957c33576f47e21864cf3fc9ff47c223a4ebca8960079b8bd36cb014fd0"}, - {file = "wrapt-1.15.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b02f21c1e2074943312d03d243ac4388319f2456576b2c6023041c4d57cd7019"}, - {file = "wrapt-1.15.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f2e69b3ed24544b0d3dbe2c5c0ba5153ce50dcebb576fdc4696d52aa22db6034"}, - {file = "wrapt-1.15.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d787272ed958a05b2c86311d3a4135d3c2aeea4fc655705f074130aa57d71653"}, - {file = "wrapt-1.15.0-cp37-cp37m-win32.whl", hash = "sha256:02fce1852f755f44f95af51f69d22e45080102e9d00258053b79367d07af39c0"}, - {file = "wrapt-1.15.0-cp37-cp37m-win_amd64.whl", hash = "sha256:abd52a09d03adf9c763d706df707c343293d5d106aea53483e0ec8d9e310ad5e"}, - {file = "wrapt-1.15.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cdb4f085756c96a3af04e6eca7f08b1345e94b53af8921b25c72f096e704e145"}, - {file = "wrapt-1.15.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:230ae493696a371f1dbffaad3dafbb742a4d27a0afd2b1aecebe52b740167e7f"}, - {file = "wrapt-1.15.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63424c681923b9f3bfbc5e3205aafe790904053d42ddcc08542181a30a7a51bd"}, - {file = "wrapt-1.15.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d6bcbfc99f55655c3d93feb7ef3800bd5bbe963a755687cbf1f490a71fb7794b"}, - {file = "wrapt-1.15.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c99f4309f5145b93eca6e35ac1a988f0dc0a7ccf9ccdcd78d3c0adf57224e62f"}, - {file = "wrapt-1.15.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b130fe77361d6771ecf5a219d8e0817d61b236b7d8b37cc045172e574ed219e6"}, - {file = "wrapt-1.15.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:96177eb5645b1c6985f5c11d03fc2dbda9ad24ec0f3a46dcce91445747e15094"}, - {file = "wrapt-1.15.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5fe3e099cf07d0fb5a1e23d399e5d4d1ca3e6dfcbe5c8570ccff3e9208274f7"}, - {file = "wrapt-1.15.0-cp38-cp38-win32.whl", hash = "sha256:abd8f36c99512755b8456047b7be10372fca271bf1467a1caa88db991e7c421b"}, - {file = "wrapt-1.15.0-cp38-cp38-win_amd64.whl", hash = "sha256:b06fa97478a5f478fb05e1980980a7cdf2712015493b44d0c87606c1513ed5b1"}, - {file = "wrapt-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2e51de54d4fb8fb50d6ee8327f9828306a959ae394d3e01a1ba8b2f937747d86"}, - {file = "wrapt-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0970ddb69bba00670e58955f8019bec4a42d1785db3faa043c33d81de2bf843c"}, - {file = "wrapt-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76407ab327158c510f44ded207e2f76b657303e17cb7a572ffe2f5a8a48aa04d"}, - {file = "wrapt-1.15.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd525e0e52a5ff16653a3fc9e3dd827981917d34996600bbc34c05d048ca35cc"}, - {file = "wrapt-1.15.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d37ac69edc5614b90516807de32d08cb8e7b12260a285ee330955604ed9dd29"}, - {file = "wrapt-1.15.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:078e2a1a86544e644a68422f881c48b84fef6d18f8c7a957ffd3f2e0a74a0d4a"}, - {file = "wrapt-1.15.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2cf56d0e237280baed46f0b5316661da892565ff58309d4d2ed7dba763d984b8"}, - {file = "wrapt-1.15.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7dc0713bf81287a00516ef43137273b23ee414fe41a3c14be10dd95ed98a2df9"}, - {file = "wrapt-1.15.0-cp39-cp39-win32.whl", hash = "sha256:46ed616d5fb42f98630ed70c3529541408166c22cdfd4540b88d5f21006b0eff"}, - {file = "wrapt-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:eef4d64c650f33347c1f9266fa5ae001440b232ad9b98f1f43dfe7a79435c0a6"}, - {file = "wrapt-1.15.0-py3-none-any.whl", hash = "sha256:64b1df0f83706b4ef4cfb4fb0e4c2669100fd7ecacfb59e091fad300d4e04640"}, - {file = "wrapt-1.15.0.tar.gz", hash = "sha256:d06730c6aed78cee4126234cf2d071e01b44b915e725a6cb439a879ec9754a3a"}, -] - [[package]] name = "zipp" version = "3.15.0" @@ -1543,4 +1367,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = ">=3.9" -content-hash = "932a855529a7013e65ff932897960282dfbcce758838c91916df27ff2c7b8806" +content-hash = "101f72bf9997ae59442504beba598f808109ecb772fbd43a1fe2465bd5d6278e" diff --git a/pontos/changelog/__init__.py b/pontos/changelog/__init__.py index 7ac707f68..6fc0bffdc 100644 --- a/pontos/changelog/__init__.py +++ b/pontos/changelog/__init__.py @@ -20,8 +20,9 @@ from .errors import ChangelogBuilderError, ChangelogError from .main import main -__all__ = [ +__all__ = ( "ChangelogError", "ChangelogBuilderError", "ChangelogBuilder", -] + "main", +) diff --git a/pontos/github/actions/__init__.py b/pontos/github/actions/__init__.py index a520437b8..02156cd48 100644 --- a/pontos/github/actions/__init__.py +++ b/pontos/github/actions/__init__.py @@ -37,4 +37,5 @@ "Ref", "PullRequestState", "GitHubPullRequestEvent", + "main", ) diff --git a/pontos/github/actions/argparser.py b/pontos/github/actions/argparser.py index 1a6c08e2a..2db6bba6f 100644 --- a/pontos/github/actions/argparser.py +++ b/pontos/github/actions/argparser.py @@ -24,7 +24,7 @@ def split_pairs(value: str): - if not "=" in value: + if "=" not in value: raise ValueError(f"Must contain a 'name=value' pair not '{value}'.") return tuple(value.split("=", 1)) diff --git a/pontos/github/actions/core.py b/pontos/github/actions/core.py index 091f9a1ca..8bb80528c 100644 --- a/pontos/github/actions/core.py +++ b/pontos/github/actions/core.py @@ -84,7 +84,7 @@ def group(cls, title: str): @staticmethod def start_group(title: str): """ - Start a new folable group + Start a new foldable group Args: title: Title of the group @@ -196,7 +196,7 @@ def debug(message: str): These messages are only shown if the secret ACTIONS_STEP_DEBUG is set to true. See https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging - """ + """ # noqa: E501 print(f"::debug::{message}") diff --git a/pontos/github/actions/event.py b/pontos/github/actions/event.py index cd9e0f80a..f61abeab5 100644 --- a/pontos/github/actions/event.py +++ b/pontos/github/actions/event.py @@ -97,7 +97,7 @@ def __init__(self, pull_request_data: Dict[str, Any]): self.draft = data.get("draft") self.number = data.get("number") - self.labels = [Label(label.get("name")) for label in data.get("labels")] # type: ignore #pylint: disable=line-too-long + self.labels = [Label(label.get("name")) for label in data.get("labels")] # type: ignore #pylint: disable=line-too-long # noqa: E501 self.title = data.get("title") self.merged = data.get("merged") self.state = PullRequestState(data.get("state")) diff --git a/pontos/github/api/artifacts.py b/pontos/github/api/artifacts.py index 2b2f7db83..f4898e1a8 100644 --- a/pontos/github/api/artifacts.py +++ b/pontos/github/api/artifacts.py @@ -117,7 +117,7 @@ def get_workflow_run_artifacts( async with GitHubAsyncRESTApi(token) as api: async for artifact in api.artifacts.get_workflow_run_artifacts("foo/bar", 234): print(artifact) - """ + """ # noqa: E501 api = f"/repos/{repo}/actions/runs/{run}/artifacts" return self._get_paged_artifacts(api) diff --git a/pontos/github/api/release.py b/pontos/github/api/release.py index 34217b717..3d5b15842 100644 --- a/pontos/github/api/release.py +++ b/pontos/github/api/release.py @@ -173,7 +173,7 @@ def download_release_tarball( async for content, progress in download: f.write(content) print(progress) - """ + """ # noqa: E501 api = f"https://github.com/{repo}/archive/refs/tags/{tag}.tar.gz" return download_async(self._client.stream(api)) @@ -206,7 +206,7 @@ def download_release_zip( async for content, progress in download: f.write(content) print(progress) - """ + """ # noqa: E501 api = f"https://github.com/{repo}/archive/refs/tags/{tag}.zip" return download_async(self._client.stream(api)) @@ -258,7 +258,7 @@ async def download_asset(name: str, download_cm) -> Path: ) file_paths = await asyncio.gather(*tasks) - """ + """ # noqa: E501 release = await self.get(repo, tag) assets_url = release.assets_url if not assets_url: @@ -320,7 +320,7 @@ async def upload_release_assets( "foo/bar", "1.2.3", files ): print(f"Uploaded: {uploaded_file}") - """ + """ # noqa: E501 release = await self.get(repo, tag) asset_url = release.upload_url.replace("{?name,label}", "") diff --git a/pontos/github/api/teams.py b/pontos/github/api/teams.py index 03f1477d2..a22af9cbe 100644 --- a/pontos/github/api/teams.py +++ b/pontos/github/api/teams.py @@ -117,7 +117,7 @@ async def create( async with GitHubAsyncRESTApi(token) as api: team = await api.teams.create("foo", "devops") print(team) - """ + """ # noqa: E501 api = f"/orgs/{organization}/teams" data: Dict[str, Any] = {"name": name} if description: @@ -219,7 +219,7 @@ async def update( team = await api.teams.update( "foo", "devops", name="DevSecOps" ) - """ + """ # noqa: E501 api = f"/orgs/{organization}/teams/{team}" data: Dict[str, Any] = {} if name: diff --git a/pontos/github/models/__init__.py b/pontos/github/models/__init__.py index 10078b6d1..7ac0468a6 100644 --- a/pontos/github/models/__init__.py +++ b/pontos/github/models/__init__.py @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# ruff: noqa: F403 + from pontos.github.models.artifact import * from pontos.github.models.base import * from pontos.github.models.branch import * diff --git a/pontos/models/__init__.py b/pontos/models/__init__.py index 6a4f27677..96cd32225 100644 --- a/pontos/models/__init__.py +++ b/pontos/models/__init__.py @@ -162,10 +162,10 @@ def from_dict(cls, data: Dict[str, Any]): try: if isinstance(value, list): model_field_cls = type_hints.get(name) - value = [cls._get_value(model_field_cls, v) for v in value] # type: ignore # pylint: disable= line-too-long + value = [cls._get_value(model_field_cls, v) for v in value] # type: ignore # pylint: disable=line-too-long # noqa: E501 elif value is not None: model_field_cls = type_hints.get(name) - value = cls._get_value(model_field_cls, value) # type: ignore # pylint: disable= line-too-long + value = cls._get_value(model_field_cls, value) # type: ignore # pylint: disable=line-too-long # noqa: E501 except TypeError as e: raise ModelError( f"Error while creating {cls.__name__}. Could not set value " diff --git a/pontos/nvd/__init__.py b/pontos/nvd/__init__.py index a4fc2dd80..006919caf 100644 --- a/pontos/nvd/__init__.py +++ b/pontos/nvd/__init__.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from .api import * +from .api import NVDApi, convert_camel_case, format_date, now __all__ = ( "convert_camel_case", diff --git a/pontos/nvd/cve/__init__.py b/pontos/nvd/cve/__init__.py index efa2de0cf..3bddaf955 100644 --- a/pontos/nvd/cve/__init__.py +++ b/pontos/nvd/cve/__init__.py @@ -19,7 +19,7 @@ from argparse import ArgumentParser, Namespace from typing import Callable -from pontos.nvd.cve.api import * +from pontos.nvd.cve.api import CVEApi __all__ = ("CVEApi",) diff --git a/pontos/release/__init__.py b/pontos/release/__init__.py index 52eecd50f..7b94aad37 100644 --- a/pontos/release/__init__.py +++ b/pontos/release/__init__.py @@ -30,4 +30,5 @@ "SignCommand", "SignatureError", "SignReturnValue", + "main", ) diff --git a/pontos/release/main.py b/pontos/release/main.py index f1ba69c4c..9ea3f0b92 100644 --- a/pontos/release/main.py +++ b/pontos/release/main.py @@ -56,7 +56,7 @@ def main( term.print(f"Output was: {error}") sys.exit(1) except subprocess.CalledProcessError as e: - if not "--passphrase" in e.cmd: + if "--passphrase" not in e.cmd: term.error(f'Could not run command "{e.cmd}".') else: term.error("Headless signing failed.") diff --git a/pontos/release/sign.py b/pontos/release/sign.py index cd542b8bb..190dc337f 100644 --- a/pontos/release/sign.py +++ b/pontos/release/sign.py @@ -291,7 +291,7 @@ async def run( ) # pylint: disable=line-too-long - async for name, download_cm in github.releases.download_release_assets( + async for name, download_cm in github.releases.download_release_assets( # noqa: E501 repo, git_version, ): @@ -350,7 +350,7 @@ async def run( try: # pylint: disable=line-too-long - async for uploaded_file in github.releases.upload_release_assets( + async for uploaded_file in github.releases.upload_release_assets( # noqa: E501 repo, git_version, upload_files ): self.terminal.ok(f"Uploaded: {uploaded_file}") diff --git a/pontos/version/__init__.py b/pontos/version/__init__.py index 98a1ae47a..535dbdfa9 100644 --- a/pontos/version/__init__.py +++ b/pontos/version/__init__.py @@ -28,4 +28,5 @@ "Version", "VersionCalculator", "VersionUpdate", + "main", ) diff --git a/pontos/version/commands/_python.py b/pontos/version/commands/_python.py index 343798213..503b4dead 100644 --- a/pontos/version/commands/_python.py +++ b/pontos/version/commands/_python.py @@ -48,7 +48,7 @@ def _get_version_from_pyproject_toml(self) -> Version: if ( "tool" in self.pyproject_toml and "poetry" in self.pyproject_toml["tool"] # type: ignore - and "version" in self.pyproject_toml["tool"]["poetry"] # type: ignore # pylint: disable=line-too-long + and "version" in self.pyproject_toml["tool"]["poetry"] # type: ignore # pylint: disable=line-too-long # noqa: E501 ): return PEP440VersioningScheme.parse_version( self.pyproject_toml["tool"]["poetry"]["version"] @@ -84,10 +84,10 @@ def _update_pyproject_version( if "poetry" not in pyproject_toml["tool"]: # type: ignore poetry_table = tomlkit.table() - # pylint: disable=line-too-long, no-member # ignore pylint (2.13.9) error: pontos/version/python.py:128:12: E1101: Instance of 'OutOfOrderTableProxy' has no 'add' member (no-member) + # pylint: disable=line-too-long, no-member # ignore pylint (2.13.9) error: pontos/version/python.py:128:12: E1101: Instance of 'OutOfOrderTableProxy' has no 'add' member (no-member) # noqa: E501 pyproject_toml["tool"].add("poetry", poetry_table) # type: ignore - pyproject_toml["tool"]["poetry"]["version"] = str(new_version) # type: ignore # pylint: disable=line-too-long + pyproject_toml["tool"]["poetry"]["version"] = str(new_version) # type: ignore # pylint: disable=line-too-long # noqa: E501 self.project_file_path.write_text( tomlkit.dumps(pyproject_toml), encoding="utf-8" @@ -115,14 +115,14 @@ def version_file_path(self) -> Path: if ( "tool" not in self.pyproject_toml or "pontos" not in self.pyproject_toml["tool"] # type: ignore - or "version" not in self.pyproject_toml["tool"]["pontos"] # type: ignore # pylint: disable=line-too-long + or "version" not in self.pyproject_toml["tool"]["pontos"] # type: ignore # pylint: disable=line-too-long # noqa: E501 ): raise VersionError( "[tool.pontos.version] section missing " f"in {self.project_file_path}." ) - pontos_version_settings = self.pyproject_toml["tool"]["pontos"][ # type: ignore # pylint: disable=line-too-long + pontos_version_settings = self.pyproject_toml["tool"]["pontos"][ # type: ignore # pylint: disable=line-too-long # noqa: E501 "version" ] diff --git a/pontos/version/main.py b/pontos/version/main.py index 2b545a454..84273562e 100644 --- a/pontos/version/main.py +++ b/pontos/version/main.py @@ -21,7 +21,6 @@ from pontos.errors import PontosError -from .__version__ import __version__ from .parser import parse_args from .project import Project from .schemes import VersioningScheme diff --git a/pyproject.toml b/pyproject.toml index d439d1502..e98f688a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,9 +47,9 @@ lxml = ">=4.9.0" [tool.poetry.dev-dependencies] autohooks = { version = ">=22.7.0", python = "^3.9" } -autohooks-plugin-pylint = { version = ">=21.6.0", python = "^3.9" } autohooks-plugin-black = { version = ">=22.7.0", python = "^3.9" } autohooks-plugin-isort = { version = ">=22.3.0", python = "^3.9" } +autohooks-plugin-ruff = { version = ">=23.6.1", python = "^3.9" } rope = ">=1.9.0" coverage = ">=7.2" myst-parser = ">=0.19.1" @@ -76,13 +76,17 @@ exclude = ''' ''' [tool.autohooks] -pre-commit = ['autohooks.plugins.black', 'autohooks.plugins.isort', 'autohooks.plugins.pylint'] +pre-commit = ['autohooks.plugins.black', 'autohooks.plugins.isort', 'autohooks.plugins.ruff'] mode = "poetry" [tool.isort] profile = "black" line_length = 80 +[tool.ruff] +line-length = 80 +target-version = "py39" + [tool.pontos.version] version-module-file = "pontos/version/__version__.py" diff --git a/tests/git/test_git.py b/tests/git/test_git.py index 9531a46de..85d421f06 100644 --- a/tests/git/test_git.py +++ b/tests/git/test_git.py @@ -525,7 +525,7 @@ def test_log(self, exec_git_mock): Date: Wed Apr 8 14:28:53 2020 +0200 Initial commit -""" +""" # noqa: E501 git = Git() logs = git.log() diff --git a/tests/github/actions/test_core.py b/tests/github/actions/test_core.py index c3e300093..ba4c69085 100644 --- a/tests/github/actions/test_core.py +++ b/tests/github/actions/test_core.py @@ -50,7 +50,7 @@ def test_warning(self, print_mock): title="Foo Bar", ) print_mock.assert_called_once_with( - "::warning file=bar,line=123,endLine=234,col=1,endColumn=2,title=Foo Bar::foo" # pylint: disable=line-too-long + "::warning file=bar,line=123,endLine=234,col=1,endColumn=2,title=Foo Bar::foo" # pylint: disable=line-too-long # noqa: E501 ) def test_error(self, print_mock): @@ -64,7 +64,7 @@ def test_error(self, print_mock): title="Foo Bar", ) print_mock.assert_called_once_with( - "::error file=bar,line=123,endLine=234,col=1,endColumn=2,title=Foo Bar::foo" # pylint: disable=line-too-long + "::error file=bar,line=123,endLine=234,col=1,endColumn=2,title=Foo Bar::foo" # pylint: disable=line-too-long # noqa: E501 ) def test_notice(self, print_mock): @@ -78,7 +78,7 @@ def test_notice(self, print_mock): title="Foo Bar", ) print_mock.assert_called_once_with( - "::notice file=bar,line=123,endLine=234,col=1,endColumn=2,title=Foo Bar::foo" # pylint: disable=line-too-long + "::notice file=bar,line=123,endLine=234,col=1,endColumn=2,title=Foo Bar::foo" # pylint: disable=line-too-long # noqa: E501 ) def test_log(self, print_mock): diff --git a/tests/github/api/test_pull_requests.py b/tests/github/api/test_pull_requests.py index f60e4f24e..607c87812 100644 --- a/tests/github/api/test_pull_requests.py +++ b/tests/github/api/test_pull_requests.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=redefined-builtin, line-too-long, too-many-lines +# ruff: noqa: E501 from pathlib import Path from unittest.mock import MagicMock @@ -770,7 +771,7 @@ async def test_commits(self): { "url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e", "sha": "6dcb09b5b57875f334f61aebed695e2e4193db53", - "node_id": "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==", + "node_id": "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==", # noqa: E501 "html_url": "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e", "comments_url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments", "commit": { diff --git a/tests/github/api/test_tags.py b/tests/github/api/test_tags.py index 25b7e7cf0..f9e7c760a 100644 --- a/tests/github/api/test_tags.py +++ b/tests/github/api/test_tags.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=too-many-lines, redefined-builtin, line-too-long +# ruff: noqa: E501 from datetime import datetime, timezone from unittest.mock import MagicMock diff --git a/tests/github/models/test_organization.py b/tests/github/models/test_organization.py index 563594fab..76705d22b 100644 --- a/tests/github/models/test_organization.py +++ b/tests/github/models/test_organization.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=line-too-long, redefined-builtin +# ruff: noqa: E501 import unittest from datetime import datetime, timezone diff --git a/tests/github/models/test_tag.py b/tests/github/models/test_tag.py index 962bcf045..91d472ff7 100644 --- a/tests/github/models/test_tag.py +++ b/tests/github/models/test_tag.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=line-too-long +# ruff: noqa: E501 import unittest from datetime import datetime, timezone diff --git a/tests/nvd/cpe/test_api.py b/tests/nvd/cpe/test_api.py index 0fac1ec77..05ecacf2d 100644 --- a/tests/nvd/cpe/test_api.py +++ b/tests/nvd/cpe/test_api.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=line-too-long, arguments-differ, redefined-builtin +# ruff: noqa: E501 from datetime import datetime from typing import Any, Dict, List, Optional diff --git a/tests/nvd/models/test_cpe.py b/tests/nvd/models/test_cpe.py index 06db7e908..050c8728e 100644 --- a/tests/nvd/models/test_cpe.py +++ b/tests/nvd/models/test_cpe.py @@ -14,6 +14,7 @@ # along with this program. If not, see . # pylint: disable=line-too-long +# ruff: noqa: E501 import unittest from datetime import datetime diff --git a/tests/nvd/models/test_cve.py b/tests/nvd/models/test_cve.py index f54047b51..c7a2d1b12 100644 --- a/tests/nvd/models/test_cve.py +++ b/tests/nvd/models/test_cve.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=line-too-long +# ruff: noqa: E501 import unittest from datetime import date, datetime diff --git a/tests/test_helper.py b/tests/test_helper.py index d09925f63..7480acbd8 100644 --- a/tests/test_helper.py +++ b/tests/test_helper.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=redefined-builtin,disallowed-name +# ruff: noqa: E501 import unittest from enum import Enum @@ -485,13 +486,13 @@ class AddSysPathTestCase(unittest.TestCase): def test_add_sys_path(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule + import mymodule # noqa: F811,F401 with temp_file("", name="mymodule.py") as module_path, add_sys_path( module_path.parent ): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule + import mymodule # noqa: F811,F401 unload_module("mymodule") @@ -502,11 +503,11 @@ def test_ensure_unload_module(self): "def foo():\n pass", name="bar" ), ensure_unload_module("bar"): # pylint: disable=import-error,import-outside-toplevel,unused-import - import bar + import bar # noqa: F401,F811 with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import bar + import bar # noqa: F401,F811 def test_ensure_unload_module_exception(self): with self.assertRaisesRegex(ValueError, "Ipsum"): @@ -525,14 +526,14 @@ def test_ensure_unload_module_exception(self): def test_add_sys_path_exception(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule + import mymodule # noqa: F811,F401 try: with temp_file("", name="mymodule.py") as module_path, add_sys_path( module_path.parent ): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule + import mymodule # noqa: F811,F401 raise ValueError() except ValueError: @@ -542,7 +543,7 @@ def test_add_sys_path_exception(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule + import mymodule # noqa: F401,F811 class SnakeCaseTestCase(unittest.TestCase): diff --git a/tests/testing/test_testing.py b/tests/testing/test_testing.py index da7f7341a..8e9e01597 100644 --- a/tests/testing/test_testing.py +++ b/tests/testing/test_testing.py @@ -66,14 +66,14 @@ def test_temp_directory_change_into(self): def test_temp_directory_add_to_sys_path(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule2 + import mymodule2 # noqa: F401,F811 with temp_directory(add_to_sys_path=True) as module_path: mymodule_file = module_path / "mymodule2.py" mymodule_file.touch() # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule2 + import mymodule2 # noqa: F401,F811 unload_module("mymodule") @@ -170,31 +170,31 @@ class TempPythonModuleTestCase(unittest.TestCase): def test_temp_python_module(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import foo + import foo # noqa: F401,F811 with temp_python_module("def foo():\n pass") as module_path: self.assertTrue(module_path.exists()) # pylint: disable=import-error,import-outside-toplevel,unused-import - import foo + import foo # noqa: F401,F811 self.assertFalse(module_path.exists()) with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import foo + import foo # noqa: F401,F811 def test_temp_python_module_exception(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import foo + import foo # noqa: F401,F811 try: with temp_python_module("def foo():\n pass") as module_path: self.assertTrue(module_path.exists()) - # pylint: disable=import-error,import-outside-toplevel,unused-import - import foo + # pylint: disable=import-error,import-outside-toplevel,unused-import # noqa: E501 + import foo # noqa: F401,F811 raise ValueError() except ValueError: @@ -204,12 +204,12 @@ def test_temp_python_module_exception(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import foo + import foo # noqa: F401,F811 def test_temp_python_module_name(self): with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule3 + import mymodule3 # noqa: F401,F811 with temp_python_module( "def foo():\n pass", name="mymodule3" @@ -217,10 +217,10 @@ def test_temp_python_module_name(self): self.assertTrue(module_path.exists()) # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule3 + import mymodule3 # noqa: F401,F811 self.assertFalse(module_path.exists()) with self.assertRaises(ImportError): # pylint: disable=import-error,import-outside-toplevel,unused-import - import mymodule3 + import mymodule3 # noqa: F401,F811 diff --git a/tests/version/commands/test_java.py b/tests/version/commands/test_java.py index 2c0157c48..76eeb48cf 100644 --- a/tests/version/commands/test_java.py +++ b/tests/version/commands/test_java.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # pylint: disable=line-too-long +# ruff: noqa: E501 import unittest from pathlib import Path