From f33b55960c2961b5d406362dbf03a4eee7a5bacc Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Tue, 23 Apr 2024 23:17:48 +0200 Subject: [PATCH 1/8] replace black by ruff + misc cleanup --- README.md | 4 +- docker-compose.yml | 1 - galaxy.yml | 2 +- plugins/action/query_graphql.py | 2 +- plugins/lookup/lookup.py | 2 +- plugins/module_utils/infrahub_utils.py | 3 +- plugins/modules/artifact_fetch.py | 2 +- plugins/modules/query_graphql.py | 2 +- poetry.lock | 321 ++++--------------------- pyproject.toml | 184 +++++++------- tasks/galaxy.py | 2 +- 11 files changed, 150 insertions(+), 375 deletions(-) diff --git a/README.md b/README.md index 84ab187..70c8f9c 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ To keep the code simple, we only officially support the two latest releases of I Requirements - The two latest Infrahub releases -- Python >=3.9, <3.12 +- Python >=3.9, <3.13 - Python modules: - - infrahub-sdk >= 0.2.0 + - infrahub-sdk >= 0.9.0 - Ansible 2.12+ - Infrahub write-enabled token when using modules or read-only token for `lookup/inventory` diff --git a/docker-compose.yml b/docker-compose.yml index 3511638..d8cb993 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,7 +36,6 @@ services: networks: - integration_network -# Attach these services to the infrahub network that gets spun up from invoke start networks: integration_network: name: infrahub_ansible_default diff --git a/galaxy.yml b/galaxy.yml index d48def9..69e0b1e 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -10,7 +10,7 @@ namespace: opsmill name: infrahub # The version of the collection. Must be compatible with semantic versioning -version: 1.0.3 +version: 1.0.4 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/plugins/action/query_graphql.py b/plugins/action/query_graphql.py index e55ac36..c658652 100644 --- a/plugins/action/query_graphql.py +++ b/plugins/action/query_graphql.py @@ -74,7 +74,7 @@ def run(self, tmp=None, task_vars=None): update_hostvars = args.get("update_hostvars", False) if query is None: raise AnsibleError("Query parameter was not passed") - if isinstance(query, str) or isinstance(query, Dict): + if isinstance(query, (Dict, str)): graphql_query = query if graph_variables is not None and not isinstance(graph_variables, Dict): raise AnsibleError("graph_variables parameter must be a list of Dict") diff --git a/plugins/lookup/lookup.py b/plugins/lookup/lookup.py index 5bad347..2b94924 100644 --- a/plugins/lookup/lookup.py +++ b/plugins/lookup/lookup.py @@ -148,7 +148,7 @@ def run(self, terms, variables=None, query=None, graph_variables=None, **kwargs) if query is None: raise AnsibleLookupError("Query parameter was not passed") - if isinstance(query, str) or isinstance(query, Dict): + if isinstance(query, (Dict, str)): graphql_query = query else: raise AnsibleLookupError("Query parameter must be either a string or a Dictionary") diff --git a/plugins/module_utils/infrahub_utils.py b/plugins/module_utils/infrahub_utils.py index 2ab993c..3a44811 100644 --- a/plugins/module_utils/infrahub_utils.py +++ b/plugins/module_utils/infrahub_utils.py @@ -498,8 +498,7 @@ def fetch_and_process( if variables: # TODO Need a rendering raise Exception("query need to be a dict if your are using variables") - else: - query_str = query + query_str = query else: raise Exception("query is neither a string nor a Dict") diff --git a/plugins/modules/artifact_fetch.py b/plugins/modules/artifact_fetch.py index 5e50c90..44c19ad 100644 --- a/plugins/modules/artifact_fetch.py +++ b/plugins/modules/artifact_fetch.py @@ -1,8 +1,8 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2023 Damien Garros # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Ansible plugin definition for artifact_fetch action plugin.""" + from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/plugins/modules/query_graphql.py b/plugins/modules/query_graphql.py index dce9d18..42d0eb1 100644 --- a/plugins/modules/query_graphql.py +++ b/plugins/modules/query_graphql.py @@ -1,8 +1,8 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2023 Benoit Kohler # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Ansible plugin definition for query_graphql action plugin.""" + from __future__ import absolute_import, division, print_function __metaclass__ = type diff --git a/poetry.lock b/poetry.lock index 70496b3..40049f9 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiofiles" @@ -336,25 +336,6 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] -[[package]] -name = "astroid" -version = "2.15.8" -description = "An abstract syntax tree for Python with inference support." -optional = false -python-versions = ">=3.7.2" -files = [ - {file = "astroid-2.15.8-py3-none-any.whl", hash = "sha256:1aa149fc5c6589e3d0ece885b4491acd80af4f087baafa3fb5203b113e68cd3c"}, - {file = "astroid-2.15.8.tar.gz", hash = "sha256:6c107453dffee9055899705de3c9ead36e74119cee151e5a9aaf7f0b0e020a6a"}, -] - -[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 = "async-timeout" version = "4.0.3" @@ -833,20 +814,6 @@ ordered-set = ">=4.0.2,<4.2.0" cli = ["click (==8.1.3)", "pyyaml (==6.0.1)"] optimize = ["orjson"] -[[package]] -name = "dill" -version = "0.3.7" -description = "serialize all of Python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "dill-0.3.7-py3-none-any.whl", hash = "sha256:76b122c08ef4ce2eedcd4d1abd8e641114bfc6c2867f49f3c41facf65bf19f5e"}, - {file = "dill-0.3.7.tar.gz", hash = "sha256:cc1c8b182eb3013e24bd475ff2e9295af86c1a38eb1aff128dac8962a9ce3c03"}, -] - -[package.extras] -graph = ["objgraph (>=1.7.2)"] - [[package]] name = "docutils" version = "0.17.1" @@ -1158,32 +1125,38 @@ testing = ["pytest (>=3.5,!=3.7.3)", "pytest-black (>=0.3.7)", "pytest-checkdocs [[package]] name = "infrahub-sdk" -version = "0.8.0" +version = "0.9.1" description = "Python Client to interact with Infrahub" optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "infrahub_sdk-0.8.0-py3-none-any.whl", hash = "sha256:d07c6b7213d822414c841be262705af7f0448f991a2c8913510222a538ea3218"}, - {file = "infrahub_sdk-0.8.0.tar.gz", hash = "sha256:5302796edcfc553cf43c67aa0700ab3f36ec009c7d6d5cce70cf922cd30cc2f9"}, + {file = "infrahub_sdk-0.9.1-py3-none-any.whl", hash = "sha256:b2231d3889c6f593b512b00622ca92f7b00b4af160f32a088877a7a4f6668ee7"}, + {file = "infrahub_sdk-0.9.1.tar.gz", hash = "sha256:f2834d0d71f660e0af7d8a4644610ce15fa95e5d9227f12817e7400d230b04fb"}, ] [package.dependencies] -deepdiff = ">=6.2,<7.0" -gitpython = ">=3.1.41,<4.0.0" -graphql-core = ">=3.2.3,<4.0.0" -httpx = ">=0.23,<0.24" -Jinja2 = ">=3.1.3,<4.0.0" -jsonlines = ">=3.1,<4.0" -numpy = {version = ">=1.24.2,<2.0.0", markers = "python_version >= \"3.8\" and python_version < \"3.12\""} -pendulum = {version = ">=2.1", markers = "python_version >= \"3.8\" and python_version < \"3.12\""} -pyarrow = ">=14.0.1,<15.0.0" +gitpython = ">=3,<4" +graphql-core = ">=3.1,<3.3" +httpx = [ + {version = ">=0.20", markers = "python_version >= \"3.8\" and python_version < \"3.11\""}, + {version = ">=0.23", markers = "python_version >= \"3.11\""}, +] +Jinja2 = {version = ">=3,<4", optional = true, markers = "extra == \"ctl\" or extra == \"tests\" or extra == \"all\""} +numpy = {version = ">=1.24.2,<2.0.0", optional = true, markers = "python_version >= \"3.8\" and python_version < \"3.12\" and (extra == \"ctl\" or extra == \"all\")"} +pendulum = {version = ">=2", markers = "python_version >= \"3.8\" and python_version < \"3.12\""} +pyarrow = {version = ">=14,<15", optional = true, markers = "extra == \"ctl\" or extra == \"all\""} pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" -pytest = "*" -pyyaml = ">=6.0,<7.0" -rich = ">=13.3,<14.0" -toml = ">=0.10.2,<0.11.0" -typer = ">=0.7,<0.8" -ujson = ">=5.7,<6.0" +pytest = {version = "*", optional = true, markers = "extra == \"tests\" or extra == \"all\""} +pyyaml = {version = ">=6,<7", optional = true, markers = "extra == \"ctl\" or extra == \"tests\" or extra == \"all\""} +rich = {version = ">=13,<14", optional = true, markers = "extra == \"ctl\" or extra == \"tests\" or extra == \"all\""} +toml = {version = ">=0.10,<0.11", optional = true, markers = "extra == \"ctl\" or extra == \"all\""} +typer = {version = ">=0,<1", optional = true, markers = "extra == \"ctl\" or extra == \"all\""} +ujson = {version = ">=5,<6", optional = true, markers = "extra == \"ctl\" or extra == \"all\""} + +[package.extras] +all = ["Jinja2 (>=3,<4)", "numpy (>=1.24.2,<2.0.0)", "numpy (>=1.26.2,<2.0.0)", "pyarrow (>=14,<15)", "pytest", "pyyaml (>=6,<7)", "rich (>=13,<14)", "toml (>=0.10,<0.11)", "typer (>=0,<1)", "ujson (>=5,<6)"] +ctl = ["Jinja2 (>=3,<4)", "numpy (>=1.24.2,<2.0.0)", "numpy (>=1.26.2,<2.0.0)", "pyarrow (>=14,<15)", "pyyaml (>=6,<7)", "rich (>=13,<14)", "toml (>=0.10,<0.11)", "typer (>=0,<1)", "ujson (>=5,<6)"] +tests = ["Jinja2 (>=3,<4)", "pytest", "pyyaml (>=6,<7)", "rich (>=13,<14)"] [[package]] name = "iniconfig" @@ -1207,23 +1180,6 @@ files = [ {file = "invoke-2.2.0.tar.gz", hash = "sha256:ee6cbb101af1a859c7fe84f2a264c059020b0cb7fe3535f9424300ab568f6bd5"}, ] -[[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]] name = "jinja2" version = "3.1.3" @@ -1263,20 +1219,6 @@ files = [ {file = "jsondiff-2.0.0.tar.gz", hash = "sha256:2795844ef075ec8a2b8d385c4d59f5ea48b08e7180fce3cb2787be0db00b1fb4"}, ] -[[package]] -name = "jsonlines" -version = "3.1.0" -description = "Library with helpers for the jsonlines file format" -optional = false -python-versions = ">=3.6" -files = [ - {file = "jsonlines-3.1.0-py3-none-any.whl", hash = "sha256:632f5e38f93dfcb1ac8c4e09780b92af3a55f38f26e7c47ae85109d420b6ad39"}, - {file = "jsonlines-3.1.0.tar.gz", hash = "sha256:2579cb488d96f815b0eb81629e3e6b0332da0962a18fa3532958f7ba14a5c37f"}, -] - -[package.dependencies] -attrs = ">=19.2.0" - [[package]] name = "jsonschema" version = "4.20.0" @@ -1312,51 +1254,6 @@ files = [ [package.dependencies] referencing = ">=0.31.0" -[[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 = "markdown-it-py" version = "3.0.0" @@ -1440,17 +1337,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 = "mdurl" version = "0.1.2" @@ -1974,35 +1860,6 @@ files = [ plugins = ["importlib-metadata"] windows-terminal = ["colorama (>=0.4.6)"] -[[package]] -name = "pylint" -version = "2.17.7" -description = "python code static checker" -optional = false -python-versions = ">=3.7.2" -files = [ - {file = "pylint-2.17.7-py3-none-any.whl", hash = "sha256:27a8d4c7ddc8c2f8c18aa0050148f89ffc09838142193fdbe98f172781a3ff87"}, - {file = "pylint-2.17.7.tar.gz", hash = "sha256:f4fcac7ae74cfe36bc8451e931d8438e4a476c20314b1101c458ad0f05191fad"}, -] - -[package.dependencies] -astroid = ">=2.15.8,<=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 = "pytest" version = "7.4.3" @@ -2470,28 +2327,28 @@ files = [ [[package]] name = "ruff" -version = "0.1.15" +version = "0.3.3" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:5fe8d54df166ecc24106db7dd6a68d44852d14eb0729ea4672bb4d96c320b7df"}, - {file = "ruff-0.1.15-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6f0bfbb53c4b4de117ac4d6ddfd33aa5fc31beeaa21d23c45c6dd249faf9126f"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e0d432aec35bfc0d800d4f70eba26e23a352386be3a6cf157083d18f6f5881c8"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9405fa9ac0e97f35aaddf185a1be194a589424b8713e3b97b762336ec79ff807"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c66ec24fe36841636e814b8f90f572a8c0cb0e54d8b5c2d0e300d28a0d7bffec"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:6f8ad828f01e8dd32cc58bc28375150171d198491fc901f6f98d2a39ba8e3ff5"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86811954eec63e9ea162af0ffa9f8d09088bab51b7438e8b6488b9401863c25e"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fd4025ac5e87d9b80e1f300207eb2fd099ff8200fa2320d7dc066a3f4622dc6b"}, - {file = "ruff-0.1.15-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b17b93c02cdb6aeb696effecea1095ac93f3884a49a554a9afa76bb125c114c1"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ddb87643be40f034e97e97f5bc2ef7ce39de20e34608f3f829db727a93fb82c5"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:abf4822129ed3a5ce54383d5f0e964e7fef74a41e48eb1dfad404151efc130a2"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6c629cf64bacfd136c07c78ac10a54578ec9d1bd2a9d395efbee0935868bf852"}, - {file = "ruff-0.1.15-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1bab866aafb53da39c2cadfb8e1c4550ac5340bb40300083eb8967ba25481447"}, - {file = "ruff-0.1.15-py3-none-win32.whl", hash = "sha256:2417e1cb6e2068389b07e6fa74c306b2810fe3ee3476d5b8a96616633f40d14f"}, - {file = "ruff-0.1.15-py3-none-win_amd64.whl", hash = "sha256:3837ac73d869efc4182d9036b1405ef4c73d9b1f88da2413875e34e0d6919587"}, - {file = "ruff-0.1.15-py3-none-win_arm64.whl", hash = "sha256:9a933dfb1c14ec7a33cceb1e49ec4a16b51ce3c20fd42663198746efc0427360"}, - {file = "ruff-0.1.15.tar.gz", hash = "sha256:f6dfa8c1b21c913c326919056c390966648b680966febcb796cc9d1aaab8564e"}, + {file = "ruff-0.3.3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:973a0e388b7bc2e9148c7f9be8b8c6ae7471b9be37e1cc732f8f44a6f6d7720d"}, + {file = "ruff-0.3.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cfa60d23269d6e2031129b053fdb4e5a7b0637fc6c9c0586737b962b2f834493"}, + {file = "ruff-0.3.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1eca7ff7a47043cf6ce5c7f45f603b09121a7cc047447744b029d1b719278eb5"}, + {file = "ruff-0.3.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7d3f6762217c1da954de24b4a1a70515630d29f71e268ec5000afe81377642d"}, + {file = "ruff-0.3.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b24c19e8598916d9c6f5a5437671f55ee93c212a2c4c569605dc3842b6820386"}, + {file = "ruff-0.3.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5a6cbf216b69c7090f0fe4669501a27326c34e119068c1494f35aaf4cc683778"}, + {file = "ruff-0.3.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:352e95ead6964974b234e16ba8a66dad102ec7bf8ac064a23f95371d8b198aab"}, + {file = "ruff-0.3.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d6ab88c81c4040a817aa432484e838aaddf8bfd7ca70e4e615482757acb64f8"}, + {file = "ruff-0.3.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:79bca3a03a759cc773fca69e0bdeac8abd1c13c31b798d5bb3c9da4a03144a9f"}, + {file = "ruff-0.3.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2700a804d5336bcffe063fd789ca2c7b02b552d2e323a336700abb8ae9e6a3f8"}, + {file = "ruff-0.3.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fd66469f1a18fdb9d32e22b79f486223052ddf057dc56dea0caaf1a47bdfaf4e"}, + {file = "ruff-0.3.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:45817af234605525cdf6317005923bf532514e1ea3d9270acf61ca2440691376"}, + {file = "ruff-0.3.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0da458989ce0159555ef224d5b7c24d3d2e4bf4c300b85467b08c3261c6bc6a8"}, + {file = "ruff-0.3.3-py3-none-win32.whl", hash = "sha256:f2831ec6a580a97f1ea82ea1eda0401c3cdf512cf2045fa3c85e8ef109e87de0"}, + {file = "ruff-0.3.3-py3-none-win_amd64.whl", hash = "sha256:be90bcae57c24d9f9d023b12d627e958eb55f595428bafcb7fec0791ad25ddfc"}, + {file = "ruff-0.3.3-py3-none-win_arm64.whl", hash = "sha256:0171aab5fecdc54383993389710a3d1227f2da124d76a2784a7098e818f92d61"}, + {file = "ruff-0.3.3.tar.gz", hash = "sha256:38671be06f57a2f8aba957d9f701ea889aa5736be806f18c0cd03d6ff0cbca8d"}, ] [[package]] @@ -2797,17 +2654,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "tomlkit" -version = "0.12.3" -description = "Style preserving TOML library" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomlkit-0.12.3-py3-none-any.whl", hash = "sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba"}, - {file = "tomlkit-0.12.3.tar.gz", hash = "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4"}, -] - [[package]] name = "twiggy" version = "0.5.1" @@ -2964,85 +2810,6 @@ files = [ [package.dependencies] bracex = ">=2.1.1" -[[package]] -name = "wrapt" -version = "1.16.0" -description = "Module for decorators, wrappers and monkey patching." -optional = false -python-versions = ">=3.6" -files = [ - {file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"}, - {file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136"}, - {file = "wrapt-1.16.0-cp310-cp310-win32.whl", hash = "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d"}, - {file = "wrapt-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d"}, - {file = "wrapt-1.16.0-cp311-cp311-win32.whl", hash = "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362"}, - {file = "wrapt-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c"}, - {file = "wrapt-1.16.0-cp312-cp312-win32.whl", hash = "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc"}, - {file = "wrapt-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8"}, - {file = "wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465"}, - {file = "wrapt-1.16.0-cp36-cp36m-win32.whl", hash = "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e"}, - {file = "wrapt-1.16.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966"}, - {file = "wrapt-1.16.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win32.whl", hash = "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win_amd64.whl", hash = "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6"}, - {file = "wrapt-1.16.0-cp38-cp38-win32.whl", hash = "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b"}, - {file = "wrapt-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537"}, - {file = "wrapt-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3"}, - {file = "wrapt-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35"}, - {file = "wrapt-1.16.0-py3-none-any.whl", hash = "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1"}, - {file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"}, -] - [[package]] name = "yamllint" version = "1.33.0" @@ -3182,4 +2949,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "0b2bbeadb27b5732c9c54b9dd727e559daa48044320404cfe18ae450a4d5a871" +content-hash = "3ecd9839e7e4753c29901a730b8a69259ec45c9fed9e07e71d4750f3c7b05e76" diff --git a/pyproject.toml b/pyproject.toml index a72a3ea..849a4a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "infrahub_ansible_modules" -version = "1.0.3" +version = "1.0.4" description = "Ansible collection to interact with Infrahub's API" authors = ["OpsMill "] license = "GPLv3" @@ -9,9 +9,8 @@ license = "GPLv3" python = ">=3.9,<3.12" ansible-core = ">=2.15.9" ansible-lint = "*" -ruff = "^0.1.15" +infrahub-sdk = {version = "^0, >=0.9.1", extras = ["all"]} codecov = "*" -coverage = "^6.5" deepdiff = "*" cryptography = ">=42.0.0" jinja2 = ">=3.1.3" @@ -24,7 +23,6 @@ pyyaml = "*" mock = "^4.0.2" antsibull = "^0.45.1" importlib-metadata = "1.7.0" -pylint = "^2.6.0" pytz = "*" packaging = "*" jsondiff = "*" @@ -35,55 +33,19 @@ parameterized = "^0.8.1" invoke = "^2.2.0" bandit = "^1.7.7" antsibull-docs = "^1.7.3" -infrahub-sdk = "^0, >=0.7.0" -[build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +[tool.poetry.dev-dependencies] -[tool.pylint.general] -extension-pkg-whitelist = [ - "pydantic", - "ujson", -] +[tool.poetry.group.dev.dependencies] +pytest = "^7.3.1" +ruff = "0.3.3" -[tool.pylint.format] -disable = "logging-fstring-interpolation" - -[tool.pylint.basic] -# No docstrings required for private methods (Pylint default), or for test_ functions. -no-docstring-rgx="^(_|test_)" - -[tool.pylint.messages_control] -# Line length is enforced by Black, so pylint doesn't need to check it. -# Pylint and Black disagree about how to format multi-line arrays; Black wins. -disable = """, - line-too-long, - missing-module-docstring, - missing-function-docstring, - missing-class-docstring, - consider-using-from-import, - invalid-name, - too-many-arguments, - too-many-locals, - keyword-arg-before-vararg, - too-few-public-methods, - too-many-instance-attributes, - fixme, - consider-using-f-string, - protected-access, - import-self, - wrong-import-order, - """ - -[tool.pylint.miscellaneous] -notes = """, - FIXME, - XXX, - """ - -[tool.pylint.similarities] -min-similarity-lines = 20 +[tool.pytest.ini_options] +asyncio_mode = "auto" +testpaths = [ + "tests" +] +pythonpath = ["."] [tool.ruff] line-length = 120 @@ -99,43 +61,93 @@ exclude = [ "examples", ] +[tool.ruff.lint] +preview = true + task-tags = [ "FIXME", "TODO", "XXX", ] -[tool.ruff.lint] -preview = true - select = [ - # mccabe complexity - "C90", - # pycodestyle errors - "E", - # pycodestyle warnings - "W", - # pyflakes - "F", - # isort-like checks - "I", - # flake8-datetimez - "DTZ", - # flake8-import-conventions - "ICN", - # flake8-type-checking - "TCH", - # flake8-debugger - "T10", - # flake8-quotes - "Q", - # flake8-2020 - "YTT", + "ASYNC", # flake8-async + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "C90", # mccabe complexity + "DJ", # flake8-django + "DTZ", # flake8-datetimez + "E", # pycodestyle errors + "EXE", # flake8-executable + "F", # pyflakes + "I", # isort-like checks + "ICN", # flake8-import-conventions + "INP", # flake8-no-pep420 + "N", # pep8-naming + "PIE", # flake8-pie + "PL", # pylint + "PYI", # flake8-pyi + "Q", # flake8-quotes + "RET", # flake8-return + "TCH", # flake8-type-checking + "TRIO", # flake8-trio + "T10", # flake8-debugger + "W", # pycodestyle warnings + "YTT", # flake8-2020 ] ignore = [ - # module-import-not-at-top-of-file - "E402", + +################################################################################################## +# The ignored rules below should be removed once the code has been updated, they are included # +# like this so that we can reactivate them one by one. Alternatively ignored after further # +# investigation if they are deemed to not make sense. # +################################################################################################## + "ASYNC101", # Async functions should not call `open`, `time.sleep`, or `subprocess` methods + "B007", # Loop control variable not used within loop body + "B008", # Do not perform function call `Depends` in argument defaults; + "B009", # [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. + "B010", # [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. + "B015", # Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it + "B018", # Found useless expression. Either assign it to a variable or remove it. + "B026", # Star-arg unpacking after a keyword argument is strongly discouraged + "B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling + "C403", # Unnecessary `list` comprehension (rewrite as a `set` comprehension) + "C408", # Unnecessary `dict` call (rewrite as a literal) + "C409", # Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) + "C414", # Unnecessary `list` call within `sorted()` + "C419", # Unnecessary list comprehension. + "E402", # Module level import not at top of file + "INP001", # Is part of an implicit namespace package + "N801", # Class name should use CapWords convention + "N802", # Function name should be lowercase + "N805", # First argument of a method should be named self + "N806", # Variable in function should be lowercase + "N811", # Constant imported as non-constant + "N812", # Lowercase imported as non-lowercase + "PIE804", # [*] Unnecessary `dict` kwargs + "PIE807", # Prefer `dict` over useless lambda + "PIE808", # [*] Unnecessary `start` argument in `range` + "PLC0415", # `import` should be at the top-level of a file + "PLC2701", # Private name import from external module + "PLR0904", # Too many public methods + "PLR0912", # Too many branches + "PLR0913", # Too many arguments in function definition + "PLR0914", # Too many local variables + "PLR0915", # Too many statements + "PLR0916", # Too many Boolean expressions + "PLR0917", # Too many positional arguments + "PLR1702", # Too many nested blocks + "PLR2004", # Magic value used in comparison this could possibly be fine in the tests folders + "PLR6201", # Use a `set` literal when testing for membership + "PLR6301", # Method could be a function, class method, or static method + "PLW0603", # Using the global statement to update `SETTINGS` is discouraged + "PLW1508", # Invalid type for environment variable default; expected `str` or `None` + "PLW2901", # `for` loop variable `path` overwritten by assignment target + "PLW3201", # Bad or misspelled dunder method name `__init_subclass_with_meta__` + "RET502", # [*] Do not implicitly `return None` in function able to return non-`None` value + "RET503", # Missing explicit `return` at the end of function able to return non-`None` value + "RET504", # Unnecessary assignment before `return` statement ] #https://docs.astral.sh/ruff/formatter/black/ @@ -145,18 +157,16 @@ indent-style = "space" skip-magic-trailing-comma = false line-ending = "auto" +[tool.ruff.lint.isort] +known-first-party = ["infrahub"] + [tool.ruff.lint.pycodestyle] max-line-length = 150 -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] # Target max-complexity=10 -max-complexity = 31 - -[tool.ruff.per-file-ignores] +max-complexity = 33 -[tool.pytest.ini_options] -testpaths = [ - "tests" -] -python_paths = "./" -addopts = "-vv" +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" \ No newline at end of file diff --git a/tasks/galaxy.py b/tasks/galaxy.py index 1dc0ec9..6ce09c5 100644 --- a/tasks/galaxy.py +++ b/tasks/galaxy.py @@ -13,7 +13,7 @@ def galaxy_build(context: Context, force=False): """Build the collection.""" print(f" - [{NAMESPACE}] Building collection with ansible-galaxy") - exec_cmd = f"ansible-galaxy collection build {MAIN_DIRECTORY} -output-path build" + exec_cmd = f"ansible-galaxy collection build {MAIN_DIRECTORY} --output-path build" if force: exec_cmd += " --force" with context.cd(ESCAPED_REPO_PATH): From cc64326f9740cff6aa00d8e6bd7fc9cfd0c85ad7 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 24 Apr 2024 10:00:40 +0200 Subject: [PATCH 2/8] update ruff to 0.4.1 --- poetry.lock | 38 +++++++++++++++++++------------------- pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index 40049f9..c9c9bbf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2327,28 +2327,28 @@ files = [ [[package]] name = "ruff" -version = "0.3.3" +version = "0.4.1" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.3.3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:973a0e388b7bc2e9148c7f9be8b8c6ae7471b9be37e1cc732f8f44a6f6d7720d"}, - {file = "ruff-0.3.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:cfa60d23269d6e2031129b053fdb4e5a7b0637fc6c9c0586737b962b2f834493"}, - {file = "ruff-0.3.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1eca7ff7a47043cf6ce5c7f45f603b09121a7cc047447744b029d1b719278eb5"}, - {file = "ruff-0.3.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7d3f6762217c1da954de24b4a1a70515630d29f71e268ec5000afe81377642d"}, - {file = "ruff-0.3.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b24c19e8598916d9c6f5a5437671f55ee93c212a2c4c569605dc3842b6820386"}, - {file = "ruff-0.3.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5a6cbf216b69c7090f0fe4669501a27326c34e119068c1494f35aaf4cc683778"}, - {file = "ruff-0.3.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:352e95ead6964974b234e16ba8a66dad102ec7bf8ac064a23f95371d8b198aab"}, - {file = "ruff-0.3.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d6ab88c81c4040a817aa432484e838aaddf8bfd7ca70e4e615482757acb64f8"}, - {file = "ruff-0.3.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:79bca3a03a759cc773fca69e0bdeac8abd1c13c31b798d5bb3c9da4a03144a9f"}, - {file = "ruff-0.3.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2700a804d5336bcffe063fd789ca2c7b02b552d2e323a336700abb8ae9e6a3f8"}, - {file = "ruff-0.3.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fd66469f1a18fdb9d32e22b79f486223052ddf057dc56dea0caaf1a47bdfaf4e"}, - {file = "ruff-0.3.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:45817af234605525cdf6317005923bf532514e1ea3d9270acf61ca2440691376"}, - {file = "ruff-0.3.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0da458989ce0159555ef224d5b7c24d3d2e4bf4c300b85467b08c3261c6bc6a8"}, - {file = "ruff-0.3.3-py3-none-win32.whl", hash = "sha256:f2831ec6a580a97f1ea82ea1eda0401c3cdf512cf2045fa3c85e8ef109e87de0"}, - {file = "ruff-0.3.3-py3-none-win_amd64.whl", hash = "sha256:be90bcae57c24d9f9d023b12d627e958eb55f595428bafcb7fec0791ad25ddfc"}, - {file = "ruff-0.3.3-py3-none-win_arm64.whl", hash = "sha256:0171aab5fecdc54383993389710a3d1227f2da124d76a2784a7098e818f92d61"}, - {file = "ruff-0.3.3.tar.gz", hash = "sha256:38671be06f57a2f8aba957d9f701ea889aa5736be806f18c0cd03d6ff0cbca8d"}, + {file = "ruff-0.4.1-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:2d9ef6231e3fbdc0b8c72404a1a0c46fd0dcea84efca83beb4681c318ea6a953"}, + {file = "ruff-0.4.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9485f54a7189e6f7433e0058cf8581bee45c31a25cd69009d2a040d1bd4bfaef"}, + {file = "ruff-0.4.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2921ac03ce1383e360e8a95442ffb0d757a6a7ddd9a5be68561a671e0e5807e"}, + {file = "ruff-0.4.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eec8d185fe193ad053eda3a6be23069e0c8ba8c5d20bc5ace6e3b9e37d246d3f"}, + {file = "ruff-0.4.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:baa27d9d72a94574d250f42b7640b3bd2edc4c58ac8ac2778a8c82374bb27984"}, + {file = "ruff-0.4.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f1ee41580bff1a651339eb3337c20c12f4037f6110a36ae4a2d864c52e5ef954"}, + {file = "ruff-0.4.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0926cefb57fc5fced629603fbd1a23d458b25418681d96823992ba975f050c2b"}, + {file = "ruff-0.4.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2c6e37f2e3cd74496a74af9a4fa67b547ab3ca137688c484749189bf3a686ceb"}, + {file = "ruff-0.4.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efd703a5975ac1998c2cc5e9494e13b28f31e66c616b0a76e206de2562e0843c"}, + {file = "ruff-0.4.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b92f03b4aa9fa23e1799b40f15f8b95cdc418782a567d6c43def65e1bbb7f1cf"}, + {file = "ruff-0.4.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1c859f294f8633889e7d77de228b203eb0e9a03071b72b5989d89a0cf98ee262"}, + {file = "ruff-0.4.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b34510141e393519a47f2d7b8216fec747ea1f2c81e85f076e9f2910588d4b64"}, + {file = "ruff-0.4.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6e68d248ed688b9d69fd4d18737edcbb79c98b251bba5a2b031ce2470224bdf9"}, + {file = "ruff-0.4.1-py3-none-win32.whl", hash = "sha256:b90506f3d6d1f41f43f9b7b5ff845aeefabed6d2494307bc7b178360a8805252"}, + {file = "ruff-0.4.1-py3-none-win_amd64.whl", hash = "sha256:c7d391e5936af5c9e252743d767c564670dc3889aff460d35c518ee76e4b26d7"}, + {file = "ruff-0.4.1-py3-none-win_arm64.whl", hash = "sha256:a1eaf03d87e6a7cd5e661d36d8c6e874693cb9bc3049d110bc9a97b350680c43"}, + {file = "ruff-0.4.1.tar.gz", hash = "sha256:d592116cdbb65f8b1b7e2a2b48297eb865f6bdc20641879aa9d7b9c11d86db79"}, ] [[package]] @@ -2949,4 +2949,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "3ecd9839e7e4753c29901a730b8a69259ec45c9fed9e07e71d4750f3c7b05e76" +content-hash = "bd6cdaee0a67515fb1c75cbf1f0eaec82ac661a60c193beeafc20e2766a10b4f" diff --git a/pyproject.toml b/pyproject.toml index 849a4a6..f2df8bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ antsibull-docs = "^1.7.3" [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" -ruff = "0.3.3" +ruff = "0.4.1" [tool.pytest.ini_options] asyncio_mode = "auto" From 1c80d727a71ac31a22b6cef8e799937dc6000ee3 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 24 Apr 2024 10:12:49 +0200 Subject: [PATCH 3/8] update ruff rules --- pyproject.toml | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f2df8bd..086a616 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,50 +103,17 @@ ignore = [ # like this so that we can reactivate them one by one. Alternatively ignored after further # # investigation if they are deemed to not make sense. # ################################################################################################## - "ASYNC101", # Async functions should not call `open`, `time.sleep`, or `subprocess` methods - "B007", # Loop control variable not used within loop body - "B008", # Do not perform function call `Depends` in argument defaults; - "B009", # [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. - "B010", # [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. - "B015", # Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it - "B018", # Found useless expression. Either assign it to a variable or remove it. - "B026", # Star-arg unpacking after a keyword argument is strongly discouraged "B904", # Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling - "C403", # Unnecessary `list` comprehension (rewrite as a `set` comprehension) "C408", # Unnecessary `dict` call (rewrite as a literal) - "C409", # Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) - "C414", # Unnecessary `list` call within `sorted()` - "C419", # Unnecessary list comprehension. "E402", # Module level import not at top of file "INP001", # Is part of an implicit namespace package - "N801", # Class name should use CapWords convention - "N802", # Function name should be lowercase - "N805", # First argument of a method should be named self "N806", # Variable in function should be lowercase - "N811", # Constant imported as non-constant - "N812", # Lowercase imported as non-lowercase - "PIE804", # [*] Unnecessary `dict` kwargs - "PIE807", # Prefer `dict` over useless lambda - "PIE808", # [*] Unnecessary `start` argument in `range` "PLC0415", # `import` should be at the top-level of a file - "PLC2701", # Private name import from external module - "PLR0904", # Too many public methods "PLR0912", # Too many branches - "PLR0913", # Too many arguments in function definition - "PLR0914", # Too many local variables - "PLR0915", # Too many statements - "PLR0916", # Too many Boolean expressions - "PLR0917", # Too many positional arguments - "PLR1702", # Too many nested blocks - "PLR2004", # Magic value used in comparison this could possibly be fine in the tests folders "PLR6201", # Use a `set` literal when testing for membership "PLR6301", # Method could be a function, class method, or static method - "PLW0603", # Using the global statement to update `SETTINGS` is discouraged - "PLW1508", # Invalid type for environment variable default; expected `str` or `None` - "PLW2901", # `for` loop variable `path` overwritten by assignment target - "PLW3201", # Bad or misspelled dunder method name `__init_subclass_with_meta__` - "RET502", # [*] Do not implicitly `return None` in function able to return non-`None` value - "RET503", # Missing explicit `return` at the end of function able to return non-`None` value + "PLR1702", # Too many nested blocks + "PLR0913", # Too many arguments in function definition "RET504", # Unnecessary assignment before `return` statement ] From d2869053af0ef1b7340ac8616b61dd1a5a68547f Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 24 Apr 2024 10:15:27 +0200 Subject: [PATCH 4/8] fix typo --- .github/labels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/labels.yml b/.github/labels.yml index aca050d..3ef88d3 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -9,15 +9,15 @@ # CHANGES # ---------------------------------- - name: "changes/major" - description: "Breaking Changes" + description: "Breaking Changes" # Major changes that potentially break backward compatibility color: "bfd4f2" - name: "changes/minor" - description: "Breaking Changes" + description: "Feature Enhancements" # Minor feature enhancements that add new functionalities without breaking existing ones color: "fef2c0" - name: "changes/patch" - description: "Maintenance tasks" + description: "Maintenance tasks" # Patch updates for bug fixes, documentation updates, and other minor tasks color: "0366d6" # ---------------------------------- From 3d23e831e50ae41a356042821bdd5dca5ae43840 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 24 Apr 2024 10:49:31 +0200 Subject: [PATCH 5/8] update CICD to bump the version without human action --- .github/workflows/trigger-push-stable.yml | 85 ++++++++++++++++++- .../workflows/workflow-changelog-and-docs.yml | 20 ++--- .../workflows/workflow-release-drafter.yml | 28 +++--- 3 files changed, 104 insertions(+), 29 deletions(-) diff --git a/.github/workflows/trigger-push-stable.yml b/.github/workflows/trigger-push-stable.yml index 516b5da..fa44937 100644 --- a/.github/workflows/trigger-push-stable.yml +++ b/.github/workflows/trigger-push-stable.yml @@ -9,13 +9,96 @@ on: push: branches: - stable + paths-ignore: + - 'docs/**' + - 'CHANGELOG.rst' + - 'changelogs/**' jobs: + check_commit: + runs-on: ubuntu-latest + outputs: + skip: ${{ steps.filter.outputs.skip }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 # Fetches the commit history for the last 2 commits + - id: filter + run: | + commit_author=$(git log -1 --pretty=format:'%an') + commit_message=$(git log -1 --pretty=format:'%s') + if [[ "$commit_author" == "opsmill-bot" && "$commit_message" == "chore: update pyproject.toml & galaxy.yml" ]]; then + echo "skip=true" >> $GITHUB_OUTPUT + else + echo "skip=false" >> $GITHUB_OUTPUT + fi + + prepare_release: + needs: check_commit + if: needs.check_commit.outputs.skip == 'false' + runs-on: ubuntu-22.04 + outputs: + next_version: ${{ steps.version.outputs.next-version }} + steps: + - name: "Set up Python" + uses: "actions/setup-python@v5" + with: + python-version: "3.11" + + - name: "Install Poetry" + uses: "snok/install-poetry@v1" + with: + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_INFRAHUB_BOT_TOKEN }} + fetch-depth: 0 + + - name: Get Previous tag + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@master" + env: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Calculate next version + id: version + uses: patrickjahns/version-drafter-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update pyproject.toml and galaxy.yml versions + run: | + VERSION=${{ steps.version.outputs.next-version }} + sed -i "s/^version:.*/version: $VERSION/" galaxy.yml + python -c "import tomlkit; doc = tomlkit.loads(open('pyproject.toml', 'r').read()); doc['tool']['poetry']['version'] = '$VERSION'; open('pyproject.toml', 'w').write(tomlkit.dumps(doc))" + + - name: Update lock file + run: poetry lock --no-update + + - name: commit pyproject.toml and galaxy.yml + uses: github-actions-x/commit@v2.9 + with: + github-token: ${{ secrets.GH_INFRAHUB_BOT_TOKEN }} + push-branch: 'stable' + commit-message: 'chore: update pyproject.toml & galaxy.yml' + files: pyproject.toml galaxy.yml + name: opsmill-bot + email: github-bot@opsmill.com + rebase: true + changelog_and_docs: + needs: ["prepare_release"] uses: ./.github/workflows/workflow-changelog-and-docs.yml + with: + version: ${{ needs.prepare_release.outputs.next_version }} secrets: inherit release: - needs: ["changelog_and_docs"] + needs: ["prepare_release"] uses: ./.github/workflows/workflow-release-drafter.yml + with: + version: ${{ needs.prepare_release.outputs.next_version }} secrets: inherit diff --git a/.github/workflows/workflow-changelog-and-docs.yml b/.github/workflows/workflow-changelog-and-docs.yml index d5ab9f5..117edd0 100644 --- a/.github/workflows/workflow-changelog-and-docs.yml +++ b/.github/workflows/workflow-changelog-and-docs.yml @@ -4,13 +4,17 @@ name: "Update Changelog & Documentation" on: workflow_call: + inputs: + version: + required: true + type: string jobs: generate_changelog: runs-on: "ubuntu-22.04" name: "Create Changelog and Docs" steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4 with: token: ${{ secrets.GH_INFRAHUB_BOT_TOKEN }} fetch-depth: 0 @@ -26,23 +30,11 @@ jobs: - name: Install pandoc run: sudo apt-get install pandoc - - name: 'Get Previous tag' - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@master" - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - - name: calculate next version - id: version - uses: patrickjahns/version-drafter-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: "Generate Docs" run: "invoke generate-doc" - name: Generate new version in changelog.yaml - run: antsibull-changelog release -v --version "${{ steps.version.outputs.next-version }}" + run: antsibull-changelog release -v --version "${{ inputs.version }}" - name: Generate changelog.yaml run: antsichaut diff --git a/.github/workflows/workflow-release-drafter.yml b/.github/workflows/workflow-release-drafter.yml index df7ae3b..ac4399c 100644 --- a/.github/workflows/workflow-release-drafter.yml +++ b/.github/workflows/workflow-release-drafter.yml @@ -4,6 +4,15 @@ name: "Drafts your next Release notes" on: workflow_call: + inputs: + publish: + type: boolean + description: Wether to publish Release note + required: false + default: false + version: + required: true + type: string permissions: contents: read @@ -20,24 +29,15 @@ jobs: with: fetch-depth: 2 - - name: Check if there is a parent commit - id: check-parent-commit + - name: Tag new version run: | - echo "name=sha::$(git rev-parse --verify --quiet HEAD^)" >> $GITHUB_OUTPUT - - - name: Detect and tag new version - id: check-version - if: steps.check-parent-commit.outputs.sha - uses: salsify/action-detect-and-tag-new-version@v2 - with: - tag-template: "{VERSION}" - version-command: | - cat galaxy.yml | grep version: | cut -d' ' -f2 + git tag ${{ inputs.version }} + git push --tags - uses: release-drafter/release-drafter@v6 with: config-name: release-drafter.yml - publish: ${{ steps.check-version.outputs.tag != '' }} - tag: ${{ steps.check-version.outputs.tag }} + publish: ${{ inputs.publish }} + tag: ${{ inputs.version }} env: GITHUB_TOKEN: ${{ secrets.GH_INFRAHUB_BOT_TOKEN }} From aa1261e8ee6b2cc40da5b26e229844919e0bc39e Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 24 Apr 2024 10:58:50 +0200 Subject: [PATCH 6/8] repalce tomlkit by toml --- .github/workflows/trigger-push-stable.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trigger-push-stable.yml b/.github/workflows/trigger-push-stable.yml index fa44937..f7d5321 100644 --- a/.github/workflows/trigger-push-stable.yml +++ b/.github/workflows/trigger-push-stable.yml @@ -27,7 +27,8 @@ jobs: run: | commit_author=$(git log -1 --pretty=format:'%an') commit_message=$(git log -1 --pretty=format:'%s') - if [[ "$commit_author" == "opsmill-bot" && "$commit_message" == "chore: update pyproject.toml & galaxy.yml" ]]; then + if [[ "$commit_author" == "opsmill-bot" && \ + "$commit_message" == "chore: update pyproject.toml & galaxy.yml" ]]; then echo "skip=true" >> $GITHUB_OUTPUT else echo "skip=false" >> $GITHUB_OUTPUT @@ -72,8 +73,14 @@ jobs: - name: Update pyproject.toml and galaxy.yml versions run: | VERSION=${{ steps.version.outputs.next-version }} + python -c "\ + import toml; \ + with open('pyproject.toml', 'r') as file: \ + data = toml.load(file); \ + data['tool']['poetry']['version'] = '$VERSION'; \ + with open('pyproject.toml', 'w') as file: \ + toml.dump(data, file)" sed -i "s/^version:.*/version: $VERSION/" galaxy.yml - python -c "import tomlkit; doc = tomlkit.loads(open('pyproject.toml', 'r').read()); doc['tool']['poetry']['version'] = '$VERSION'; open('pyproject.toml', 'w').write(tomlkit.dumps(doc))" - name: Update lock file run: poetry lock --no-update From 895064a252bccab8a3ed4cd975fae30e4714ba20 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 24 Apr 2024 11:01:17 +0200 Subject: [PATCH 7/8] linter --- .github/labels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/labels.yml b/.github/labels.yml index 3ef88d3..c75c1fa 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -9,15 +9,15 @@ # CHANGES # ---------------------------------- - name: "changes/major" - description: "Breaking Changes" # Major changes that potentially break backward compatibility + description: "Breaking Changes" color: "bfd4f2" - name: "changes/minor" - description: "Feature Enhancements" # Minor feature enhancements that add new functionalities without breaking existing ones + description: "Feature Enhancements" color: "fef2c0" - name: "changes/patch" - description: "Maintenance tasks" # Patch updates for bug fixes, documentation updates, and other minor tasks + description: "Maintenance tasks" color: "0366d6" # ---------------------------------- From eddf6d2a7a6c1e553b4edd2bfdf3bb3261668f24 Mon Sep 17 00:00:00 2001 From: Benoit Kohler Date: Wed, 24 Apr 2024 11:02:37 +0200 Subject: [PATCH 8/8] update ruff in cicd as well --- .github/workflows/workflow-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow-linter.yml b/.github/workflows/workflow-linter.yml index a193dd5..691253d 100644 --- a/.github/workflows/workflow-linter.yml +++ b/.github/workflows/workflow-linter.yml @@ -62,7 +62,7 @@ jobs: - name: "Check out repository code" uses: "actions/checkout@v4" - name: "Setup environment" - run: "pip install ruff==0.1.5" + run: "pip install ruff==0.4.1" - name: "Linting: ruff check" run: "ruff check --diff ." - name: "Linting: ruff format"