Skip to content

Commit 244c288

Browse files
committed
Move pulpcore.cli.common.generic to pulp_cli.generic
The idea of using "pulpcore" as an open namespace inspired by the python bindings was not a good one after all. Specifically it collides with the way we build our docs. And due to the use of entrypoints it's not even needed here. The symbols are imported at the old location for compatibility for now.
1 parent 6f4a4e5 commit 244c288

File tree

104 files changed

+2981
-3574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+2981
-3574
lines changed

CHANGES/+move_generic.removal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The module `generic` moved from `pulpcore.cli.common.generic` to `pulp_cli.generic`.
2+
The old import path is still available for compatibility reasons.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ docs:
5151
pulp-docs build
5252

5353
servedocs:
54-
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulpcore/cli/common/generic.py
54+
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulp_cli/generic.py
5555

5656
pulp-glue/pulp_glue/%/locale/messages.pot: pulp-glue/pulp_glue/%/*.py
5757
xgettext -d $* -o $@ pulp-glue/pulp_glue/$*/*.py

cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulpcore/cli/{{ cookiecutter.app_label }}/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import typing as t
22

33
import click
4+
from pulp_cli.generic import pulp_group
45
from pulp_glue.common.i18n import get_translation
5-
from pulpcore.cli.common.generic import pulp_group
66

77
# TODO Implement these
88
# from pulpcore.cli.{{ cookiecutter.app_label }}.content import content

cookiecutter/ci/{{ cookiecutter.__project_name }}/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ docs:
7474
pulp-docs build
7575

7676
servedocs:
77-
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulpcore/cli/common/generic.py
77+
pulp-docs serve -w CHANGES.md -w pulp-glue/pulp_glue -w pulp_cli/generic.py
7878
{%- endif %}
7979
{%- if cookiecutter.translations %}
8080
{%- if cookiecutter.glue %}

docs/dev/learn/architecture.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ A plugin must register itself with the main app by specifying its main module as
3838
The plugin should then attach subcommands to the `pulpcore.cli.common.main` command by providing a `mount` method in the main module.
3939

4040
```python
41-
from pulpcore.cli.common.generic import pulp_command
41+
from pulp_cli.generic import pulp_command
4242

4343
@pulp_command()
4444
def my_command():
@@ -52,7 +52,7 @@ def mount(main: click.Group, **kwargs: Any) -> None:
5252
## Contexts
5353

5454
In `click`, every subcommand is accompanied by a `click.Context`, and objects can be attached to them.
55-
In this CLI we attach a [`PulpCLIContext`][pulpcore.cli.common.generic.PulpCLIContext] to the main command, which inherits from `pulp-glue`'s [`PulpContext`][pulp_glue.common.context.PulpContext].
55+
In this CLI we attach a [`PulpCLIContext`][pulp_cli.generic.PulpCLIContext] to the main command, which inherits from `pulp-glue`'s [`PulpContext`][pulp_glue.common.context.PulpContext].
5656
This context handles the communication to the pulp server through its `api` property.
5757

5858
Further we encourage the handling of communication with certain endpoints by subclassing the [`PulpEntityContext`][pulp_glue.common.context.PulpEntityContext] or some of the resource-specific children, such as [PulpRepositoryContext][pulp_glue.common.context.PulpRepositoryContext].
@@ -80,20 +80,20 @@ def my_sub_command(entity_ctx):
8080

8181
For certain often repeated patterns like listing all entities of a particular kind,
8282
we provide generic commands that use the underlying context objects.
83-
The following example shows the use of the [`show_command`][pulpcore.cli.common.generic.show_command] generic.
83+
The following example shows the use of the [`show_command`][pulp_cli.generic.show_command] generic.
8484

8585
```python
86-
from pulpcore.cli.common.generic import name_option, show_command,
86+
from pulp_cli.generic import name_option, show_command,
8787

8888
lookup_params = [name_option]
8989
my_command.add_command(show_command(decorators=lookup_params))
9090
```
9191

92-
To add options to these subcommands, pass a list of [`PulpOption`][pulpcore.cli.common.generic.PulpOption] objects to the `decorators` argument.
93-
Preferably these are created using the [`pulp_option`][pulpcore.cli.common.generic.pulp_option] factory.
92+
To add options to these subcommands, pass a list of [`PulpOption`][pulp_cli.generic.PulpOption] objects to the `decorators` argument.
93+
Preferably these are created using the [`pulp_option`][pulp_cli.generic.pulp_option] factory.
9494

9595
```python
96-
from pulpcore.cli.common.generic import list_command,
96+
from pulp_cli.generic import list_command,
9797

9898
filter_params = [
9999
pulp_option("--name"),

docs/dev/reference/common_generic.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/dev/reference/generic.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# pulp\_cli.generic
2+
3+
::: pulp_cli.generic

0 commit comments

Comments
 (0)