diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pyproject.toml.update b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pyproject.toml.update index 87109948f..90d8fea6f 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pyproject.toml.update +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pyproject.toml.update @@ -18,6 +18,7 @@ line-length = 100 [tool.ruff.lint] # This section is managed by the cookiecutter templates. +select = ["E4", "E7", "E9", "F"] extend-select = ["I", "INT", "PTH"] [tool.mypy] diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update index b1bb2d812..8da24d85d 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update @@ -209,6 +209,7 @@ extend-exclude = ["cookiecutter/bootstrap", "cookiecutter/ci", "cookiecutter/doc [tool.ruff.lint] # This section is managed by the cookiecutter templates. +select = ["E4", "E7", "E9", "F"] extend-select = ["I", "INT", "PTH"] [tool.ruff.lint.isort] diff --git a/cookiecutter/update_pulp_cli.py b/cookiecutter/update_pulp_cli.py index b207a5f12..c31aab4cd 100755 --- a/cookiecutter/update_pulp_cli.py +++ b/cookiecutter/update_pulp_cli.py @@ -42,7 +42,8 @@ def strategy_semver(requirement: Requirement, latest_version: Version) -> Requir assert upper_bound is not None if latest_version < Version(upper_bound.version): _logger.warn( - f"Dependency on {requirement} cannot be updated to include latest version {latest_version}." + f"Dependency on {requirement} cannot be updated " + "to include latest version {latest_version}." ) else: if upper_bound.operator == "==": diff --git a/docs/dev/guides/bootstrap.md b/docs/dev/guides/bootstrap.md index e12574192..3f940b913 100644 --- a/docs/dev/guides/bootstrap.md +++ b/docs/dev/guides/bootstrap.md @@ -64,13 +64,10 @@ Edit `pulp-glue-my-plugin/pulp_glue/my_plugin/context.py` to define context clas ```python import typing as t -from pulp_glue.common.context import ( - PulpEntityContext, - PluginRequirement -) +from pulp_glue.common.context import PulpEntityContext, PluginRequirement -class PulpMyResourceContext(): +class PulpMyResourceContext: """Context for working with my custom resource.""" ID_PREFIX = "my_resource" @@ -79,12 +76,12 @@ class PulpMyResourceContext(): def example_action(self, data: t.Dict[str, t.Any]) -> t.Dict[str, t.Any]: """Execute an example action with specific data. - Args: - data: The data dictionary to send to the API + Args: + data: The data dictionary to send to the API - Returns: - The action result - """ + Returns: + The action result + """ response = self.call( operation="example_action", body=data, @@ -137,7 +134,7 @@ from pulp_cli.common.generic import pass_entity_context @click.group() @pass_pulp_context -@click.pass_context +@click.pass_context def my_resource(ctx: click.Context, pulp_ctx: PulpContext, /) -> None: """My custom commands.""" ctx.obj = PulpMyResourceContext(pulp_ctx) diff --git a/docs/dev/learn/architecture.md b/docs/dev/learn/architecture.md index 78ab29cb2..2877274ca 100644 --- a/docs/dev/learn/architecture.md +++ b/docs/dev/learn/architecture.md @@ -26,7 +26,7 @@ A plugin must register itself with the main app by specifying its main module as === "setup.py" ```python - entry_points={ + entry_points = { "pulp_cli.plugins": [ "myplugin=pulpcore.cli.myplugin", ], @@ -40,6 +40,7 @@ The plugin should then attach subcommands to the `pulpcore.cli.common.main` comm ```python from pulp_cli.generic import pulp_command + @pulp_command() def my_command(): pass @@ -139,7 +140,9 @@ class PulpMyResourceContext(PulpEntityContext): NEEDS_PLUGINS = [PluginRequirement("my_plugin", specifier=">=1.0.0")] def show(self) -> t.Dict[str, t.Any]: - if self.pulp_ctx.has_plugin(PluginRequirement("my_plugin", specifier=">=1.2.3", inverted=True)): + if self.pulp_ctx.has_plugin( + PluginRequirement("my_plugin", specifier=">=1.2.3", inverted=True) + ): # Versioned workaroud # see bug-tracker/12345678 return lookup_my_content_legacy(self.pulp_href) @@ -149,7 +152,7 @@ class PulpMyResourceContext(PulpEntityContext): # In pulp_cli_my_plugin @main.command() @pass_pulp_context -def my_command(pulp_ctx:PulpContext) -> None: +def my_command(pulp_ctx: PulpContext) -> None: pulp_ctx.needs_plugin(PluginRequirement("my_plugin", specifier=">=1.1.0")) # From here on we can assume `my_plugin>=1.1.0`. ``` diff --git a/pulp-glue/pyproject.toml b/pulp-glue/pyproject.toml index 135c31800..c4a95a0c9 100644 --- a/pulp-glue/pyproject.toml +++ b/pulp-glue/pyproject.toml @@ -75,5 +75,6 @@ line-length = 100 [tool.ruff.lint] # This section is managed by the cookiecutter templates. +select = ["E4", "E7", "E9", "F"] extend-select = ["I", "INT", "PTH"] diff --git a/pulp-glue/src/pulp_glue/common/openapi.py b/pulp-glue/src/pulp_glue/common/openapi.py index 9b0e0b6b4..a7fab59c2 100644 --- a/pulp-glue/src/pulp_glue/common/openapi.py +++ b/pulp-glue/src/pulp_glue/common/openapi.py @@ -484,7 +484,8 @@ def _render_request( security = method_spec.security or self._api_spec.security else: # No auth required? Don't provide it. - # No auth_provider available? Hope for the best (cert auth is now coverd by the provider). + # No auth_provider available? + # Hope for the best (cert auth is now covered by the provider). # Authorization header present? You wanted it that way... security = None diff --git a/pyproject.toml b/pyproject.toml index 70eb5e250..1c313912f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -245,6 +245,7 @@ extend-exclude = ["cookiecutter/bootstrap", "cookiecutter/ci", "cookiecutter/doc [tool.ruff.lint] # This section is managed by the cookiecutter templates. +select = ["E4", "E7", "E9", "F"] extend-select = ["I", "INT", "PTH"] [tool.ruff.lint.isort] diff --git a/tests/conftest.py b/tests/conftest.py index 65f08e15d..5af31325b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,7 +22,7 @@ def pulp_cli_vars(pulp_cli_vars: dict[str, str]) -> dict[str, str]: "RPM_WEAK_DEPS_URL": urljoin(PULP_FIXTURES_URL, "/rpm-richnweak-deps"), "RPM_MODULES_REMOTE_URL": urljoin(PULP_FIXTURES_URL, "/rpm-with-modules"), "ANSIBLE_COLLECTION_REMOTE_URL": "https://galaxy.ansible.com/", - "ANSIBLE_ROLE_REMOTE_URL": "https://galaxy.ansible.com/api/v1/roles/?owner__username=elastic", # noqa + "ANSIBLE_ROLE_REMOTE_URL": "https://galaxy.ansible.com/api/v1/roles/?owner__username=elastic", "PYTHON_REMOTE_URL": PULP_FIXTURES_URL + "/python-pypi/", "ULN_REMOTE_URL": "uln://ovm2_2.1.1_i386_patch", }