Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion cookiecutter/update_pulp_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "==":
Expand Down
19 changes: 8 additions & 11 deletions docs/dev/guides/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 6 additions & 3 deletions docs/dev/learn/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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`.
```
Expand Down
1 change: 1 addition & 0 deletions pulp-glue/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

3 changes: 2 additions & 1 deletion pulp-glue/src/pulp_glue/common/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down
Loading