From db37423510762ff8b74b75579081ebe7e8e5854d Mon Sep 17 00:00:00 2001 From: Yihuang Yu Date: Tue, 18 Jun 2024 14:59:54 +0800 Subject: [PATCH 1/2] rfc: Migrate most configs from setup.py to pyproject.toml Call `python setup.py` directly is deprecated, to modernize this project, let's introduce pyproject.toml, it supports more features. For compatibility with the past, keep setup.py in present. Signed-off-by: Yihuang Yu --- examples/plugins/cli-cmd/hello/pyproject.toml | 14 ++ examples/plugins/cli-cmd/hello/setup.py | 10 +- .../cli-cmd/hello_option/pyproject.toml | 14 ++ .../plugins/cli-cmd/hello_option/setup.py | 10 +- .../cli-cmd/hello_parser/pyproject.toml | 14 ++ .../plugins/cli-cmd/hello_parser/setup.py | 10 +- .../cli-cmd/hello_priority/pyproject.toml | 14 ++ .../plugins/cli-cmd/hello_priority/setup.py | 10 +- .../plugins/job-pre-post/mail/pyproject.toml | 17 ++ examples/plugins/job-pre-post/mail/setup.py | 17 +- .../plugins/job-pre-post/sleep/pyproject.toml | 17 ++ examples/plugins/job-pre-post/sleep/setup.py | 17 +- .../test-pre-post/hello/pyproject.toml | 17 ++ examples/plugins/test-pre-post/hello/setup.py | 11 +- examples/plugins/tests/magic/pyproject.toml | 29 ++++ examples/plugins/tests/magic/setup.py | 26 +-- examples/plugins/tests/rogue/pyproject.toml | 18 ++ examples/plugins/tests/rogue/setup.py | 23 +-- optional_plugins/ansible/pyproject.toml | 28 +++ optional_plugins/ansible/setup.py | 25 --- optional_plugins/golang/pyproject.toml | 28 +++ optional_plugins/golang/setup.py | 35 ---- optional_plugins/html/pyproject.toml | 28 +++ optional_plugins/html/setup.py | 29 +--- optional_plugins/result_upload/pyproject.toml | 28 +++ optional_plugins/result_upload/setup.py | 32 ---- optional_plugins/resultsdb/pyproject.toml | 31 ++++ optional_plugins/resultsdb/setup.py | 35 ---- optional_plugins/robot/pyproject.toml | 31 ++++ optional_plugins/robot/setup.py | 31 ---- .../spawner_remote/pyproject.toml | 28 +++ optional_plugins/spawner_remote/setup.py | 28 --- optional_plugins/varianter_cit/pyproject.toml | 28 +++ optional_plugins/varianter_cit/setup.py | 32 ---- .../varianter_pict/pyproject.toml | 27 +++ optional_plugins/varianter_pict/setup.py | 24 --- .../varianter_yaml_to_mux/pyproject.toml | 30 ++++ .../varianter_yaml_to_mux/setup.py | 27 --- pyproject.toml | 162 +++++++++++++++++ setup.py | 163 +----------------- 40 files changed, 616 insertions(+), 582 deletions(-) create mode 100644 examples/plugins/cli-cmd/hello/pyproject.toml create mode 100644 examples/plugins/cli-cmd/hello_option/pyproject.toml create mode 100644 examples/plugins/cli-cmd/hello_parser/pyproject.toml create mode 100644 examples/plugins/cli-cmd/hello_priority/pyproject.toml create mode 100644 examples/plugins/job-pre-post/mail/pyproject.toml create mode 100644 examples/plugins/job-pre-post/sleep/pyproject.toml create mode 100644 examples/plugins/test-pre-post/hello/pyproject.toml create mode 100644 examples/plugins/tests/magic/pyproject.toml create mode 100644 examples/plugins/tests/rogue/pyproject.toml create mode 100644 optional_plugins/ansible/pyproject.toml create mode 100644 optional_plugins/golang/pyproject.toml create mode 100644 optional_plugins/html/pyproject.toml create mode 100644 optional_plugins/result_upload/pyproject.toml create mode 100644 optional_plugins/resultsdb/pyproject.toml create mode 100644 optional_plugins/robot/pyproject.toml create mode 100644 optional_plugins/spawner_remote/pyproject.toml create mode 100644 optional_plugins/varianter_cit/pyproject.toml create mode 100644 optional_plugins/varianter_pict/pyproject.toml create mode 100644 optional_plugins/varianter_yaml_to_mux/pyproject.toml create mode 100644 pyproject.toml diff --git a/examples/plugins/cli-cmd/hello/pyproject.toml b/examples/plugins/cli-cmd/hello/pyproject.toml new file mode 100644 index 0000000000..5b6700bee1 --- /dev/null +++ b/examples/plugins/cli-cmd/hello/pyproject.toml @@ -0,0 +1,14 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-hello-world" +version = "1.0" +description = "Avocado Hello World CLI command" + +[project.entry-points."avocado.plugins.cli.cmd"] +hello = "hello:HelloWorld" + +[tool.setuptools] +py-modules = ["hello"] diff --git a/examples/plugins/cli-cmd/hello/setup.py b/examples/plugins/cli-cmd/hello/setup.py index 1c9b12d618..7f1a1763ca 100644 --- a/examples/plugins/cli-cmd/hello/setup.py +++ b/examples/plugins/cli-cmd/hello/setup.py @@ -1,12 +1,4 @@ from setuptools import setup if __name__ == "__main__": - setup( - name="avocado-hello-world", - version="1.0", - description="Avocado Hello World CLI command", - py_modules=["hello"], - entry_points={ - "avocado.plugins.cli.cmd": ["hello = hello:HelloWorld"], - }, - ) + setup() diff --git a/examples/plugins/cli-cmd/hello_option/pyproject.toml b/examples/plugins/cli-cmd/hello_option/pyproject.toml new file mode 100644 index 0000000000..8571d8892f --- /dev/null +++ b/examples/plugins/cli-cmd/hello_option/pyproject.toml @@ -0,0 +1,14 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-hello-world-option" +version = "1.0" +description = "Avocado Hello World CLI command with config option" + +[project.entry-points."avocado.plugins.cli.cmd"] +hello_option = "hello_option:HelloWorld" + +[tool.setuptools] +py-modules = ["hello_option"] diff --git a/examples/plugins/cli-cmd/hello_option/setup.py b/examples/plugins/cli-cmd/hello_option/setup.py index d3908ff314..7f1a1763ca 100644 --- a/examples/plugins/cli-cmd/hello_option/setup.py +++ b/examples/plugins/cli-cmd/hello_option/setup.py @@ -1,12 +1,4 @@ from setuptools import setup if __name__ == "__main__": - setup( - name="avocado-hello-world-option", - version="1.0", - description="Avocado Hello World CLI command with config option", - py_modules=["hello_option"], - entry_points={ - "avocado.plugins.cli.cmd": ["hello_option = hello_option:HelloWorld"], - }, - ) + setup() diff --git a/examples/plugins/cli-cmd/hello_parser/pyproject.toml b/examples/plugins/cli-cmd/hello_parser/pyproject.toml new file mode 100644 index 0000000000..12530cb92b --- /dev/null +++ b/examples/plugins/cli-cmd/hello_parser/pyproject.toml @@ -0,0 +1,14 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-hello-world-parser" +version = "1.0" +description = "Avocado Hello World CLI command with config parser" + +[project.entry-points."avocado.plugins.cli.cmd"] +hello_parser = "hello_parser:HelloWorld" + +[tool.setuptools] +py-modules = ["hello_parser"] diff --git a/examples/plugins/cli-cmd/hello_parser/setup.py b/examples/plugins/cli-cmd/hello_parser/setup.py index 0df46cc3e8..7f1a1763ca 100644 --- a/examples/plugins/cli-cmd/hello_parser/setup.py +++ b/examples/plugins/cli-cmd/hello_parser/setup.py @@ -1,12 +1,4 @@ from setuptools import setup if __name__ == "__main__": - setup( - name="avocado-hello-world-parser", - version="1.0", - description="Avocado Hello World CLI command with config parser", - py_modules=["hello_parser"], - entry_points={ - "avocado.plugins.cli.cmd": ["hello_parser = hello_parser:HelloWorld"], - }, - ) + setup() diff --git a/examples/plugins/cli-cmd/hello_priority/pyproject.toml b/examples/plugins/cli-cmd/hello_priority/pyproject.toml new file mode 100644 index 0000000000..e7109ef683 --- /dev/null +++ b/examples/plugins/cli-cmd/hello_priority/pyproject.toml @@ -0,0 +1,14 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-hello-world-priority" +version = "1.0" +description = "Avocado Hello World CLI command, with priority" + +[project.entry-points."avocado.plugins.cli.cmd"] +hello = "hello_priority:HelloWorld" + +[tool.setuptools] +py-modules = ["hello_priority"] diff --git a/examples/plugins/cli-cmd/hello_priority/setup.py b/examples/plugins/cli-cmd/hello_priority/setup.py index d5e845c27d..7f1a1763ca 100644 --- a/examples/plugins/cli-cmd/hello_priority/setup.py +++ b/examples/plugins/cli-cmd/hello_priority/setup.py @@ -1,12 +1,4 @@ from setuptools import setup if __name__ == "__main__": - setup( - name="avocado-hello-world-priority", - version="1.0", - description="Avocado Hello World CLI command, with priority", - py_modules=["hello_priority"], - entry_points={ - "avocado.plugins.cli.cmd": ["hello = hello_priority:HelloWorld"], - }, - ) + setup() diff --git a/examples/plugins/job-pre-post/mail/pyproject.toml b/examples/plugins/job-pre-post/mail/pyproject.toml new file mode 100644 index 0000000000..3480ae4b31 --- /dev/null +++ b/examples/plugins/job-pre-post/mail/pyproject.toml @@ -0,0 +1,17 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado_job_mail" +version = "1.0" +description = "Avocado Pre/Post Job Mail Notification" + +[project.entry-points."avocado.plugins.init"] +avocado_job_mail = "avocado_job_mail:MailInit" + +[project.entry-points."avocado.plugins.job.prepost"] +avocado_job_mail = "avocado_job_mail:Mail" + +[tool.setuptools] +py-modules = ["avocado_job_mail"] diff --git a/examples/plugins/job-pre-post/mail/setup.py b/examples/plugins/job-pre-post/mail/setup.py index 2c7de8d364..7f1a1763ca 100644 --- a/examples/plugins/job-pre-post/mail/setup.py +++ b/examples/plugins/job-pre-post/mail/setup.py @@ -1,19 +1,4 @@ from setuptools import setup -name = "avocado_job_mail" -init_klass = "MailInit" -klass = "Mail" -entry_point = f"{name} = {name}:{klass}" -init_entry_point = f"{name} = {name}:{init_klass}" - if __name__ == "__main__": - setup( - name=name, - version="1.0", - description="Avocado Pre/Post Job Mail Notification", - py_modules=[name], - entry_points={ - "avocado.plugins.init": [init_entry_point], - "avocado.plugins.job.prepost": [entry_point], - }, - ) + setup() diff --git a/examples/plugins/job-pre-post/sleep/pyproject.toml b/examples/plugins/job-pre-post/sleep/pyproject.toml new file mode 100644 index 0000000000..78495cf42c --- /dev/null +++ b/examples/plugins/job-pre-post/sleep/pyproject.toml @@ -0,0 +1,17 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado_job_sleep" +version = "1.0" +description = "Avocado Pre/Post Job Sleep" + +[project.entry-points."avocado.plugins.init"] +avocado_job_sleep = "avocado_job_sleep:SleepInit" + +[project.entry-points."avocado.plugins.job.prepost"] +avocado_job_sleep = "avocado_job_sleep:Sleep" + +[tool.setuptools] +py-modules = ["avocado_job_sleep"] diff --git a/examples/plugins/job-pre-post/sleep/setup.py b/examples/plugins/job-pre-post/sleep/setup.py index 6e0f637bf9..7f1a1763ca 100644 --- a/examples/plugins/job-pre-post/sleep/setup.py +++ b/examples/plugins/job-pre-post/sleep/setup.py @@ -1,19 +1,4 @@ from setuptools import setup -name = "avocado_job_sleep" -init_klass = "SleepInit" -klass = "Sleep" -entry_point = f"{name} = {name}:{klass}" -init_entry_point = f"{name} = {name}:{init_klass}" - if __name__ == "__main__": - setup( - name=name, - version="1.0", - description="Avocado Pre/Post Job Sleep", - py_modules=[name], - entry_points={ - "avocado.plugins.init": [init_entry_point], - "avocado.plugins.job.prepost": [entry_point], - }, - ) + setup() diff --git a/examples/plugins/test-pre-post/hello/pyproject.toml b/examples/plugins/test-pre-post/hello/pyproject.toml new file mode 100644 index 0000000000..5b17219c8c --- /dev/null +++ b/examples/plugins/test-pre-post/hello/pyproject.toml @@ -0,0 +1,17 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-hello-world-pre-post-test" +version = "1.0" +description = "Avocado Hello World pre and post test plugin" + +[project.entry-points."avocado.plugins.test.pre"] +hello_pre = "hello:HelloWorld" + +[project.entry-points."avocado.plugins.test.post"] +hello_post = "hello:HelloWorld" + +[tool.setuptools] +py-modules = ["hello"] diff --git a/examples/plugins/test-pre-post/hello/setup.py b/examples/plugins/test-pre-post/hello/setup.py index b49ec3ab05..7f1a1763ca 100644 --- a/examples/plugins/test-pre-post/hello/setup.py +++ b/examples/plugins/test-pre-post/hello/setup.py @@ -1,13 +1,4 @@ from setuptools import setup if __name__ == "__main__": - setup( - name="avocado-hello-world-pre-post-test", - version="1.0", - description="Avocado Hello World pre and post test plugin", - py_modules=["hello"], - entry_points={ - "avocado.plugins.test.pre": ["hello_pre = hello:HelloWorld"], - "avocado.plugins.test.post": ["hello_post = hello:HelloWorld"], - }, - ) + setup() diff --git a/examples/plugins/tests/magic/pyproject.toml b/examples/plugins/tests/magic/pyproject.toml new file mode 100644 index 0000000000..142d956b8e --- /dev/null +++ b/examples/plugins/tests/magic/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "magic" +version = "1.0" +description = 'Avocado "magic" test type' + +[project.scripts] +avocado-runner-magic = "avocado_magic.runner:main" + +[project.entry-points."avocado.plugins.init"] +magic = "avocado_magic.resolver:MagicInit" + +[project.entry-points."avocado.plugins.resolver"] +magic = "avocado_magic.resolver:MagicResolver" + +[project.entry-points."avocado.plugins.discoverer"] +magic = "avocado_magic.resolver:MagicDiscoverer" + +[project.entry-points."avocado.plugins.runnable.runner"] +magic = "avocado_magic.runner:MagicRunner" + +[tool.setuptools] +py-modules = ["avocado_magic"] + +[tool.setuptools.packages] +find = {} diff --git a/examples/plugins/tests/magic/setup.py b/examples/plugins/tests/magic/setup.py index 05e9943b49..7f1a1763ca 100644 --- a/examples/plugins/tests/magic/setup.py +++ b/examples/plugins/tests/magic/setup.py @@ -1,26 +1,4 @@ -from setuptools import find_packages, setup - -name = "magic" -module = "avocado_magic" -init_ep = f"{name} = {module}.resolver:MagicInit" -resolver_ep = f"{name} = {module}.resolver:MagicResolver" -discoverer_ep = f"{name} = {module}.resolver:MagicDiscoverer" -runner_ep = f"{name} = {module}.runner:MagicRunner" -runner_script = f"avocado-runner-{name} = {module}.runner:main" - +from setuptools import setup if __name__ == "__main__": - setup( - name=name, - version="1.0", - description='Avocado "magic" test type', - py_modules=[module], - entry_points={ - "avocado.plugins.init": [init_ep], - "avocado.plugins.resolver": [resolver_ep], - "avocado.plugins.discoverer": [discoverer_ep], - "avocado.plugins.runnable.runner": [runner_ep], - "console_scripts": [runner_script], - }, - packages=find_packages(), - ) + setup() diff --git a/examples/plugins/tests/rogue/pyproject.toml b/examples/plugins/tests/rogue/pyproject.toml new file mode 100644 index 0000000000..86f898b021 --- /dev/null +++ b/examples/plugins/tests/rogue/pyproject.toml @@ -0,0 +1,18 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-rogue" +version = "1.0" +description = 'Avocado "rogue" test type' +readme = {text = "This is a plugin that contains a rogue runner, that is, a runner that will try to never allow to be terminated.", content-type = "text/x-rst"} + +[project.scripts] +avocado-runner-rogue = "avocado_rogue.runner:main" + +[project.entry-points."avocado.plugins.resolver"] +rogue = "avocado_rogue.resolver:RogueResolver" + +[project.entry-points."avocado.plugins.runnable.runner"] +rogue = "avocado_rogue.runner:RogueRunner" diff --git a/examples/plugins/tests/rogue/setup.py b/examples/plugins/tests/rogue/setup.py index 11368c7593..7f1a1763ca 100644 --- a/examples/plugins/tests/rogue/setup.py +++ b/examples/plugins/tests/rogue/setup.py @@ -1,25 +1,4 @@ from setuptools import setup -name = "rogue" -module = "avocado_rogue" -resolver_ep = f"{name} = {module}.resolver:RogueResolver" -runner_ep = f"{name} = {module}.runner:RogueRunner" -runner_script = f"avocado-runner-{name} = {module}.runner:main" - - if __name__ == "__main__": - setup( - name="avocado-rogue", - version="1.0", - description='Avocado "rogue" test type', - long_description=( - "This is a plugin that contains a rogue runner, that is, " - "a runner that will try to never allow to be terminated." - ), - py_modules=[module], - entry_points={ - "avocado.plugins.resolver": [resolver_ep], - "avocado.plugins.runnable.runner": [runner_ep], - "console_scripts": [runner_script], - }, - ) + setup() diff --git a/optional_plugins/ansible/pyproject.toml b/optional_plugins/ansible/pyproject.toml new file mode 100644 index 0000000000..eb05564ef8 --- /dev/null +++ b/optional_plugins/ansible/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-ansible" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Adds to Avocado the ability to use ansible modules as dependencies for tests" +readme = {text = "Adds to Avocado the ability to use ansible modules as dependencies for tests", content-type = "text/x-rst"} + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" + +[project.scripts] +avocado-runner-ansible-module = "avocado_ansible.module:main" + +[project.entry-points."avocado.plugins.runnable.runner"] +ansible-module = "avocado_ansible.module:AnsibleModuleRunner" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_ansible"] diff --git a/optional_plugins/ansible/setup.py b/optional_plugins/ansible/setup.py index e41d2ca55f..23ddb9ece8 100644 --- a/optional_plugins/ansible/setup.py +++ b/optional_plugins/ansible/setup.py @@ -16,26 +16,9 @@ from setuptools import setup # Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_ansible"] -else: - packages = find_namespace_packages(include=["avocado_ansible"]) - VERSION = open("VERSION", "r", encoding="utf-8").read().strip() setup( - name="avocado-framework-plugin-ansible", - description="Adds to Avocado the ability to use ansible modules as dependencies for tests", - long_description="Adds to Avocado the ability to use ansible modules as dependencies for tests", - long_description_content_type="text/x-rst", - version=VERSION, - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[ f"avocado-framework=={VERSION}", "cffi", @@ -43,12 +26,4 @@ "ansible-core", ], test_suite="tests", - entry_points={ - "console_scripts": [ - "avocado-runner-ansible-module = avocado_ansible.module:main", - ], - "avocado.plugins.runnable.runner": [ - "ansible-module = avocado_ansible.module:AnsibleModuleRunner" - ], - }, ) diff --git a/optional_plugins/golang/pyproject.toml b/optional_plugins/golang/pyproject.toml new file mode 100644 index 0000000000..503766c9f3 --- /dev/null +++ b/optional_plugins/golang/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-golang" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Avocado Plugin for Execution of Golang tests" +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.scripts] +avocado-runner-golang = "avocado_golang.runner:main" + +[project.entry-points."avocado.plugins.resolver"] +golang = "avocado_golang.golang:GolangResolver" + +[project.entry-points."avocado.plugins.runnable.runner"] +golang = "avocado_golang.runner:GolangRunner" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_golang"] diff --git a/optional_plugins/golang/setup.py b/optional_plugins/golang/setup.py index 9cf02a13ed..9a2f11143d 100644 --- a/optional_plugins/golang/setup.py +++ b/optional_plugins/golang/setup.py @@ -17,47 +17,12 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_golang"] -else: - packages = find_namespace_packages(include=["avocado_golang"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - setup( - name="avocado-framework-plugin-golang", - version=VERSION, - description="Avocado Plugin for Execution of Golang tests", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}"], test_suite="tests", - entry_points={ - "console_scripts": [ - "avocado-runner-golang = avocado_golang.runner:main", - ], - "avocado.plugins.resolver": [ - "golang = avocado_golang.golang:GolangResolver", - ], - "avocado.plugins.runnable.runner": [ - "golang = avocado_golang.runner:GolangRunner" - ], - }, ) diff --git a/optional_plugins/html/pyproject.toml b/optional_plugins/html/pyproject.toml new file mode 100644 index 0000000000..e0c57d6c29 --- /dev/null +++ b/optional_plugins/html/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-result-html" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Avocado HTML Report for Jobs" +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.entry-points."avocado.plugins.cli"] +html = "avocado_result_html:HTML" + +[project.entry-points."avocado.plugins.init"] +html = "avocado_result_html:HTMLInit" + +[project.entry-points."avocado.plugins.result"] +html = "avocado_result_html:HTMLResult" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_result_html"] diff --git a/optional_plugins/html/setup.py b/optional_plugins/html/setup.py index ee9933d241..960ff54477 100644 --- a/optional_plugins/html/setup.py +++ b/optional_plugins/html/setup.py @@ -15,40 +15,13 @@ import os -from setuptools import find_packages, setup +from setuptools import setup BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - setup( - name="avocado-framework-plugin-result-html", - version=VERSION, - description="Avocado HTML Report for Jobs", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=find_packages(), - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}", "jinja2"], - entry_points={ - "avocado.plugins.cli": [ - "html = avocado_result_html:HTML", - ], - "avocado.plugins.init": [ - "html = avocado_result_html:HTMLInit", - ], - "avocado.plugins.result": [ - "html = avocado_result_html:HTMLResult", - ], - }, ) diff --git a/optional_plugins/result_upload/pyproject.toml b/optional_plugins/result_upload/pyproject.toml new file mode 100644 index 0000000000..8c045581b0 --- /dev/null +++ b/optional_plugins/result_upload/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-result-upload" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Avocado Plugin to propagate Job results to remote host" +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.urls] +Homepage = "http://github.com/avocado-framework/avocado" + +[project.entry-points."avocado.plugins.cli"] +results_upload = "avocado_result_upload.result_upload:ResultUploadCLI" + +[project.entry-points."avocado.plugins.result"] +results_upload = "avocado_result_upload.result_upload:ResultUpload" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_result_upload"] diff --git a/optional_plugins/result_upload/setup.py b/optional_plugins/result_upload/setup.py index 272b333ce8..964476c3e3 100644 --- a/optional_plugins/result_upload/setup.py +++ b/optional_plugins/result_upload/setup.py @@ -17,43 +17,11 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_result_upload"] -else: - packages = find_namespace_packages(include=["avocado_result_upload"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - setup( - name="avocado-framework-plugin-result-upload", - version=VERSION, - description="Avocado Plugin to propagate Job results to remote host", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}"], - entry_points={ - "avocado.plugins.cli": [ - "results_upload = avocado_result_upload.result_upload:ResultUploadCLI", - ], - "avocado.plugins.result": [ - "results_upload = avocado_result_upload.result_upload:ResultUpload", - ], - }, ) diff --git a/optional_plugins/resultsdb/pyproject.toml b/optional_plugins/resultsdb/pyproject.toml new file mode 100644 index 0000000000..462733a89b --- /dev/null +++ b/optional_plugins/resultsdb/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-resultsdb" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Avocado Plugin to propagate Job results to Resultsdb" +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" + +[project.entry-points."avocado.plugins.cli"] +resultsdb = "avocado_resultsdb.resultsdb:ResultsdbCLI" + +[project.entry-points."avocado.plugins.result_events"] +resultsdb = "avocado_resultsdb.resultsdb:ResultsdbResultEvent" + +[project.entry-points."avocado.plugins.result"] +resultsdb = "avocado_resultsdb.resultsdb:ResultsdbResult" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_resultsdb"] diff --git a/optional_plugins/resultsdb/setup.py b/optional_plugins/resultsdb/setup.py index 83c3e28b13..0051c7da3a 100644 --- a/optional_plugins/resultsdb/setup.py +++ b/optional_plugins/resultsdb/setup.py @@ -17,46 +17,11 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_resultsdb"] -else: - packages = find_namespace_packages(include=["avocado_resultsdb"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - setup( - name="avocado-framework-plugin-resultsdb", - version=VERSION, - description="Avocado Plugin to propagate Job results to Resultsdb", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}", "resultsdb-api==2.1.5"], - entry_points={ - "avocado.plugins.cli": [ - "resultsdb = avocado_resultsdb.resultsdb:ResultsdbCLI", - ], - "avocado.plugins.result_events": [ - "resultsdb = avocado_resultsdb.resultsdb:ResultsdbResultEvent", - ], - "avocado.plugins.result": [ - "resultsdb = avocado_resultsdb.resultsdb:ResultsdbResult", - ], - }, ) diff --git a/optional_plugins/robot/pyproject.toml b/optional_plugins/robot/pyproject.toml new file mode 100644 index 0000000000..1d014399c3 --- /dev/null +++ b/optional_plugins/robot/pyproject.toml @@ -0,0 +1,31 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-robot" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Avocado Plugin for Execution of Robot Framework tests" +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" + +[project.scripts] +avocado-runner-robot = "avocado_robot.runner:main" + +[project.entry-points."avocado.plugins.runnable.runner"] +robot = "avocado_robot.runner:RobotRunner" + +[project.entry-points."avocado.plugins.resolver"] +robot = "avocado_robot.robot:RobotResolver" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_robot"] diff --git a/optional_plugins/robot/setup.py b/optional_plugins/robot/setup.py index 0b8dd20baa..91eaa8e9c2 100644 --- a/optional_plugins/robot/setup.py +++ b/optional_plugins/robot/setup.py @@ -17,47 +17,16 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_robot"] -else: - packages = find_namespace_packages(include=["avocado_robot"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - setup( - name="avocado-framework-plugin-robot", - version=VERSION, - description="Avocado Plugin for Execution of Robot Framework tests", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[ f"avocado-framework=={VERSION}", "robotframework>=4.1, <=6.1.1; python_version < '3.8'", "robotframework>=4.1, <7.0; python_version >= '3.8'", ], test_suite="tests", - entry_points={ - "console_scripts": [ - "avocado-runner-robot = avocado_robot.runner:main", - ], - "avocado.plugins.runnable.runner": ["robot = avocado_robot.runner:RobotRunner"], - "avocado.plugins.resolver": ["robot = avocado_robot.robot:RobotResolver"], - }, ) diff --git a/optional_plugins/spawner_remote/pyproject.toml b/optional_plugins/spawner_remote/pyproject.toml new file mode 100644 index 0000000000..64d115af45 --- /dev/null +++ b/optional_plugins/spawner_remote/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-spawner-remote" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Remote (host) based spawner" +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" + +[project.entry-points."avocado.plugins.init"] +remote = "avocado_spawner_remote:RemoteSpawnerInit" + +[project.entry-points."avocado.plugins.spawner"] +remote = "avocado_spawner_remote:RemoteSpawner" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_spawner_remote"] diff --git a/optional_plugins/spawner_remote/setup.py b/optional_plugins/spawner_remote/setup.py index 05484b1811..9e525546c9 100644 --- a/optional_plugins/spawner_remote/setup.py +++ b/optional_plugins/spawner_remote/setup.py @@ -17,40 +17,12 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_spawner_remote"] -else: - packages = find_namespace_packages(include=["avocado_spawner_remote"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - setup( - name="avocado-framework-plugin-spawner-remote", - version=VERSION, - description="Remote (host) based spawner", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}", "aexpect>=1.6.2"], test_suite="tests", - entry_points={ - "avocado.plugins.init": ["remote = avocado_spawner_remote:RemoteSpawnerInit"], - "avocado.plugins.spawner": ["remote = avocado_spawner_remote:RemoteSpawner"], - }, ) diff --git a/optional_plugins/varianter_cit/pyproject.toml b/optional_plugins/varianter_cit/pyproject.toml new file mode 100644 index 0000000000..23bdfb6d4b --- /dev/null +++ b/optional_plugins/varianter_cit/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-varianter-cit" +dynamic = ["dependencies", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Varianter with combinatorial capabilities" +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" + +[project.entry-points."avocado.plugins.cli"] +varianter_cit = "avocado_varianter_cit.varianter_cit:VarianterCitCLI" + +[project.entry-points."avocado.plugins.varianter"] +varianter_cit = "avocado_varianter_cit.varianter_cit:VarianterCit" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_varianter_cit"] diff --git a/optional_plugins/varianter_cit/setup.py b/optional_plugins/varianter_cit/setup.py index 3b2b9d8360..b274764f6e 100644 --- a/optional_plugins/varianter_cit/setup.py +++ b/optional_plugins/varianter_cit/setup.py @@ -17,44 +17,12 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_varianter_cit"] -else: - packages = find_namespace_packages(include=["avocado_varianter_cit"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - setup( - name="avocado-framework-plugin-varianter-cit", - version=open("VERSION", "r", encoding="utf-8").read().strip(), - description="Varianter with combinatorial capabilities", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}"], test_suite="tests", - entry_points={ - "avocado.plugins.cli": [ - "varianter_cit = avocado_varianter_cit.varianter_cit:VarianterCitCLI", - ], - "avocado.plugins.varianter": [ - "varianter_cit = avocado_varianter_cit.varianter_cit:VarianterCit", - ], - }, ) diff --git a/optional_plugins/varianter_pict/pyproject.toml b/optional_plugins/varianter_pict/pyproject.toml new file mode 100644 index 0000000000..6a589eeb64 --- /dev/null +++ b/optional_plugins/varianter_pict/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-varianter-pict" +dynamic = ["dependencies", "readme", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Varianter with combinatorial capabilities by PICT" + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" + +[project.entry-points."avocado.plugins.cli"] +varianter_pict = "avocado_varianter_pict.varianter_pict:VarianterPictCLI" + +[project.entry-points."avocado.plugins.varianter"] +varianter_pict = "avocado_varianter_pict.varianter_pict:VarianterPict" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_varianter_pict"] diff --git a/optional_plugins/varianter_pict/setup.py b/optional_plugins/varianter_pict/setup.py index dc0f6c7bda..42b9064a79 100644 --- a/optional_plugins/varianter_pict/setup.py +++ b/optional_plugins/varianter_pict/setup.py @@ -18,14 +18,6 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_varianter_pict"] -else: - packages = find_namespace_packages(include=["avocado_varianter_pict"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() @@ -38,23 +30,7 @@ def get_long_description(): setup( - name="avocado-framework-plugin-varianter-pict", - version=VERSION, - description="Varianter with combinatorial capabilities by PICT", long_description=get_long_description(), long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}"], - entry_points={ - "avocado.plugins.cli": [ - "varianter_pict = avocado_varianter_pict.varianter_pict:VarianterPictCLI", - ], - "avocado.plugins.varianter": [ - "varianter_pict = avocado_varianter_pict.varianter_pict:VarianterPict", - ], - }, ) diff --git a/optional_plugins/varianter_yaml_to_mux/pyproject.toml b/optional_plugins/varianter_yaml_to_mux/pyproject.toml new file mode 100644 index 0000000000..1d767f036f --- /dev/null +++ b/optional_plugins/varianter_yaml_to_mux/pyproject.toml @@ -0,0 +1,30 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework-plugin-varianter-yaml-to-mux" +dynamic = ["dependencies", "readme", "version"] +authors = [{name = "Avocado Developers", email = "avocado-devel@redhat.com"}] +description = "Avocado Varianter plugin to parse YAML file into variants" + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" + +[project.entry-points."avocado.plugins.init"] +yaml_to_mux = "avocado_varianter_yaml_to_mux.varianter_yaml_to_mux:YamlToMuxInit" + +[project.entry-points."avocado.plugins.cli"] +yaml_to_mux = "avocado_varianter_yaml_to_mux.varianter_yaml_to_mux:YamlToMuxCLI" + +[project.entry-points."avocado.plugins.varianter"] +yaml_to_mux = "avocado_varianter_yaml_to_mux.varianter_yaml_to_mux:YamlToMux" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +include = ["avocado_varianter_yaml_to_mux"] diff --git a/optional_plugins/varianter_yaml_to_mux/setup.py b/optional_plugins/varianter_yaml_to_mux/setup.py index 4c5b741a29..7b16c04242 100644 --- a/optional_plugins/varianter_yaml_to_mux/setup.py +++ b/optional_plugins/varianter_yaml_to_mux/setup.py @@ -18,14 +18,6 @@ from setuptools import setup -# Handle systems with setuptools < 40 -try: - from setuptools import find_namespace_packages -except ImportError: - packages = ["avocado_varianter_yaml_to_mux"] -else: - packages = find_namespace_packages(include=["avocado_varianter_yaml_to_mux"]) - BASE_PATH = os.path.dirname(__file__) with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file: VERSION = version_file.read().strip() @@ -38,28 +30,9 @@ def get_long_description(): setup( - name="avocado-framework-plugin-varianter-yaml-to-mux", - version=VERSION, - description="Avocado Varianter plugin to parse YAML file into variants", long_description=get_long_description(), long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="http://avocado-framework.github.io/", - packages=packages, - include_package_data=True, install_requires=[f"avocado-framework=={VERSION}", "PyYAML>=4.2b2"], zip_safe=False, test_suite="tests", - entry_points={ - "avocado.plugins.init": [ - "yaml_to_mux = avocado_varianter_yaml_to_mux.varianter_yaml_to_mux:YamlToMuxInit", - ], - "avocado.plugins.cli": [ - "yaml_to_mux = avocado_varianter_yaml_to_mux.varianter_yaml_to_mux:YamlToMuxCLI", - ], - "avocado.plugins.varianter": [ - "yaml_to_mux = avocado_varianter_yaml_to_mux.varianter_yaml_to_mux:YamlToMux" - ], - }, ) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..c84a2a3031 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,162 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "avocado-framework" +dynamic = ["version"] +authors = [ + {name = "Avocado Developers", email = "avocado-devel@redhat.com"} +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Natural Language :: English", "Operating System :: POSIX", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12"] +description = "Avocado Test Framework" +requires-python = ">=3.8" +dependencies = ["setuptools"] +license = {text = "GPLv2+"} +readme = {file = "README.rst", content-type = "text/x-rst"} + +[project.urls] +Homepage = "https://avocado-vt.readthedocs.io" +Repository = "http://github.com/avocado-framework/avocado.git" +Issues = "https://github.com/avocado-framework/avocado/issues" + +[project.scripts] +avocado = "avocado.core.main:main" +avocado-runner-noop = "avocado.plugins.runners.noop:main" +avocado-runner-dry-run = "avocado.plugins.runners.dry_run:main" +avocado-runner-exec-test = "avocado.plugins.runners.exec_test:main" +avocado-runner-python-unittest = "avocado.plugins.runners.python_unittest:main" +avocado-runner-avocado-instrumented = "avocado.plugins.runners.avocado_instrumented:main" +avocado-runner-tap = "avocado.plugins.runners.tap:main" +avocado-runner-asset = "avocado.plugins.runners.asset:main" +avocado-runner-package = "avocado.plugins.runners.package:main" +avocado-runner-podman-image = "avocado.plugins.runners.podman_image:main" +avocado-runner-sysinfo = "avocado.plugins.runners.sysinfo:main" +avocado-software-manager = "avocado.utils.software_manager.main:main" +avocado-external-runner = "scripts.external_runner:main" + +[project.entry-points."avocado.plugins.init"] +xunit = "avocado.plugins.xunit:XUnitInit" +jsonresult = "avocado.plugins.jsonresult:JSONInit" +sysinfo = "avocado.plugins.sysinfo:SysinfoInit" +tap = "avocado.plugins.tap:TAPInit" +jobscripts = "avocado.plugins.jobscripts:JobScriptsInit" +dict_variants = "avocado.plugins.dict_variants:DictVariantsInit" +json_variants = "avocado.plugins.json_variants:JsonVariantsInit" +run = "avocado.plugins.run:RunInit" +podman = "avocado.plugins.spawners.podman:PodmanSpawnerInit" +lxc = "avocado.plugins.spawners.lxc:LXCSpawnerInit" +nrunner = "avocado.plugins.runner_nrunner:RunnerInit" +testlogsui = "avocado.plugins.testlogs:TestLogsUIInit" +human = "avocado.plugins.human:HumanInit" + +[project.entry-points."avocado.plugins.cli"] +xunit = "avocado.plugins.xunit:XUnitCLI" +json = "avocado.plugins.jsonresult:JSONCLI" +journal = "avocado.plugins.journal:Journal" +tap = "avocado.plugins.tap:TAP" +zip_archive = "avocado.plugins.archive:ArchiveCLI" +json_variants = "avocado.plugins.json_variants:JsonVariantsCLI" +nrunner = "avocado.plugins.runner_nrunner:RunnerCLI" +podman = "avocado.plugins.spawners.podman:PodmanCLI" + +[project.entry-points."avocado.plugins.cli.cmd"] +config = "avocado.plugins.config:Config" +distro = "avocado.plugins.distro:Distro" +exec-path = "avocado.plugins.exec_path:ExecPath" +variants = "avocado.plugins.variants:Variants" +list = "avocado.plugins.list:List" +run = "avocado.plugins.run:Run" +sysinfo = "avocado.plugins.sysinfo:SysInfo" +plugins = "avocado.plugins.plugins:Plugins" +diff = "avocado.plugins.diff:Diff" +vmimage = "avocado.plugins.vmimage:VMimage" +assets = "avocado.plugins.assets:Assets" +jobs = "avocado.plugins.jobs:Jobs" +replay = "avocado.plugins.replay:Replay" +cache = "avocado.plugins.cache:Cache" + +[project.entry-points."avocado.plugins.job.prepost"] +jobscripts = "avocado.plugins.jobscripts:JobScripts" +teststmpdir = "avocado.plugins.teststmpdir:TestsTmpDir" +human = "avocado.plugins.human:HumanJob" +testlogsui = "avocado.plugins.testlogs:TestLogsUI" +suite-dependency = "avocado.plugins.dependency:SuiteDependency" + +[project.entry-points."avocado.plugins.test.pre"] +dependency = "avocado.plugins.dependency:DependencyResolver" +sysinfo = "avocado.plugins.sysinfo:SysInfoTest" + +[project.entry-points."avocado.plugins.test.post"] +sysinfo = "avocado.plugins.sysinfo:SysInfoTest" + +[project.entry-points."avocado.plugins.result"] +xunit = "avocado.plugins.xunit:XUnitResult" +json = "avocado.plugins.jsonresult:JSONResult" +zip_archive = "avocado.plugins.archive:Archive" + +[project.entry-points."avocado.plugins.result_events"] +human = "avocado.plugins.human:Human" +tap = "avocado.plugins.tap:TAPResult" +journal = "avocado.plugins.journal:JournalResult" +fetchasset = "avocado.plugins.assets:FetchAssetJob" +sysinfo = "avocado.plugins.sysinfo:SysInfoJob" +testlogging = "avocado.plugins.testlogs:TestLogging" +bystatus = "avocado.plugins.bystatus:ByStatusLink" +beaker = "avocado.plugins.beaker_result:BeakerResult" + +[project.entry-points."avocado.plugins.varianter"] +json_variants = "avocado.plugins.json_variants:JsonVariants" +dict_variants = "avocado.plugins.dict_variants:DictVariants" + +[project.entry-points."avocado.plugins.resolver"] +exec-test = "avocado.plugins.resolvers:ExecTestResolver" +python-unittest = "avocado.plugins.resolvers:PythonUnittestResolver" +avocado-instrumented = "avocado.plugins.resolvers:AvocadoInstrumentedResolver" +tap = "avocado.plugins.resolvers:TapResolver" +runnable-recipe = "avocado.plugins.resolvers:RunnableRecipeResolver" +runnables-recipe = "avocado.plugins.resolvers:RunnablesRecipeResolver" + +[project.entry-points."avocado.plugins.suite.runner"] +nrunner = "avocado.plugins.runner_nrunner:Runner" + +[project.entry-points."avocado.plugins.runnable.runner"] +avocado-instrumented = "avocado.plugins.runners.avocado_instrumented:AvocadoInstrumentedTestRunner" +tap = "avocado.plugins.runners.tap:TAPRunner" +noop = "avocado.plugins.runners.noop:NoOpRunner" +dry-run = "avocado.plugins.runners.dry_run:DryRunRunner" +exec-test = "avocado.plugins.runners.exec_test:ExecTestRunner" +python-unittest = "avocado.plugins.runners.python_unittest:PythonUnittestRunner" +asset = "avocado.plugins.runners.asset:AssetRunner" +package = "avocado.plugins.runners.package:PackageRunner" +podman-image = "avocado.plugins.runners.podman_image:PodmanImageRunner" +sysinfo = "avocado.plugins.runners.sysinfo:SysinfoRunner" + +[project.entry-points."avocado.plugins.spawner"] +process = "avocado.plugins.spawners.process:ProcessSpawner" +podman = "avocado.plugins.spawners.podman:PodmanSpawner" +lxc = "avocado.plugins.spawners.lxc:LXCSpawner" + +[project.entry-points."avocado.plugins.cache"] +requirement = "avocado.plugins.requirement_cache:RequirementCache" + +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = {file = "VERSION"} + +[tool.setuptools.packages.find] +exclude = ["selftests*"] diff --git a/setup.py b/setup.py index b9f608bbbd..fc1fb14339 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ from subprocess import CalledProcessError, run import setuptools.command.develop -from setuptools import Command, find_packages, setup +from setuptools import Command, setup # pylint: disable=E0611 @@ -35,12 +35,6 @@ EXAMPLES_PLUGINS_TESTS_PATH = os.path.join(BASE_PATH, "examples", "plugins", "tests") -def get_long_description(): - with open(os.path.join(BASE_PATH, "README.rst"), "rt", encoding="utf-8") as readme: - readme_contents = readme.read() - return readme_contents - - def walk_plugins_setup_py(action, action_name=None, directory=OPTIONAL_PLUGINS_PATH): if action_name is None: @@ -331,160 +325,8 @@ def run(self): if os.environ.get("READTHEDOCS") and "install" in sys.argv: run(["/usr/bin/make", "develop"], check=True) setup( - name="avocado-framework", - version=VERSION, - description="Avocado Test Framework", - long_description=get_long_description(), - long_description_content_type="text/x-rst", - author="Avocado Developers", - author_email="avocado-devel@redhat.com", - url="https://avocado-framework.github.io/", - license="GPLv2+", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", - "Natural Language :: English", - "Operating System :: POSIX", - "Topic :: Software Development :: Quality Assurance", - "Topic :: Software Development :: Testing", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - ], - packages=find_packages(exclude=("selftests*",)), - include_package_data=True, - entry_points={ - "console_scripts": [ - "avocado = avocado.core.main:main", - "avocado-runner-noop = avocado.plugins.runners.noop:main", - "avocado-runner-dry-run = avocado.plugins.runners.dry_run:main", - "avocado-runner-exec-test = avocado.plugins.runners.exec_test:main", - "avocado-runner-python-unittest = avocado.plugins.runners.python_unittest:main", - "avocado-runner-avocado-instrumented = avocado.plugins.runners.avocado_instrumented:main", - "avocado-runner-tap = avocado.plugins.runners.tap:main", - "avocado-runner-asset = avocado.plugins.runners.asset:main", - "avocado-runner-package = avocado.plugins.runners.package:main", - "avocado-runner-podman-image = avocado.plugins.runners.podman_image:main", - "avocado-runner-sysinfo = avocado.plugins.runners.sysinfo:main", - "avocado-software-manager = avocado.utils.software_manager.main:main", - "avocado-external-runner = scripts.external_runner:main", - ], - "avocado.plugins.init": [ - "xunit = avocado.plugins.xunit:XUnitInit", - "jsonresult = avocado.plugins.jsonresult:JSONInit", - "sysinfo = avocado.plugins.sysinfo:SysinfoInit", - "tap = avocado.plugins.tap:TAPInit", - "jobscripts = avocado.plugins.jobscripts:JobScriptsInit", - "dict_variants = avocado.plugins.dict_variants:DictVariantsInit", - "json_variants = avocado.plugins.json_variants:JsonVariantsInit", - "run = avocado.plugins.run:RunInit", - "podman = avocado.plugins.spawners.podman:PodmanSpawnerInit", - "lxc = avocado.plugins.spawners.lxc:LXCSpawnerInit", - "nrunner = avocado.plugins.runner_nrunner:RunnerInit", - "testlogsui = avocado.plugins.testlogs:TestLogsUIInit", - "human = avocado.plugins.human:HumanInit", - ], - "avocado.plugins.cli": [ - "xunit = avocado.plugins.xunit:XUnitCLI", - "json = avocado.plugins.jsonresult:JSONCLI", - "journal = avocado.plugins.journal:Journal", - "tap = avocado.plugins.tap:TAP", - "zip_archive = avocado.plugins.archive:ArchiveCLI", - "json_variants = avocado.plugins.json_variants:JsonVariantsCLI", - "nrunner = avocado.plugins.runner_nrunner:RunnerCLI", - "podman = avocado.plugins.spawners.podman:PodmanCLI", - ], - "avocado.plugins.cli.cmd": [ - "config = avocado.plugins.config:Config", - "distro = avocado.plugins.distro:Distro", - "exec-path = avocado.plugins.exec_path:ExecPath", - "variants = avocado.plugins.variants:Variants", - "list = avocado.plugins.list:List", - "run = avocado.plugins.run:Run", - "sysinfo = avocado.plugins.sysinfo:SysInfo", - "plugins = avocado.plugins.plugins:Plugins", - "diff = avocado.plugins.diff:Diff", - "vmimage = avocado.plugins.vmimage:VMimage", - "assets = avocado.plugins.assets:Assets", - "jobs = avocado.plugins.jobs:Jobs", - "replay = avocado.plugins.replay:Replay", - "cache = avocado.plugins.cache:Cache", - ], - "avocado.plugins.job.prepost": [ - "jobscripts = avocado.plugins.jobscripts:JobScripts", - "teststmpdir = avocado.plugins.teststmpdir:TestsTmpDir", - "human = avocado.plugins.human:HumanJob", - "testlogsui = avocado.plugins.testlogs:TestLogsUI", - "suite-dependency = avocado.plugins.dependency:SuiteDependency", - ], - "avocado.plugins.test.pre": [ - "dependency = avocado.plugins.dependency:DependencyResolver", - "sysinfo = avocado.plugins.sysinfo:SysInfoTest", - ], - "avocado.plugins.test.post": [ - "sysinfo = avocado.plugins.sysinfo:SysInfoTest", - ], - "avocado.plugins.result": [ - "xunit = avocado.plugins.xunit:XUnitResult", - "json = avocado.plugins.jsonresult:JSONResult", - "zip_archive = avocado.plugins.archive:Archive", - ], - "avocado.plugins.result_events": [ - "human = avocado.plugins.human:Human", - "tap = avocado.plugins.tap:TAPResult", - "journal = avocado.plugins.journal:JournalResult", - "fetchasset = avocado.plugins.assets:FetchAssetJob", - "sysinfo = avocado.plugins.sysinfo:SysInfoJob", - "testlogging = avocado.plugins.testlogs:TestLogging", - "bystatus = avocado.plugins.bystatus:ByStatusLink", - "beaker = avocado.plugins.beaker_result:BeakerResult", - ], - "avocado.plugins.varianter": [ - "json_variants = avocado.plugins.json_variants:JsonVariants", - "dict_variants = avocado.plugins.dict_variants:DictVariants", - ], - "avocado.plugins.resolver": [ - "exec-test = avocado.plugins.resolvers:ExecTestResolver", - "python-unittest = avocado.plugins.resolvers:PythonUnittestResolver", - "avocado-instrumented = avocado.plugins.resolvers:AvocadoInstrumentedResolver", - "tap = avocado.plugins.resolvers:TapResolver", - "runnable-recipe = avocado.plugins.resolvers:RunnableRecipeResolver", - "runnables-recipe = avocado.plugins.resolvers:RunnablesRecipeResolver", - ], - "avocado.plugins.suite.runner": [ - "nrunner = avocado.plugins.runner_nrunner:Runner", - ], - "avocado.plugins.runnable.runner": [ - ( - "avocado-instrumented = avocado.plugins." - "runners.avocado_instrumented:AvocadoInstrumentedTestRunner" - ), - "tap = avocado.plugins.runners.tap:TAPRunner", - "noop = avocado.plugins.runners.noop:NoOpRunner", - "dry-run = avocado.plugins.runners.dry_run:DryRunRunner", - "exec-test = avocado.plugins.runners.exec_test:ExecTestRunner", - "python-unittest = avocado.plugins.runners.python_unittest:PythonUnittestRunner", - "asset = avocado.plugins.runners.asset:AssetRunner", - "package = avocado.plugins.runners.package:PackageRunner", - "podman-image = avocado.plugins.runners.podman_image:PodmanImageRunner", - "sysinfo = avocado.plugins.runners.sysinfo:SysinfoRunner", - ], - "avocado.plugins.spawner": [ - "process = avocado.plugins.spawners.process:ProcessSpawner", - "podman = avocado.plugins.spawners.podman:PodmanSpawner", - "lxc = avocado.plugins.spawners.lxc:LXCSpawner", - ], - "avocado.plugins.cache": [ - "requirement = avocado.plugins.requirement_cache:RequirementCache", - ], - }, zip_safe=False, - test_suite="selftests", - python_requires=">=3.8", + test_suite="tests", cmdclass={ "clean": Clean, "develop": Develop, @@ -493,5 +335,4 @@ def run(self): "plugin": Plugin, "test": Test, }, - install_requires=["setuptools"], ) From 09420d551d80835c8a93ae793df16bd4aee5bd7c Mon Sep 17 00:00:00 2001 From: Yihuang Yu Date: Tue, 18 Jun 2024 15:48:12 +0800 Subject: [PATCH 2/2] chore: Migrate settings of linter and formatter to pyproject.toml pyproject.toml can be an entry to maintain configurations of linter and formatter, which easier to manage their configurations. Signed-off-by: Yihuang Yu --- .coveragerc | 2 - .pylintrc | 545 --------------------------------------------- pyproject.toml | 83 +++++++ selftests/isort.sh | 2 +- selftests/spell.sh | 2 +- 5 files changed, 85 insertions(+), 549 deletions(-) delete mode 100644 .coveragerc delete mode 100644 .pylintrc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 146151a521..0000000000 --- a/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = avocado/, optional_plugins/ diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index f1dc582509..0000000000 --- a/.pylintrc +++ /dev/null @@ -1,545 +0,0 @@ -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. -extension-pkg-whitelist=netifaces - -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=CVS - -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns=.git - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the -# number of processors available to use. -jobs=0 - -# Control the amount of potential inferred values when inferring a single -# object. This can help the performance when dealing with large functions or -# complex, nested conditions. -limit-inference-results=100 - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins=pylint.extensions.no_self_use - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages. -suggestion-mode=yes - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. -confidence= - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable=all - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once). You can also use "--disable=all" to -# disable everything first and then re-enable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use "--disable=all --enable=classes -# --disable=W". -disable=C0103, - C0114, - C0115, - C0116, - C0200, - C0201, - C0301, - C0302, - C0321, - C0325, - C0413, - C0415, - E0401, - E0611, - E1101, - E1120, - I0011, - I0020, - I0021, - I0022, - I0023, - R0201, - R0801, - R0901, - R0902, - R0903, - R0904, - R0911, - R0912, - R0913, - R0914, - R0915, - R1702, - R1703, - R1704, - R1705, - R1706, - R1710, - R1711, - R1714, - R1717, - R1718, - R1719, - R1720, - R1721, - R1722, - R1723, - R1724, - R1729, - R1730, - R1732, - W0212, - W0511, - W0703, - W0707, - W1203 - - -[REPORTS] - -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details. -#msg-template= - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio). You can also give a reporter class, e.g. -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages. -reports=no - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - -# Complete name of functions that never returns. When checking for -# inconsistent-return-statements if a never returning function is called then -# it will be considered as an explicit return statement and no message will be -# printed. -never-returning-functions=sys.exit - - -[STRING] - -# This flag controls whether the implicit-str-concat-in-sequence should -# generate a warning on implicit string concatenation in sequences defined over -# several lines. -check-str-concat-over-line-jumps=no - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# Tells whether to warn about missing members when the owner of the attribute -# is inferred to be None. -ignore-none=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules= - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - - -[BASIC] - -# Naming style matching correct argument names. -argument-naming-style=snake_case - -# Regular expression matching correct argument names. Overrides argument- -# naming-style. -#argument-rgx= - -# Naming style matching correct attribute names. -attr-naming-style=snake_case - -# Regular expression matching correct attribute names. Overrides attr-naming- -# style. -#attr-rgx= - -# Bad variable names which should always be refused, separated by a comma. -bad-names=foo, - bar, - baz, - toto, - tutu, - tata - -# Naming style matching correct class attribute names. -class-attribute-naming-style=any - -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style. -#class-attribute-rgx= - -# Naming style matching correct class names. -class-naming-style=PascalCase - -# Regular expression matching correct class names. Overrides class-naming- -# style. -#class-rgx= - -# Naming style matching correct constant names. -const-naming-style=UPPER_CASE - -# Regular expression matching correct constant names. Overrides const-naming- -# style. -#const-rgx= - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming style matching correct function names. -function-naming-style=snake_case - -# Regular expression matching correct function names. Overrides function- -# naming-style. -#function-rgx= - -# Good variable names which should always be accepted, separated by a comma. -good-names=i, - j, - k, - ex, - Run, - _ - -# Include a hint for the correct naming format with invalid-name. -include-naming-hint=no - -# Naming style matching correct inline iteration names. -inlinevar-naming-style=any - -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style. -#inlinevar-rgx= - -# Naming style matching correct method names. -method-naming-style=snake_case - -# Regular expression matching correct method names. Overrides method-naming- -# style. -#method-rgx= - -# Naming style matching correct module names. -module-naming-style=snake_case - -# Regular expression matching correct module names. Overrides module-naming- -# style. -#module-rgx= - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -# These decorators are taken in consideration only for invalid-name. -property-classes=abc.abstractproperty - -# Naming style matching correct variable names. -variable-naming-style=snake_case - -# Regular expression matching correct variable names. Overrides variable- -# naming-style. -#variable-rgx= - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid defining new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_, - _cb - -# A regular expression matching the name of dummy variables (i.e. expected to -# not be used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore. -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module. -max-module-lines=1000 - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=no - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME, - XXX, - TODO - - -[SPELLING] - -# Limits count of emitted suggestions for spelling mistakes. -max-spelling-suggestions=4 - -# Spelling dictionary name. Available dictionaries: en_ZM (myspell), en_ZW -# (myspell), en_US (myspell), en_PH (myspell), en_IN (myspell), en_BW -# (myspell), en_TT (myspell), en_GB (myspell), en_SG (myspell), en_AG -# (myspell), en_NG (myspell), en_CA (myspell), en_BS (myspell), en_AU -# (myspell), en_JM (myspell), en_ZA (myspell), en_HK (myspell), en_BZ -# (myspell), en_IE (myspell), en_NZ (myspell), en_DK (myspell), en_MW -# (myspell), en_NA (myspell), en_GH (myspell).. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no - - -[LOGGING] - -# Format style used to check logging format string. `old` means using % -# formatting, while `new` is for `{}` formatting. -logging-format-style=old - -# Logging modules to check that the string format arguments are in logging -# function parameter format. -logging-modules=logging - - -[IMPORTS] - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma. -deprecated-modules=optparse,tkinter.tix - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled). -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled). -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled). -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - - -[DESIGN] - -# Maximum number of arguments for function / method. -max-args=5 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in an if statement. -max-bool-expr=5 - -# Maximum number of branch for function / method body. -max-branches=12 - -# Maximum number of locals for function / method body. -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body. -max-returns=6 - -# Maximum number of statements in function / method body. -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__, - __new__, - setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=cls - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "BaseException, Exception". -overgeneral-exceptions=builtin.BaseException, - builtin.Exception diff --git a/pyproject.toml b/pyproject.toml index c84a2a3031..c43793a7ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -160,3 +160,86 @@ version = {file = "VERSION"} [tool.setuptools.packages.find] exclude = ["selftests*"] + +[tool.black] +line-length = 88 + +[tool.isort] +profile = "black" + +[tool.coverage.run] +source = ["avocado/", "optional_plugins/"] + +[tool.pylint.main] +extension-pkg-whitelist = ["netifaces"] +ignore-patterns = [".git"] +load-plugins = ["pylint.extensions.no_self_use"] + +[tool.pylint."messages control"] +disable = [ + "C0103", + "C0114", + "C0115", + "C0116", + "C0200", + "C0201", + "C0301", + "C0302", + "C0321", + "C0325", + "C0413", + "C0415", + "C1804", + "C1805", + "E0401", + "E0611", + "E1101", + "E1120", + "I0011", + "I0020", + "I0021", + "I0022", + "I0023", + "R0201", + "R0801", + "R0901", + "R0902", + "R0903", + "R0904", + "R0911", + "R0912", + "R0913", + "R0914", + "R0915", + "R1702", + "R1703", + "R1704", + "R1705", + "R1706", + "R1710", + "R1711", + "R1714", + "R1717", + "R1718", + "R1719", + "R1720", + "R1721", + "R1722", + "R1723", + "R1724", + "R1729", + "R1730", + "R1732", + "W0212", + "W0511", + "W0703", + "W0707", + "W1203", +] +enable = ["all"] + +[tool.pylint.spelling] +max-spelling-suggestions = 4 + +[tool.pylint.exceptions] +overgeneral-exceptions=["builtin.BaseException", "builtin.Exception"] diff --git a/selftests/isort.sh b/selftests/isort.sh index c257898c87..f0309ac66d 100755 --- a/selftests/isort.sh +++ b/selftests/isort.sh @@ -1,3 +1,3 @@ #!/bin/sh -e -isort --check-only --profile black . +isort --check-only . diff --git a/selftests/spell.sh b/selftests/spell.sh index f013597d19..f7ad94c07a 100755 --- a/selftests/spell.sh +++ b/selftests/spell.sh @@ -3,4 +3,4 @@ echo "** Running spell check..." PYLINT=$(which pylint-3 2>/dev/null || which pylint) -${PYLINT} -j 1 --errors-only --disable=all --enable=spelling --spelling-dict=en_US --spelling-private-dict-file=spell.ignore * +${PYLINT} -j 1 --errors-only --disable=all --enable=spelling *