From 8a80e7f7fe0371249db9e277a38cf65ca6d9c814 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Sun, 8 Feb 2026 18:09:58 +0100 Subject: [PATCH 1/5] Bump setuptools --- pulp-glue/pyproject.toml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pulp-glue/pyproject.toml b/pulp-glue/pyproject.toml index 09a7cac32..e7b89b007 100644 --- a/pulp-glue/pyproject.toml +++ b/pulp-glue/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools<82"] +requires = ["setuptools<83"] build-backend = "setuptools.build_meta" [project] diff --git a/pyproject.toml b/pyproject.toml index 34bb86b08..6d7b55b47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools<82"] +requires = ["setuptools<83"] build-backend = "setuptools.build_meta" [project] From b39cb0dbc42c1f5b115dca6aca67c26c44b10ad8 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Sun, 8 Feb 2026 13:56:54 +0100 Subject: [PATCH 2/5] Add tests to bootstap cookiecutter --- .../{{ cookiecutter.app_label }}/context.py | 1 - .../tests/conftest.py | 0 .../{{ cookiecutter.app_label }}/__init__.py | 1 + .../tests/cli.toml.example | 4 + .../tests/conftest.py | 19 +++++ .../test_remote.sh | 19 +++++ .../tests/test_help_pages.py | 61 ++++++++++++++ .../tests/scripts/config.source | 83 +++++++++++++++++++ cookiecutter/update_pulp_cli.py | 4 +- 9 files changed, 189 insertions(+), 3 deletions(-) create mode 100644 cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/tests/conftest.py create mode 100755 cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/cli.toml.example create mode 100644 cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/conftest.py create mode 100755 cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/scripts/pulp_{{ cookiecutter.app_label }}/test_remote.sh create mode 100644 cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/test_help_pages.py create mode 100644 cookiecutter/ci/{{ cookiecutter.__project_name }}/tests/scripts/config.source diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/context.py b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/context.py index a9d582ad8..5017ee548 100644 --- a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/context.py +++ b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/context.py @@ -1,5 +1,4 @@ from pulp_glue.common.i18n import get_translation - translation = get_translation(__package__) _ = translation.gettext diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/tests/conftest.py b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/tests/conftest.py new file mode 100644 index 000000000..e69de29bb diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulpcore/cli/{{ cookiecutter.app_label }}/__init__.py b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulpcore/cli/{{ cookiecutter.app_label }}/__init__.py index c065de414..ecd34b26a 100644 --- a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulpcore/cli/{{ cookiecutter.app_label }}/__init__.py +++ b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulpcore/cli/{{ cookiecutter.app_label }}/__init__.py @@ -2,6 +2,7 @@ import click from pulp_cli.generic import pulp_group + from pulp_glue.common.i18n import get_translation # TODO Implement these diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/cli.toml.example b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/cli.toml.example new file mode 100755 index 000000000..17dda99cd --- /dev/null +++ b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/cli.toml.example @@ -0,0 +1,4 @@ +[cli] +base_url = "http://localhost:8080" +username = "admin" +password = "password" diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/conftest.py b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/conftest.py new file mode 100644 index 000000000..a7a1eb255 --- /dev/null +++ b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/conftest.py @@ -0,0 +1,19 @@ +import typing as t +from urllib.parse import urljoin + +import pytest + +pytest_plugins = "pytest_pulp_cli" + + +@pytest.fixture +def pulp_cli_vars(pulp_cli_vars: t.MutableMapping[str, str]) -> t.MutableMapping[str, str]: + PULP_FIXTURES_URL = pulp_cli_vars["PULP_FIXTURES_URL"] + result: t.MutableMapping[str, str] = {} + result.update(pulp_cli_vars) + result.update( + { + "{{ cookiecutter.app_label }}_REMOTE_URL": urljoin(PULP_FIXTURES_URL, "/{{ cookiecutter.app_label }}"), + } + ) + return result diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/scripts/pulp_{{ cookiecutter.app_label }}/test_remote.sh b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/scripts/pulp_{{ cookiecutter.app_label }}/test_remote.sh new file mode 100755 index 000000000..162e64d55 --- /dev/null +++ b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/scripts/pulp_{{ cookiecutter.app_label }}/test_remote.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -eu + +# shellcheck source=tests/scripts/config.source +. "$(dirname "$(dirname "$(realpath "$0")")")/config.source" + +ENTITIES_NAME="test_{{ cookiecutter.app_label }}_remote" + +cleanup() { + pulp {{ cookiecutter.app_label }} remote destroy --name "${ENTITIES_NAME}" || true +} +trap cleanup EXIT + +# Fail to create some remotes: +expect_fail pulp {{ cookiecutter.app_label }} remote create --name "foo" + +# Create and a remote: +expect_succ pulp {{ cookiecutter.app_label }} remote create --name "foo" --url "foo" diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/test_help_pages.py b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/test_help_pages.py new file mode 100644 index 000000000..eea87ddab --- /dev/null +++ b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/tests/test_help_pages.py @@ -0,0 +1,61 @@ +import typing as t + +import click +import pytest +from click.testing import CliRunner +from packaging.version import parse as parse_version +from pulp_cli import __version__ as PULP_CLI_VERSION +from pulp_cli import load_plugins, main + +load_plugins() + + +def traverse_commands(command: click.Command, args: t.List[str]) -> t.Iterator[t.List[str]]: + yield args + + if isinstance(command, click.Group): + for name, sub in command.commands.items(): + yield from traverse_commands(sub, args + [name]) + + params = command.params + if params: + if "--type" in params[0].opts: + # iterate over commands with specific context types + assert isinstance(params[0].type, click.Choice) + for context_type in params[0].type.choices: + yield args + ["--type", context_type] + + for name, sub in command.commands.items(): + yield from traverse_commands(sub, args + ["--type", context_type, name]) + + +@pytest.fixture +def no_api(monkeypatch: pytest.MonkeyPatch) -> None: + @property # type: ignore + def getter(self: t.Any) -> None: + pytest.fail("Invalid access to 'PulpContext.api'.", pytrace=False) + + monkeypatch.setattr("pulp_glue.common.context.PulpContext.api", getter) + + +@pytest.mark.help_page +def test_access_help(no_api: None, subtests: pytest.Subtests) -> None: + """Test, that all help screens are accessible without touching the api property.""" + if parse_version(PULP_CLI_VERSION) < parse_version("0.24"): + pytest.skip("This test is incompatible with older cli versions.") + + runner = CliRunner() + for args in traverse_commands(main.commands["{{ cookiecutter.app_label }}"], ["{{ cookiecutter.app_label }}"]): + with subtests.test(msg=" ".join(args)): + result = runner.invoke(main, args + ["--help"], catch_exceptions=False) + + if result.exit_code == 2: + assert ( + "not available in this context" in result.stdout + or "not available in this context" in result.stderr + ) + else: + assert result.exit_code == 0 + assert result.stdout.startswith("Usage:") or result.stdout.startswith( + "DeprecationWarning:" + ) diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/tests/scripts/config.source b/cookiecutter/ci/{{ cookiecutter.__project_name }}/tests/scripts/config.source new file mode 100644 index 000000000..5901cc62e --- /dev/null +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/tests/scripts/config.source @@ -0,0 +1,83 @@ +# Library for test helper functions + +: "${PULP_API_ROOT:="/pulp/"}" + +# open fd 3 as a copy of stderr +exec 3<&2 + +# Expects the command to succeed +# Supresses all output, which is redirected to $OUTPUT and $ERROUTPUT +# Reports verbosely on failure +expect_succ () { + if { + "$@" + } 1>log.out 2>log.err + then + echo "SUCCESS [$@]" >&3 + OUTPUT="$(cat log.out)" + ERROUTPUT="$(cat log.err)" + else + echo "FAILURE [$@]" >&3 + echo "=== STDOUT ===" >&3 + cat log.out >&3 + echo "=== STDERR ===" >&3 + cat log.err >&3 + echo "==============" >&3 + false + fi +} + +# Expects the command to fail +# Supresses all output, which is redirected to $OUTPUT and $ERROUTPUT +# Reports verbosely on failure +expect_fail () { + if { + "$@" + } 1>log.out 2>log.err + then + echo "FAILURE [! $@]" >&3 + echo "=== STDOUT ===" >&3 + cat log.out >&3 + echo "=== STDERR ===" >&3 + cat log.err >&3 + false + else + echo "SUCCESS [! $@]" >&3 + OUTPUT="$(cat log.out)" + ERROUTPUT="$(cat log.err)" + fi +} + +# Expects the command to report access denied +# Supresses all output, which is redirected to $OUTPUT and $ERROUTPUT +# Reports verbosely on failure +expect_deny () { + if { + "$@" + } 1>log.out 2>log.err + # TODO check for access denied message + then + echo "FAILURE [! $@]" >&3 + echo "=== STDOUT ===" >&3 + cat log.out >&3 + echo "=== STDERR ===" >&3 + cat log.err >&3 + false + else + if grep -q "Operation .* not authorized." log.err + then + echo "SUCCESS [! $@]" >&3 + OUTPUT="$(cat log.out)" + ERROUTPUT="$(cat log.err)" + else + echo "FAILURE [! $@]" >&3 + echo "=== STDOUT ===" >&3 + cat log.out >&3 + echo "=== STDERR ===" >&3 + cat log.err >&3 + false + fi + fi +} + +set -eu diff --git a/cookiecutter/update_pulp_cli.py b/cookiecutter/update_pulp_cli.py index d6e7f6a6e..fbeb71cdc 100755 --- a/cookiecutter/update_pulp_cli.py +++ b/cookiecutter/update_pulp_cli.py @@ -9,12 +9,12 @@ import json import logging +import urllib.request + from packaging.version import Version from packaging.requirements import Requirement from packaging.specifiers import Specifier, SpecifierSet from packaging.utils import canonicalize_name -import urllib.request - import tomlkit From 8147d636b7277b3ab31c5d4ff1bed2301227a893 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Sun, 8 Feb 2026 20:50:40 +0100 Subject: [PATCH 3/5] Move location of fixture key to a more common place --- .ci/container_setup.d/10-install-signing-service.sh | 6 +++--- pytest_pulp_cli/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/container_setup.d/10-install-signing-service.sh b/.ci/container_setup.d/10-install-signing-service.sh index 5cb201962..666990080 100755 --- a/.ci/container_setup.d/10-install-signing-service.sh +++ b/.ci/container_setup.d/10-install-signing-service.sh @@ -6,9 +6,9 @@ pulp --config "${PULP_CLI_CONFIG}" debug has-plugin --name "deb" && HAS_DEB=true pulp --config "${PULP_CLI_CONFIG}" debug has-plugin --name "ansible" && HAS_ANSIBLE=true || HAS_ANSIBLE="" if [ "$HAS_DEB" ] || [ "$HAS_ANSIBLE" ] then - if [ ! -f pytest_pulp_cli/GPG-PRIVATE-KEY-fixture-signing ] + if [ ! -f .ci/GPG-PRIVATE-KEY-fixture-signing ] then - curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-PRIVATE-KEY-fixture-signing > pytest_pulp_cli/GPG-PRIVATE-KEY-fixture-signing + curl -L https://github.com/pulp/pulp-fixtures/raw/master/common/GPG-PRIVATE-KEY-fixture-signing > .ci/GPG-PRIVATE-KEY-fixture-signing fi echo "Setup the signing services" if "${CONTAINER_RUNTIME}" exec "pulp-ephemeral" id pulp @@ -20,7 +20,7 @@ then "${CONTAINER_RUNTIME}" exec "pulp-ephemeral" mkdir -p /var/lib/pulp/scripts/ # Setup key on the Pulp container echo "0C1A894EBB86AFAE218424CADDEF3019C2D4A8CF:6:" | "${CONTAINER_RUNTIME}" exec -i "pulp-ephemeral" su "${PULP_USER}" -c "gpg --import-ownertrust" - "${CONTAINER_RUNTIME}" exec -i "pulp-ephemeral" su "${PULP_USER}" -c "gpg --import" < pytest_pulp_cli/GPG-PRIVATE-KEY-fixture-signing + "${CONTAINER_RUNTIME}" exec -i "pulp-ephemeral" su "${PULP_USER}" -c "gpg --import" < .ci/GPG-PRIVATE-KEY-fixture-signing if [ "$HAS_DEB" ] then echo "Setup deb release signing service" diff --git a/pytest_pulp_cli/__init__.py b/pytest_pulp_cli/__init__.py index 7e0d6f7c8..bbcb74f57 100644 --- a/pytest_pulp_cli/__init__.py +++ b/pytest_pulp_cli/__init__.py @@ -144,7 +144,7 @@ def pulp_cli_gnupghome(tmp_path_factory: pytest.TempPathFactory) -> pathlib.Path gnupghome = tmp_path_factory.mktemp("gnupghome") gpg = gnupg.GPG(gnupghome=str(gnupghome)) - key_file = pathlib.Path(__file__).parent / "GPG-PRIVATE-KEY-fixture-signing" + key_file = pathlib.Path(".ci") / "GPG-PRIVATE-KEY-fixture-signing" if key_file.exists(): private_key_data = key_file.read_text() else: From 2c278d7af22807f32c62fe3876baab14e428f05e Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Sun, 8 Feb 2026 16:54:07 +0100 Subject: [PATCH 4/5] Add migration for src layout A migration script to transform the code base to the src-layout format was added as well as the cookiecutters are adjusted. In order to migrate you can call the migration script and then reapply the cookiecutters. --- cookiecutter/apply_templates.py | 5 +- .../{{ cookiecutter.app_label }}/__init__.py | 1 + cookiecutter/ci/cookiecutter.json | 1 + .../.gitignore | 2 +- .../Makefile | 7 ++- .../__init__.py | 1 - .../pyproject.toml.update | 5 +- .../pyproject.toml.update | 26 +++----- cookiecutter/migrate_src_layout.py | 61 +++++++++++++++++++ 9 files changed, 81 insertions(+), 28 deletions(-) delete mode 100644 cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.main_package }}/__init__.py create mode 100755 cookiecutter/migrate_src_layout.py diff --git a/cookiecutter/apply_templates.py b/cookiecutter/apply_templates.py index 8ef27eff6..ca530e601 100755 --- a/cookiecutter/apply_templates.py +++ b/cookiecutter/apply_templates.py @@ -11,8 +11,8 @@ import os -from pathlib import Path import tomllib +from pathlib import Path import click import yaml @@ -38,8 +38,7 @@ def main(bootstrap: bool, force: bool) -> None: os.chdir(proj_dir) try: - with open("pyproject.toml", "rb") as fp: - pyproject_toml = tomllib.load(fp) + pyproject_toml = tomllib.loads(Path("pyproject.toml").read_text()) config = pyproject_toml["tool"]["pulp_cli_template"] except (FileNotFoundError, KeyError): raise click.ClickException("This does not look like a pulp cli repository.") diff --git a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/__init__.py b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/__init__.py index e69de29bb..ee78df8da 100644 --- a/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/__init__.py +++ b/cookiecutter/bootstrap/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.app_label }}/__init__.py @@ -0,0 +1 @@ +__version__ = "{{ cookiecutter.current_version }}" diff --git a/cookiecutter/ci/cookiecutter.json b/cookiecutter/ci/cookiecutter.json index aa7aa7394..35a344207 100644 --- a/cookiecutter/ci/cookiecutter.json +++ b/cookiecutter/ci/cookiecutter.json @@ -1,5 +1,6 @@ { "app_label": "noname", + "src_layout": false, "glue": true, "docs": false, "translations": false, diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.gitignore b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.gitignore index 234fb5b30..ed761f6a8 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/.gitignore +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/.gitignore @@ -2,7 +2,7 @@ __pycache__/ build/ tests/cli.toml -pytest_pulp_cli/GPG-PRIVATE-KEY-fixture-signing +GPG-PRIVATE-KEY-fixture-signing site/ dist/ *.po~ diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/Makefile b/cookiecutter/ci/{{ cookiecutter.__project_name }}/Makefile index 91f444810..d1f9216e1 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/Makefile +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/Makefile @@ -1,10 +1,11 @@ +{%- set src_infix = "src/" if cookiecutter.src_layout else "" %} {%- if cookiecutter.translations %} LANGUAGES=de {%- endif %} {%- if cookiecutter.glue %} -GLUE_PLUGINS=$(notdir $(wildcard pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/*)) +GLUE_PLUGINS=$(notdir $(wildcard pulp-glue{{ cookiecutter.__app_label_suffix }}/{{ src_infix }}pulp_glue/*)) {%- endif %} -CLI_PLUGINS=$(notdir $(wildcard pulpcore/cli/*)) +CLI_PLUGINS=$(notdir $(wildcard {{ src_infix }}pulpcore/cli/*)) .PHONY: info info: @@ -37,7 +38,7 @@ lint: {%- endif %} .ci/scripts/check_click_for_mypy.py {%- if cookiecutter.glue %} - MYPYPATH=pulp-glue{{ cookiecutter.__app_label_suffix }} mypy + mypy cd pulp-glue{{ cookiecutter.__app_label_suffix }}; mypy {%- else %} mypy diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.main_package }}/__init__.py b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.main_package }}/__init__.py deleted file mode 100644 index ee78df8da..000000000 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.main_package }}/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "{{ cookiecutter.current_version }}" 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 6dbe38f9c..0c53498b9 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 @@ -4,7 +4,7 @@ [tool.setuptools.packages.find] # This section is managed by the cookiecutter templates. -where = ["."] +where = ["{% if cookiecutter.src_layout %}src{% else %}.{% endif %}"] include = ["pulp_glue.*"] namespaces = true @@ -25,7 +25,8 @@ extend-select = ["I"] strict = true warn_unused_ignores = false show_error_codes = true -files = "pulp_glue/**/*.py, tests/**/*.py" +files = "{% if cookiecutter.src_layout %}src{% else %}pulp_glue{% endif %}/**/*.py, tests/**/*.py" +mypy_path = ["{% if cookiecutter.src_layout %}src{% else %}.{% endif %}"] namespace_packages = true explicit_package_bases = true diff --git a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update index 9af096f28..d4127a0c6 100644 --- a/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update +++ b/cookiecutter/ci/{{ cookiecutter.__project_name }}/pyproject.toml.update @@ -1,10 +1,11 @@ {# This file is not templated for itself, but it is used to update sections in pyproject.toml. #} +{%- set src_infix = "src/" if cookiecutter.src_layout else "" %} [tool.setuptools.packages.find] # This section is managed by the cookiecutter templates. -where = ["."] +where = ["{% if cookiecutter.src_layout %}src{% else %}.{% endif %}"] include = ["pulpcore.cli.*"{% if cookiecutter.app_label == "" %}, "pulp_cli", "pytest_pulp_cli"{% endif %}] namespaces = true @@ -16,6 +17,7 @@ namespaces = true # This section is co-managed by the cookiecutter templates. # Changes to existing keys should be preserved. app_label = {{ cookiecutter.app_label | toml_value }} +src_layout = {{ cookiecutter.src_layout | toml_value }} repository = {{ cookiecutter.repository | toml_value }} glue = {{ cookiecutter.glue | toml_value }} docs = {{ cookiecutter.docs | toml_value }} @@ -47,7 +49,7 @@ values = [ [[tool.bumpversion.files]] # This section is managed by the cookiecutter templates. -filename = "./pulp_cli/__init__.py" +filename = "./{{ src_infix }}pulp_cli/__init__.py" search = "__version__ = \"{current_version}\"" replace = "__version__ = \"{new_version}\"" {%- endif %} @@ -55,14 +57,14 @@ replace = "__version__ = \"{new_version}\"" [[tool.bumpversion.files]] # This section is managed by the cookiecutter templates. -filename = "./pulp-glue{{ cookiecutter.__app_label_suffix }}/pulp_glue/{{ cookiecutter.main_package }}/__init__.py" +filename = "./pulp-glue{{ cookiecutter.__app_label_suffix }}/{{ src_infix }}pulp_glue/{{ cookiecutter.main_package }}/__init__.py" search = "__version__ = \"{current_version}\"" replace = "__version__ = \"{new_version}\"" {%- endif %} [[tool.bumpversion.files]] # This section is managed by the cookiecutter templates. -filename = "./pulpcore/cli/{{ cookiecutter.main_package }}/__init__.py" +filename = "./{{ src_infix }}pulpcore/cli/{{ cookiecutter.main_package }}/__init__.py" search = "__version__ = \"{current_version}\"" replace = "__version__ = \"{new_version}\"" {%- if cookiecutter.glue %} @@ -156,19 +158,6 @@ directory = "misc" name = "Misc" showcontent = true -[tool.black] -# This section is managed by the cookiecutter templates. -line-length = 100 -{%- if cookiecutter.app_label == "" %} -exclude = "cookiecutter" -{%- endif %} - -[tool.isort] -# This section is managed by the cookiecutter templates. -profile = "black" -line_length = 100 -extend_skip = ["pulp-glue{{ cookiecutter.__app_label_suffix }}"{% if cookiecutter.app_label == "" %}, "cookiecutter"{% endif %}] - [tool.ruff] # This section is managed by the cookiecutter templates. line-length = 100 @@ -188,7 +177,8 @@ section-order = ["future", "standard-library", "third-party", "second-party", "f strict = true warn_unused_ignores = false show_error_codes = true -files = "pulpcore/**/*.py, tests/*.py{% if cookiecutter.app_label == "" %}, pulp_cli/**/*.py, pytest_pulp_cli/**/*.py{% endif %}" +files = "{% if cookiecutter.src_layout %}src{% else %}pulpcore{% endif %}/**/*.py, tests/*.py{% if cookiecutter.app_label == "" and not cookiecutter.src_layout %}, pulp_cli/**/*.py, pytest_pulp_cli/**/*.py{% endif %}" +mypy_path = ["{% if cookiecutter.src_layout %}src{% else %}.{% endif %}"{% if cookiecutter.glue %}, "pulp-glue{{ cookiecutter.__app_label_suffix }}{% if cookiecutter.src_layout %}/src{% endif %}"{% endif %}] namespace_packages = true explicit_package_bases = true diff --git a/cookiecutter/migrate_src_layout.py b/cookiecutter/migrate_src_layout.py new file mode 100755 index 000000000..65f8f8857 --- /dev/null +++ b/cookiecutter/migrate_src_layout.py @@ -0,0 +1,61 @@ +#!/bin/env python3 +# /// script +# requires-python = ">=3.11" +# dependencies = [ +# "pyyaml>=6.0.3,<6.1", +# "tomlkit>=0.13.3,<0.14", +# ] +# /// + + +import typing as t +import sys +from pathlib import Path + +import tomlkit + + +def main() -> None: + pyproject_file = Path("pyproject.toml") + try: + pyproject_toml: t.Any = tomlkit.loads(pyproject_file.read_text()) + config = pyproject_toml["tool"]["pulp_cli_template"] + except (FileNotFoundError, KeyError): + raise RuntimeError("This does not look like a pulp cli repository.") + + if config.get("src_layout") is True: + print("Apparently this repository has been migrated already.") + sys.exit() + + if config["glue"] is True: + if config["app_label"] == "": + glue_dir = Path("pulp-glue") + else: + glue_dir = Path("pulp-glue-" + config["app_label"]) + assert glue_dir.is_dir() + print("Moving glue parts.") + glue_src_dir = glue_dir / "src" + glue_src_dir.mkdir(exist_ok=True) + glue_namespace_dir = glue_dir / "pulp_glue" + glue_namespace_dir.rename(glue_src_dir / "pulp_glue") + + print("Moving cli parts to src.") + cli_src_dir = Path("src") + cli_src_dir.mkdir(exist_ok=True) + + cli_namespace_dir = Path("pulpcore") + cli_namespace_dir.rename(cli_src_dir / "pulpcore") + + if config["app_label"] == "": + cli_base_dir = Path("pulp_cli") + cli_base_dir.rename(cli_src_dir / "pulp_cli") + pytest_plugin_dir = Path("pytest_pulp_cli") + pytest_plugin_dir.rename(cli_src_dir / "pytest_pulp_cli") + + config["src_layout"] = True + pyproject_file.write_text(tomlkit.dumps(pyproject_toml)) + print("Please reapply the cookiecutter ci templates now.") + + +if __name__ == "__main__": + main() From 8c1171f1b48b17773d57027123972ac3dc3d2af8 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Sun, 8 Feb 2026 16:57:55 +0100 Subject: [PATCH 5/5] Apply src_layout --- .gitignore | 2 +- Makefile | 6 +++--- pulp-glue/pyproject.toml | 5 +++-- pulp-glue/{ => src}/pulp_glue/ansible/__init__.py | 0 pulp-glue/{ => src}/pulp_glue/ansible/context.py | 0 .../ansible/locale/de/LC_MESSAGES/messages.mo | Bin .../ansible/locale/de/LC_MESSAGES/messages.po | 0 .../pulp_glue/ansible/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/ansible/py.typed | 0 .../{ => src}/pulp_glue/certguard/__init__.py | 0 pulp-glue/{ => src}/pulp_glue/certguard/context.py | 0 .../certguard/locale/de/LC_MESSAGES/messages.mo | Bin .../certguard/locale/de/LC_MESSAGES/messages.po | 0 .../pulp_glue/certguard/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/certguard/py.typed | 0 pulp-glue/{ => src}/pulp_glue/common/__init__.py | 0 .../{ => src}/pulp_glue/common/authentication.py | 0 pulp-glue/{ => src}/pulp_glue/common/context.py | 0 pulp-glue/{ => src}/pulp_glue/common/exceptions.py | 0 pulp-glue/{ => src}/pulp_glue/common/i18n.py | 0 .../common/locale/de/LC_MESSAGES/messages.mo | Bin .../common/locale/de/LC_MESSAGES/messages.po | 0 .../{ => src}/pulp_glue/common/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/common/openapi.py | 0 pulp-glue/{ => src}/pulp_glue/common/py.typed | 0 pulp-glue/{ => src}/pulp_glue/common/schema.py | 0 .../{ => src}/pulp_glue/container/__init__.py | 0 pulp-glue/{ => src}/pulp_glue/container/context.py | 0 .../container/locale/de/LC_MESSAGES/messages.mo | Bin .../container/locale/de/LC_MESSAGES/messages.po | 0 .../pulp_glue/container/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/container/py.typed | 0 pulp-glue/{ => src}/pulp_glue/core/__init__.py | 0 pulp-glue/{ => src}/pulp_glue/core/context.py | 0 .../core/locale/de/LC_MESSAGES/messages.mo | Bin .../core/locale/de/LC_MESSAGES/messages.po | 0 .../{ => src}/pulp_glue/core/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/core/py.typed | 0 pulp-glue/{ => src}/pulp_glue/file/__init__.py | 0 pulp-glue/{ => src}/pulp_glue/file/context.py | 0 .../file/locale/de/LC_MESSAGES/messages.mo | Bin .../file/locale/de/LC_MESSAGES/messages.po | 0 .../{ => src}/pulp_glue/file/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/file/py.typed | 0 pulp-glue/{ => src}/pulp_glue/python/__init__.py | 0 pulp-glue/{ => src}/pulp_glue/python/context.py | 0 .../python/locale/de/LC_MESSAGES/messages.mo | Bin .../python/locale/de/LC_MESSAGES/messages.po | 0 .../{ => src}/pulp_glue/python/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/python/py.typed | 0 pulp-glue/{ => src}/pulp_glue/rpm/__init__.py | 0 pulp-glue/{ => src}/pulp_glue/rpm/context.py | 0 .../rpm/locale/de/LC_MESSAGES/messages.mo | Bin .../rpm/locale/de/LC_MESSAGES/messages.po | 0 .../{ => src}/pulp_glue/rpm/locale/messages.pot | 0 pulp-glue/{ => src}/pulp_glue/rpm/py.typed | 0 pyproject.toml | 13 +++++++------ {pulp_cli => src/pulp_cli}/__init__.py | 0 {pulp_cli => src/pulp_cli}/config.py | 0 {pulp_cli => src/pulp_cli}/generic.py | 0 {pulp_cli => src/pulp_cli}/py.typed | 0 {pulpcore => src/pulpcore}/cli/ansible/__init__.py | 0 {pulpcore => src/pulpcore}/cli/ansible/content.py | 0 .../pulpcore}/cli/ansible/distribution.py | 0 .../cli/ansible/locale/de/LC_MESSAGES/messages.mo | Bin .../cli/ansible/locale/de/LC_MESSAGES/messages.po | 0 .../pulpcore}/cli/ansible/locale/messages.pot | 0 {pulpcore => src/pulpcore}/cli/ansible/py.typed | 0 {pulpcore => src/pulpcore}/cli/ansible/remote.py | 0 .../pulpcore}/cli/ansible/repository.py | 0 {pulpcore => src/pulpcore}/cli/common/__init__.py | 0 {pulpcore => src/pulpcore}/cli/common/acs.py | 0 {pulpcore => src/pulpcore}/cli/common/debug.py | 0 {pulpcore => src/pulpcore}/cli/common/generic.py | 0 {pulpcore => src/pulpcore}/cli/common/i18n.py | 0 .../cli/common/locale/de/LC_MESSAGES/messages.mo | Bin .../cli/common/locale/de/LC_MESSAGES/messages.po | 0 .../pulpcore}/cli/common/locale/messages.pot | 0 {pulpcore => src/pulpcore}/cli/common/py.typed | 0 .../pulpcore}/cli/container/__init__.py | 0 .../pulpcore}/cli/container/content.py | 0 .../pulpcore}/cli/container/distribution.py | 0 .../container/locale/de/LC_MESSAGES/messages.mo | Bin .../container/locale/de/LC_MESSAGES/messages.po | 0 .../pulpcore}/cli/container/locale/messages.pot | 0 .../pulpcore}/cli/container/namespace.py | 0 {pulpcore => src/pulpcore}/cli/container/py.typed | 0 {pulpcore => src/pulpcore}/cli/container/remote.py | 0 .../pulpcore}/cli/container/repository.py | 0 {pulpcore => src/pulpcore}/cli/core/__init__.py | 0 .../pulpcore}/cli/core/access_policy.py | 0 {pulpcore => src/pulpcore}/cli/core/artifact.py | 0 {pulpcore => src/pulpcore}/cli/core/content.py | 0 .../pulpcore}/cli/core/content_guard.py | 0 .../pulpcore}/cli/core/distribution.py | 0 {pulpcore => src/pulpcore}/cli/core/domain.py | 0 {pulpcore => src/pulpcore}/cli/core/export.py | 0 {pulpcore => src/pulpcore}/cli/core/exporter.py | 0 {pulpcore => src/pulpcore}/cli/core/generic.py | 0 {pulpcore => src/pulpcore}/cli/core/group.py | 0 {pulpcore => src/pulpcore}/cli/core/importer.py | 0 .../cli/core/locale/de/LC_MESSAGES/messages.mo | Bin .../cli/core/locale/de/LC_MESSAGES/messages.po | 0 .../pulpcore}/cli/core/locale/messages.pot | 0 {pulpcore => src/pulpcore}/cli/core/orphan.py | 0 {pulpcore => src/pulpcore}/cli/core/publication.py | 0 {pulpcore => src/pulpcore}/cli/core/py.typed | 0 {pulpcore => src/pulpcore}/cli/core/remote.py | 0 {pulpcore => src/pulpcore}/cli/core/repository.py | 0 {pulpcore => src/pulpcore}/cli/core/role.py | 0 {pulpcore => src/pulpcore}/cli/core/show.py | 0 .../pulpcore}/cli/core/signing_service.py | 0 {pulpcore => src/pulpcore}/cli/core/status.py | 0 {pulpcore => src/pulpcore}/cli/core/task.py | 0 {pulpcore => src/pulpcore}/cli/core/task_group.py | 0 {pulpcore => src/pulpcore}/cli/core/upload.py | 0 .../pulpcore}/cli/core/upstream_pulp.py | 0 {pulpcore => src/pulpcore}/cli/core/user.py | 0 .../pulpcore}/cli/core/vulnerability_report.py | 0 {pulpcore => src/pulpcore}/cli/core/worker.py | 0 {pulpcore => src/pulpcore}/cli/file/__init__.py | 0 {pulpcore => src/pulpcore}/cli/file/content.py | 0 .../pulpcore}/cli/file/distribution.py | 0 .../cli/file/locale/de/LC_MESSAGES/messages.mo | Bin .../cli/file/locale/de/LC_MESSAGES/messages.po | 0 .../pulpcore}/cli/file/locale/messages.pot | 0 {pulpcore => src/pulpcore}/cli/file/publication.py | 0 {pulpcore => src/pulpcore}/cli/file/py.typed | 0 {pulpcore => src/pulpcore}/cli/file/remote.py | 0 {pulpcore => src/pulpcore}/cli/file/repository.py | 0 {pulpcore => src/pulpcore}/cli/python/__init__.py | 0 {pulpcore => src/pulpcore}/cli/python/content.py | 0 .../pulpcore}/cli/python/distribution.py | 0 .../cli/python/locale/de/LC_MESSAGES/messages.mo | Bin .../cli/python/locale/de/LC_MESSAGES/messages.po | 0 .../pulpcore}/cli/python/locale/messages.pot | 0 .../pulpcore}/cli/python/publication.py | 0 {pulpcore => src/pulpcore}/cli/python/py.typed | 0 {pulpcore => src/pulpcore}/cli/python/remote.py | 0 .../pulpcore}/cli/python/repository.py | 0 {pulpcore => src/pulpcore}/cli/rpm/__init__.py | 0 {pulpcore => src/pulpcore}/cli/rpm/common.py | 0 {pulpcore => src/pulpcore}/cli/rpm/comps.py | 0 {pulpcore => src/pulpcore}/cli/rpm/content.py | 0 {pulpcore => src/pulpcore}/cli/rpm/copy.py | 0 {pulpcore => src/pulpcore}/cli/rpm/distribution.py | 0 .../cli/rpm/locale/de/LC_MESSAGES/messages.mo | Bin .../cli/rpm/locale/de/LC_MESSAGES/messages.po | 0 .../pulpcore}/cli/rpm/locale/messages.pot | 0 {pulpcore => src/pulpcore}/cli/rpm/prune.py | 0 {pulpcore => src/pulpcore}/cli/rpm/publication.py | 0 {pulpcore => src/pulpcore}/cli/rpm/py.typed | 0 {pulpcore => src/pulpcore}/cli/rpm/remote.py | 0 {pulpcore => src/pulpcore}/cli/rpm/repository.py | 0 .../pytest_pulp_cli}/__init__.py | 0 155 files changed, 14 insertions(+), 12 deletions(-) rename pulp-glue/{ => src}/pulp_glue/ansible/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/ansible/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/ansible/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/ansible/py.typed (100%) rename pulp-glue/{ => src}/pulp_glue/certguard/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/certguard/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/certguard/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/certguard/py.typed (100%) rename pulp-glue/{ => src}/pulp_glue/common/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/common/authentication.py (100%) rename pulp-glue/{ => src}/pulp_glue/common/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/common/exceptions.py (100%) rename pulp-glue/{ => src}/pulp_glue/common/i18n.py (100%) rename pulp-glue/{ => src}/pulp_glue/common/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/common/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/common/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/common/openapi.py (100%) rename pulp-glue/{ => src}/pulp_glue/common/py.typed (100%) rename pulp-glue/{ => src}/pulp_glue/common/schema.py (100%) rename pulp-glue/{ => src}/pulp_glue/container/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/container/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/container/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/container/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/container/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/container/py.typed (100%) rename pulp-glue/{ => src}/pulp_glue/core/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/core/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/core/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/core/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/core/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/core/py.typed (100%) rename pulp-glue/{ => src}/pulp_glue/file/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/file/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/file/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/file/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/file/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/file/py.typed (100%) rename pulp-glue/{ => src}/pulp_glue/python/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/python/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/python/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/python/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/python/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/python/py.typed (100%) rename pulp-glue/{ => src}/pulp_glue/rpm/__init__.py (100%) rename pulp-glue/{ => src}/pulp_glue/rpm/context.py (100%) rename pulp-glue/{ => src}/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.mo (100%) rename pulp-glue/{ => src}/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.po (100%) rename pulp-glue/{ => src}/pulp_glue/rpm/locale/messages.pot (100%) rename pulp-glue/{ => src}/pulp_glue/rpm/py.typed (100%) rename {pulp_cli => src/pulp_cli}/__init__.py (100%) rename {pulp_cli => src/pulp_cli}/config.py (100%) rename {pulp_cli => src/pulp_cli}/generic.py (100%) rename {pulp_cli => src/pulp_cli}/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/ansible/__init__.py (100%) rename {pulpcore => src/pulpcore}/cli/ansible/content.py (100%) rename {pulpcore => src/pulpcore}/cli/ansible/distribution.py (100%) rename {pulpcore => src/pulpcore}/cli/ansible/locale/de/LC_MESSAGES/messages.mo (100%) rename {pulpcore => src/pulpcore}/cli/ansible/locale/de/LC_MESSAGES/messages.po (100%) rename {pulpcore => src/pulpcore}/cli/ansible/locale/messages.pot (100%) rename {pulpcore => src/pulpcore}/cli/ansible/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/ansible/remote.py (100%) rename {pulpcore => src/pulpcore}/cli/ansible/repository.py (100%) rename {pulpcore => src/pulpcore}/cli/common/__init__.py (100%) rename {pulpcore => src/pulpcore}/cli/common/acs.py (100%) rename {pulpcore => src/pulpcore}/cli/common/debug.py (100%) rename {pulpcore => src/pulpcore}/cli/common/generic.py (100%) rename {pulpcore => src/pulpcore}/cli/common/i18n.py (100%) rename {pulpcore => src/pulpcore}/cli/common/locale/de/LC_MESSAGES/messages.mo (100%) rename {pulpcore => src/pulpcore}/cli/common/locale/de/LC_MESSAGES/messages.po (100%) rename {pulpcore => src/pulpcore}/cli/common/locale/messages.pot (100%) rename {pulpcore => src/pulpcore}/cli/common/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/container/__init__.py (100%) rename {pulpcore => src/pulpcore}/cli/container/content.py (100%) rename {pulpcore => src/pulpcore}/cli/container/distribution.py (100%) rename {pulpcore => src/pulpcore}/cli/container/locale/de/LC_MESSAGES/messages.mo (100%) rename {pulpcore => src/pulpcore}/cli/container/locale/de/LC_MESSAGES/messages.po (100%) rename {pulpcore => src/pulpcore}/cli/container/locale/messages.pot (100%) rename {pulpcore => src/pulpcore}/cli/container/namespace.py (100%) rename {pulpcore => src/pulpcore}/cli/container/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/container/remote.py (100%) rename {pulpcore => src/pulpcore}/cli/container/repository.py (100%) rename {pulpcore => src/pulpcore}/cli/core/__init__.py (100%) rename {pulpcore => src/pulpcore}/cli/core/access_policy.py (100%) rename {pulpcore => src/pulpcore}/cli/core/artifact.py (100%) rename {pulpcore => src/pulpcore}/cli/core/content.py (100%) rename {pulpcore => src/pulpcore}/cli/core/content_guard.py (100%) rename {pulpcore => src/pulpcore}/cli/core/distribution.py (100%) rename {pulpcore => src/pulpcore}/cli/core/domain.py (100%) rename {pulpcore => src/pulpcore}/cli/core/export.py (100%) rename {pulpcore => src/pulpcore}/cli/core/exporter.py (100%) rename {pulpcore => src/pulpcore}/cli/core/generic.py (100%) rename {pulpcore => src/pulpcore}/cli/core/group.py (100%) rename {pulpcore => src/pulpcore}/cli/core/importer.py (100%) rename {pulpcore => src/pulpcore}/cli/core/locale/de/LC_MESSAGES/messages.mo (100%) rename {pulpcore => src/pulpcore}/cli/core/locale/de/LC_MESSAGES/messages.po (100%) rename {pulpcore => src/pulpcore}/cli/core/locale/messages.pot (100%) rename {pulpcore => src/pulpcore}/cli/core/orphan.py (100%) rename {pulpcore => src/pulpcore}/cli/core/publication.py (100%) rename {pulpcore => src/pulpcore}/cli/core/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/core/remote.py (100%) rename {pulpcore => src/pulpcore}/cli/core/repository.py (100%) rename {pulpcore => src/pulpcore}/cli/core/role.py (100%) rename {pulpcore => src/pulpcore}/cli/core/show.py (100%) rename {pulpcore => src/pulpcore}/cli/core/signing_service.py (100%) rename {pulpcore => src/pulpcore}/cli/core/status.py (100%) rename {pulpcore => src/pulpcore}/cli/core/task.py (100%) rename {pulpcore => src/pulpcore}/cli/core/task_group.py (100%) rename {pulpcore => src/pulpcore}/cli/core/upload.py (100%) rename {pulpcore => src/pulpcore}/cli/core/upstream_pulp.py (100%) rename {pulpcore => src/pulpcore}/cli/core/user.py (100%) rename {pulpcore => src/pulpcore}/cli/core/vulnerability_report.py (100%) rename {pulpcore => src/pulpcore}/cli/core/worker.py (100%) rename {pulpcore => src/pulpcore}/cli/file/__init__.py (100%) rename {pulpcore => src/pulpcore}/cli/file/content.py (100%) rename {pulpcore => src/pulpcore}/cli/file/distribution.py (100%) rename {pulpcore => src/pulpcore}/cli/file/locale/de/LC_MESSAGES/messages.mo (100%) rename {pulpcore => src/pulpcore}/cli/file/locale/de/LC_MESSAGES/messages.po (100%) rename {pulpcore => src/pulpcore}/cli/file/locale/messages.pot (100%) rename {pulpcore => src/pulpcore}/cli/file/publication.py (100%) rename {pulpcore => src/pulpcore}/cli/file/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/file/remote.py (100%) rename {pulpcore => src/pulpcore}/cli/file/repository.py (100%) rename {pulpcore => src/pulpcore}/cli/python/__init__.py (100%) rename {pulpcore => src/pulpcore}/cli/python/content.py (100%) rename {pulpcore => src/pulpcore}/cli/python/distribution.py (100%) rename {pulpcore => src/pulpcore}/cli/python/locale/de/LC_MESSAGES/messages.mo (100%) rename {pulpcore => src/pulpcore}/cli/python/locale/de/LC_MESSAGES/messages.po (100%) rename {pulpcore => src/pulpcore}/cli/python/locale/messages.pot (100%) rename {pulpcore => src/pulpcore}/cli/python/publication.py (100%) rename {pulpcore => src/pulpcore}/cli/python/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/python/remote.py (100%) rename {pulpcore => src/pulpcore}/cli/python/repository.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/__init__.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/common.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/comps.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/content.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/copy.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/distribution.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/locale/de/LC_MESSAGES/messages.mo (100%) rename {pulpcore => src/pulpcore}/cli/rpm/locale/de/LC_MESSAGES/messages.po (100%) rename {pulpcore => src/pulpcore}/cli/rpm/locale/messages.pot (100%) rename {pulpcore => src/pulpcore}/cli/rpm/prune.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/publication.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/py.typed (100%) rename {pulpcore => src/pulpcore}/cli/rpm/remote.py (100%) rename {pulpcore => src/pulpcore}/cli/rpm/repository.py (100%) rename {pytest_pulp_cli => src/pytest_pulp_cli}/__init__.py (100%) diff --git a/.gitignore b/.gitignore index 234fb5b30..ed761f6a8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ __pycache__/ build/ tests/cli.toml -pytest_pulp_cli/GPG-PRIVATE-KEY-fixture-signing +GPG-PRIVATE-KEY-fixture-signing site/ dist/ *.po~ diff --git a/Makefile b/Makefile index 2e585938f..917b36a07 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ LANGUAGES=de -GLUE_PLUGINS=$(notdir $(wildcard pulp-glue/pulp_glue/*)) -CLI_PLUGINS=$(notdir $(wildcard pulpcore/cli/*)) +GLUE_PLUGINS=$(notdir $(wildcard pulp-glue/src/pulp_glue/*)) +CLI_PLUGINS=$(notdir $(wildcard src/pulpcore/cli/*)) .PHONY: info info: @@ -26,7 +26,7 @@ lint: ruff format --check --diff ruff check --diff .ci/scripts/check_click_for_mypy.py - MYPYPATH=pulp-glue mypy + mypy cd pulp-glue; mypy @echo "🙊 Code 🙈 LGTM 🙉 !" diff --git a/pulp-glue/pyproject.toml b/pulp-glue/pyproject.toml index e7b89b007..a56f6e5ce 100644 --- a/pulp-glue/pyproject.toml +++ b/pulp-glue/pyproject.toml @@ -35,7 +35,7 @@ changelog = "https://pulpproject.org/pulp-cli/changes/" [tool.setuptools.packages.find] # This section is managed by the cookiecutter templates. -where = ["."] +where = ["src"] include = ["pulp_glue.*"] namespaces = true @@ -49,7 +49,8 @@ namespaces = true strict = true warn_unused_ignores = false show_error_codes = true -files = "pulp_glue/**/*.py, tests/**/*.py" +files = "src/**/*.py, tests/**/*.py" +mypy_path = ["src"] namespace_packages = true explicit_package_bases = true diff --git a/pulp-glue/pulp_glue/ansible/__init__.py b/pulp-glue/src/pulp_glue/ansible/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/ansible/__init__.py rename to pulp-glue/src/pulp_glue/ansible/__init__.py diff --git a/pulp-glue/pulp_glue/ansible/context.py b/pulp-glue/src/pulp_glue/ansible/context.py similarity index 100% rename from pulp-glue/pulp_glue/ansible/context.py rename to pulp-glue/src/pulp_glue/ansible/context.py diff --git a/pulp-glue/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/ansible/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/ansible/locale/messages.pot b/pulp-glue/src/pulp_glue/ansible/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/ansible/locale/messages.pot rename to pulp-glue/src/pulp_glue/ansible/locale/messages.pot diff --git a/pulp-glue/pulp_glue/ansible/py.typed b/pulp-glue/src/pulp_glue/ansible/py.typed similarity index 100% rename from pulp-glue/pulp_glue/ansible/py.typed rename to pulp-glue/src/pulp_glue/ansible/py.typed diff --git a/pulp-glue/pulp_glue/certguard/__init__.py b/pulp-glue/src/pulp_glue/certguard/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/certguard/__init__.py rename to pulp-glue/src/pulp_glue/certguard/__init__.py diff --git a/pulp-glue/pulp_glue/certguard/context.py b/pulp-glue/src/pulp_glue/certguard/context.py similarity index 100% rename from pulp-glue/pulp_glue/certguard/context.py rename to pulp-glue/src/pulp_glue/certguard/context.py diff --git a/pulp-glue/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/certguard/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/certguard/locale/messages.pot b/pulp-glue/src/pulp_glue/certguard/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/certguard/locale/messages.pot rename to pulp-glue/src/pulp_glue/certguard/locale/messages.pot diff --git a/pulp-glue/pulp_glue/certguard/py.typed b/pulp-glue/src/pulp_glue/certguard/py.typed similarity index 100% rename from pulp-glue/pulp_glue/certguard/py.typed rename to pulp-glue/src/pulp_glue/certguard/py.typed diff --git a/pulp-glue/pulp_glue/common/__init__.py b/pulp-glue/src/pulp_glue/common/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/common/__init__.py rename to pulp-glue/src/pulp_glue/common/__init__.py diff --git a/pulp-glue/pulp_glue/common/authentication.py b/pulp-glue/src/pulp_glue/common/authentication.py similarity index 100% rename from pulp-glue/pulp_glue/common/authentication.py rename to pulp-glue/src/pulp_glue/common/authentication.py diff --git a/pulp-glue/pulp_glue/common/context.py b/pulp-glue/src/pulp_glue/common/context.py similarity index 100% rename from pulp-glue/pulp_glue/common/context.py rename to pulp-glue/src/pulp_glue/common/context.py diff --git a/pulp-glue/pulp_glue/common/exceptions.py b/pulp-glue/src/pulp_glue/common/exceptions.py similarity index 100% rename from pulp-glue/pulp_glue/common/exceptions.py rename to pulp-glue/src/pulp_glue/common/exceptions.py diff --git a/pulp-glue/pulp_glue/common/i18n.py b/pulp-glue/src/pulp_glue/common/i18n.py similarity index 100% rename from pulp-glue/pulp_glue/common/i18n.py rename to pulp-glue/src/pulp_glue/common/i18n.py diff --git a/pulp-glue/pulp_glue/common/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/common/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/common/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/common/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/common/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/common/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/common/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/common/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/common/locale/messages.pot b/pulp-glue/src/pulp_glue/common/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/common/locale/messages.pot rename to pulp-glue/src/pulp_glue/common/locale/messages.pot diff --git a/pulp-glue/pulp_glue/common/openapi.py b/pulp-glue/src/pulp_glue/common/openapi.py similarity index 100% rename from pulp-glue/pulp_glue/common/openapi.py rename to pulp-glue/src/pulp_glue/common/openapi.py diff --git a/pulp-glue/pulp_glue/common/py.typed b/pulp-glue/src/pulp_glue/common/py.typed similarity index 100% rename from pulp-glue/pulp_glue/common/py.typed rename to pulp-glue/src/pulp_glue/common/py.typed diff --git a/pulp-glue/pulp_glue/common/schema.py b/pulp-glue/src/pulp_glue/common/schema.py similarity index 100% rename from pulp-glue/pulp_glue/common/schema.py rename to pulp-glue/src/pulp_glue/common/schema.py diff --git a/pulp-glue/pulp_glue/container/__init__.py b/pulp-glue/src/pulp_glue/container/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/container/__init__.py rename to pulp-glue/src/pulp_glue/container/__init__.py diff --git a/pulp-glue/pulp_glue/container/context.py b/pulp-glue/src/pulp_glue/container/context.py similarity index 100% rename from pulp-glue/pulp_glue/container/context.py rename to pulp-glue/src/pulp_glue/container/context.py diff --git a/pulp-glue/pulp_glue/container/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/container/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/container/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/container/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/container/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/container/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/container/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/container/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/container/locale/messages.pot b/pulp-glue/src/pulp_glue/container/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/container/locale/messages.pot rename to pulp-glue/src/pulp_glue/container/locale/messages.pot diff --git a/pulp-glue/pulp_glue/container/py.typed b/pulp-glue/src/pulp_glue/container/py.typed similarity index 100% rename from pulp-glue/pulp_glue/container/py.typed rename to pulp-glue/src/pulp_glue/container/py.typed diff --git a/pulp-glue/pulp_glue/core/__init__.py b/pulp-glue/src/pulp_glue/core/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/core/__init__.py rename to pulp-glue/src/pulp_glue/core/__init__.py diff --git a/pulp-glue/pulp_glue/core/context.py b/pulp-glue/src/pulp_glue/core/context.py similarity index 100% rename from pulp-glue/pulp_glue/core/context.py rename to pulp-glue/src/pulp_glue/core/context.py diff --git a/pulp-glue/pulp_glue/core/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/core/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/core/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/core/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/core/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/core/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/core/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/core/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/core/locale/messages.pot b/pulp-glue/src/pulp_glue/core/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/core/locale/messages.pot rename to pulp-glue/src/pulp_glue/core/locale/messages.pot diff --git a/pulp-glue/pulp_glue/core/py.typed b/pulp-glue/src/pulp_glue/core/py.typed similarity index 100% rename from pulp-glue/pulp_glue/core/py.typed rename to pulp-glue/src/pulp_glue/core/py.typed diff --git a/pulp-glue/pulp_glue/file/__init__.py b/pulp-glue/src/pulp_glue/file/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/file/__init__.py rename to pulp-glue/src/pulp_glue/file/__init__.py diff --git a/pulp-glue/pulp_glue/file/context.py b/pulp-glue/src/pulp_glue/file/context.py similarity index 100% rename from pulp-glue/pulp_glue/file/context.py rename to pulp-glue/src/pulp_glue/file/context.py diff --git a/pulp-glue/pulp_glue/file/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/file/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/file/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/file/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/file/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/file/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/file/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/file/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/file/locale/messages.pot b/pulp-glue/src/pulp_glue/file/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/file/locale/messages.pot rename to pulp-glue/src/pulp_glue/file/locale/messages.pot diff --git a/pulp-glue/pulp_glue/file/py.typed b/pulp-glue/src/pulp_glue/file/py.typed similarity index 100% rename from pulp-glue/pulp_glue/file/py.typed rename to pulp-glue/src/pulp_glue/file/py.typed diff --git a/pulp-glue/pulp_glue/python/__init__.py b/pulp-glue/src/pulp_glue/python/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/python/__init__.py rename to pulp-glue/src/pulp_glue/python/__init__.py diff --git a/pulp-glue/pulp_glue/python/context.py b/pulp-glue/src/pulp_glue/python/context.py similarity index 100% rename from pulp-glue/pulp_glue/python/context.py rename to pulp-glue/src/pulp_glue/python/context.py diff --git a/pulp-glue/pulp_glue/python/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/python/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/python/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/python/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/python/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/python/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/python/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/python/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/python/locale/messages.pot b/pulp-glue/src/pulp_glue/python/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/python/locale/messages.pot rename to pulp-glue/src/pulp_glue/python/locale/messages.pot diff --git a/pulp-glue/pulp_glue/python/py.typed b/pulp-glue/src/pulp_glue/python/py.typed similarity index 100% rename from pulp-glue/pulp_glue/python/py.typed rename to pulp-glue/src/pulp_glue/python/py.typed diff --git a/pulp-glue/pulp_glue/rpm/__init__.py b/pulp-glue/src/pulp_glue/rpm/__init__.py similarity index 100% rename from pulp-glue/pulp_glue/rpm/__init__.py rename to pulp-glue/src/pulp_glue/rpm/__init__.py diff --git a/pulp-glue/pulp_glue/rpm/context.py b/pulp-glue/src/pulp_glue/rpm/context.py similarity index 100% rename from pulp-glue/pulp_glue/rpm/context.py rename to pulp-glue/src/pulp_glue/rpm/context.py diff --git a/pulp-glue/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.mo b/pulp-glue/src/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulp-glue/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.mo rename to pulp-glue/src/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.mo diff --git a/pulp-glue/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.po b/pulp-glue/src/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulp-glue/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.po rename to pulp-glue/src/pulp_glue/rpm/locale/de/LC_MESSAGES/messages.po diff --git a/pulp-glue/pulp_glue/rpm/locale/messages.pot b/pulp-glue/src/pulp_glue/rpm/locale/messages.pot similarity index 100% rename from pulp-glue/pulp_glue/rpm/locale/messages.pot rename to pulp-glue/src/pulp_glue/rpm/locale/messages.pot diff --git a/pulp-glue/pulp_glue/rpm/py.typed b/pulp-glue/src/pulp_glue/rpm/py.typed similarity index 100% rename from pulp-glue/pulp_glue/rpm/py.typed rename to pulp-glue/src/pulp_glue/rpm/py.typed diff --git a/pyproject.toml b/pyproject.toml index 6d7b55b47..94848947c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ rpm = "pulpcore.cli.rpm" [tool.setuptools.packages.find] # This section is managed by the cookiecutter templates. -where = ["."] +where = ["src"] include = ["pulpcore.cli.*", "pulp_cli", "pytest_pulp_cli"] namespaces = true @@ -67,6 +67,7 @@ namespaces = true # This section is co-managed by the cookiecutter templates. # Changes to existing keys should be preserved. app_label = "" +src_layout = true repository = "https://github.com/pulp/pulp-cli" glue = true docs = true @@ -97,19 +98,19 @@ values = [ [[tool.bumpversion.files]] # This section is managed by the cookiecutter templates. -filename = "./pulp_cli/__init__.py" +filename = "./src/pulp_cli/__init__.py" search = "__version__ = \"{current_version}\"" replace = "__version__ = \"{new_version}\"" [[tool.bumpversion.files]] # This section is managed by the cookiecutter templates. -filename = "./pulp-glue/pulp_glue/common/__init__.py" +filename = "./pulp-glue/src/pulp_glue/common/__init__.py" search = "__version__ = \"{current_version}\"" replace = "__version__ = \"{new_version}\"" [[tool.bumpversion.files]] # This section is managed by the cookiecutter templates. -filename = "./pulpcore/cli/common/__init__.py" +filename = "./src/pulpcore/cli/common/__init__.py" search = "__version__ = \"{current_version}\"" replace = "__version__ = \"{new_version}\"" @@ -229,7 +230,8 @@ markers = [ strict = true warn_unused_ignores = false show_error_codes = true -files = "pulpcore/**/*.py, tests/*.py, pulp_cli/**/*.py, pytest_pulp_cli/**/*.py" +files = "src/**/*.py, tests/*.py" +mypy_path = ["src", "pulp-glue/src"] namespace_packages = true explicit_package_bases = true @@ -242,4 +244,3 @@ module = [ "schema.*", ] ignore_missing_imports = true - diff --git a/pulp_cli/__init__.py b/src/pulp_cli/__init__.py similarity index 100% rename from pulp_cli/__init__.py rename to src/pulp_cli/__init__.py diff --git a/pulp_cli/config.py b/src/pulp_cli/config.py similarity index 100% rename from pulp_cli/config.py rename to src/pulp_cli/config.py diff --git a/pulp_cli/generic.py b/src/pulp_cli/generic.py similarity index 100% rename from pulp_cli/generic.py rename to src/pulp_cli/generic.py diff --git a/pulp_cli/py.typed b/src/pulp_cli/py.typed similarity index 100% rename from pulp_cli/py.typed rename to src/pulp_cli/py.typed diff --git a/pulpcore/cli/ansible/__init__.py b/src/pulpcore/cli/ansible/__init__.py similarity index 100% rename from pulpcore/cli/ansible/__init__.py rename to src/pulpcore/cli/ansible/__init__.py diff --git a/pulpcore/cli/ansible/content.py b/src/pulpcore/cli/ansible/content.py similarity index 100% rename from pulpcore/cli/ansible/content.py rename to src/pulpcore/cli/ansible/content.py diff --git a/pulpcore/cli/ansible/distribution.py b/src/pulpcore/cli/ansible/distribution.py similarity index 100% rename from pulpcore/cli/ansible/distribution.py rename to src/pulpcore/cli/ansible/distribution.py diff --git a/pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.mo b/src/pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.mo rename to src/pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.mo diff --git a/pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.po b/src/pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.po rename to src/pulpcore/cli/ansible/locale/de/LC_MESSAGES/messages.po diff --git a/pulpcore/cli/ansible/locale/messages.pot b/src/pulpcore/cli/ansible/locale/messages.pot similarity index 100% rename from pulpcore/cli/ansible/locale/messages.pot rename to src/pulpcore/cli/ansible/locale/messages.pot diff --git a/pulpcore/cli/ansible/py.typed b/src/pulpcore/cli/ansible/py.typed similarity index 100% rename from pulpcore/cli/ansible/py.typed rename to src/pulpcore/cli/ansible/py.typed diff --git a/pulpcore/cli/ansible/remote.py b/src/pulpcore/cli/ansible/remote.py similarity index 100% rename from pulpcore/cli/ansible/remote.py rename to src/pulpcore/cli/ansible/remote.py diff --git a/pulpcore/cli/ansible/repository.py b/src/pulpcore/cli/ansible/repository.py similarity index 100% rename from pulpcore/cli/ansible/repository.py rename to src/pulpcore/cli/ansible/repository.py diff --git a/pulpcore/cli/common/__init__.py b/src/pulpcore/cli/common/__init__.py similarity index 100% rename from pulpcore/cli/common/__init__.py rename to src/pulpcore/cli/common/__init__.py diff --git a/pulpcore/cli/common/acs.py b/src/pulpcore/cli/common/acs.py similarity index 100% rename from pulpcore/cli/common/acs.py rename to src/pulpcore/cli/common/acs.py diff --git a/pulpcore/cli/common/debug.py b/src/pulpcore/cli/common/debug.py similarity index 100% rename from pulpcore/cli/common/debug.py rename to src/pulpcore/cli/common/debug.py diff --git a/pulpcore/cli/common/generic.py b/src/pulpcore/cli/common/generic.py similarity index 100% rename from pulpcore/cli/common/generic.py rename to src/pulpcore/cli/common/generic.py diff --git a/pulpcore/cli/common/i18n.py b/src/pulpcore/cli/common/i18n.py similarity index 100% rename from pulpcore/cli/common/i18n.py rename to src/pulpcore/cli/common/i18n.py diff --git a/pulpcore/cli/common/locale/de/LC_MESSAGES/messages.mo b/src/pulpcore/cli/common/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulpcore/cli/common/locale/de/LC_MESSAGES/messages.mo rename to src/pulpcore/cli/common/locale/de/LC_MESSAGES/messages.mo diff --git a/pulpcore/cli/common/locale/de/LC_MESSAGES/messages.po b/src/pulpcore/cli/common/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulpcore/cli/common/locale/de/LC_MESSAGES/messages.po rename to src/pulpcore/cli/common/locale/de/LC_MESSAGES/messages.po diff --git a/pulpcore/cli/common/locale/messages.pot b/src/pulpcore/cli/common/locale/messages.pot similarity index 100% rename from pulpcore/cli/common/locale/messages.pot rename to src/pulpcore/cli/common/locale/messages.pot diff --git a/pulpcore/cli/common/py.typed b/src/pulpcore/cli/common/py.typed similarity index 100% rename from pulpcore/cli/common/py.typed rename to src/pulpcore/cli/common/py.typed diff --git a/pulpcore/cli/container/__init__.py b/src/pulpcore/cli/container/__init__.py similarity index 100% rename from pulpcore/cli/container/__init__.py rename to src/pulpcore/cli/container/__init__.py diff --git a/pulpcore/cli/container/content.py b/src/pulpcore/cli/container/content.py similarity index 100% rename from pulpcore/cli/container/content.py rename to src/pulpcore/cli/container/content.py diff --git a/pulpcore/cli/container/distribution.py b/src/pulpcore/cli/container/distribution.py similarity index 100% rename from pulpcore/cli/container/distribution.py rename to src/pulpcore/cli/container/distribution.py diff --git a/pulpcore/cli/container/locale/de/LC_MESSAGES/messages.mo b/src/pulpcore/cli/container/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulpcore/cli/container/locale/de/LC_MESSAGES/messages.mo rename to src/pulpcore/cli/container/locale/de/LC_MESSAGES/messages.mo diff --git a/pulpcore/cli/container/locale/de/LC_MESSAGES/messages.po b/src/pulpcore/cli/container/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulpcore/cli/container/locale/de/LC_MESSAGES/messages.po rename to src/pulpcore/cli/container/locale/de/LC_MESSAGES/messages.po diff --git a/pulpcore/cli/container/locale/messages.pot b/src/pulpcore/cli/container/locale/messages.pot similarity index 100% rename from pulpcore/cli/container/locale/messages.pot rename to src/pulpcore/cli/container/locale/messages.pot diff --git a/pulpcore/cli/container/namespace.py b/src/pulpcore/cli/container/namespace.py similarity index 100% rename from pulpcore/cli/container/namespace.py rename to src/pulpcore/cli/container/namespace.py diff --git a/pulpcore/cli/container/py.typed b/src/pulpcore/cli/container/py.typed similarity index 100% rename from pulpcore/cli/container/py.typed rename to src/pulpcore/cli/container/py.typed diff --git a/pulpcore/cli/container/remote.py b/src/pulpcore/cli/container/remote.py similarity index 100% rename from pulpcore/cli/container/remote.py rename to src/pulpcore/cli/container/remote.py diff --git a/pulpcore/cli/container/repository.py b/src/pulpcore/cli/container/repository.py similarity index 100% rename from pulpcore/cli/container/repository.py rename to src/pulpcore/cli/container/repository.py diff --git a/pulpcore/cli/core/__init__.py b/src/pulpcore/cli/core/__init__.py similarity index 100% rename from pulpcore/cli/core/__init__.py rename to src/pulpcore/cli/core/__init__.py diff --git a/pulpcore/cli/core/access_policy.py b/src/pulpcore/cli/core/access_policy.py similarity index 100% rename from pulpcore/cli/core/access_policy.py rename to src/pulpcore/cli/core/access_policy.py diff --git a/pulpcore/cli/core/artifact.py b/src/pulpcore/cli/core/artifact.py similarity index 100% rename from pulpcore/cli/core/artifact.py rename to src/pulpcore/cli/core/artifact.py diff --git a/pulpcore/cli/core/content.py b/src/pulpcore/cli/core/content.py similarity index 100% rename from pulpcore/cli/core/content.py rename to src/pulpcore/cli/core/content.py diff --git a/pulpcore/cli/core/content_guard.py b/src/pulpcore/cli/core/content_guard.py similarity index 100% rename from pulpcore/cli/core/content_guard.py rename to src/pulpcore/cli/core/content_guard.py diff --git a/pulpcore/cli/core/distribution.py b/src/pulpcore/cli/core/distribution.py similarity index 100% rename from pulpcore/cli/core/distribution.py rename to src/pulpcore/cli/core/distribution.py diff --git a/pulpcore/cli/core/domain.py b/src/pulpcore/cli/core/domain.py similarity index 100% rename from pulpcore/cli/core/domain.py rename to src/pulpcore/cli/core/domain.py diff --git a/pulpcore/cli/core/export.py b/src/pulpcore/cli/core/export.py similarity index 100% rename from pulpcore/cli/core/export.py rename to src/pulpcore/cli/core/export.py diff --git a/pulpcore/cli/core/exporter.py b/src/pulpcore/cli/core/exporter.py similarity index 100% rename from pulpcore/cli/core/exporter.py rename to src/pulpcore/cli/core/exporter.py diff --git a/pulpcore/cli/core/generic.py b/src/pulpcore/cli/core/generic.py similarity index 100% rename from pulpcore/cli/core/generic.py rename to src/pulpcore/cli/core/generic.py diff --git a/pulpcore/cli/core/group.py b/src/pulpcore/cli/core/group.py similarity index 100% rename from pulpcore/cli/core/group.py rename to src/pulpcore/cli/core/group.py diff --git a/pulpcore/cli/core/importer.py b/src/pulpcore/cli/core/importer.py similarity index 100% rename from pulpcore/cli/core/importer.py rename to src/pulpcore/cli/core/importer.py diff --git a/pulpcore/cli/core/locale/de/LC_MESSAGES/messages.mo b/src/pulpcore/cli/core/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulpcore/cli/core/locale/de/LC_MESSAGES/messages.mo rename to src/pulpcore/cli/core/locale/de/LC_MESSAGES/messages.mo diff --git a/pulpcore/cli/core/locale/de/LC_MESSAGES/messages.po b/src/pulpcore/cli/core/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulpcore/cli/core/locale/de/LC_MESSAGES/messages.po rename to src/pulpcore/cli/core/locale/de/LC_MESSAGES/messages.po diff --git a/pulpcore/cli/core/locale/messages.pot b/src/pulpcore/cli/core/locale/messages.pot similarity index 100% rename from pulpcore/cli/core/locale/messages.pot rename to src/pulpcore/cli/core/locale/messages.pot diff --git a/pulpcore/cli/core/orphan.py b/src/pulpcore/cli/core/orphan.py similarity index 100% rename from pulpcore/cli/core/orphan.py rename to src/pulpcore/cli/core/orphan.py diff --git a/pulpcore/cli/core/publication.py b/src/pulpcore/cli/core/publication.py similarity index 100% rename from pulpcore/cli/core/publication.py rename to src/pulpcore/cli/core/publication.py diff --git a/pulpcore/cli/core/py.typed b/src/pulpcore/cli/core/py.typed similarity index 100% rename from pulpcore/cli/core/py.typed rename to src/pulpcore/cli/core/py.typed diff --git a/pulpcore/cli/core/remote.py b/src/pulpcore/cli/core/remote.py similarity index 100% rename from pulpcore/cli/core/remote.py rename to src/pulpcore/cli/core/remote.py diff --git a/pulpcore/cli/core/repository.py b/src/pulpcore/cli/core/repository.py similarity index 100% rename from pulpcore/cli/core/repository.py rename to src/pulpcore/cli/core/repository.py diff --git a/pulpcore/cli/core/role.py b/src/pulpcore/cli/core/role.py similarity index 100% rename from pulpcore/cli/core/role.py rename to src/pulpcore/cli/core/role.py diff --git a/pulpcore/cli/core/show.py b/src/pulpcore/cli/core/show.py similarity index 100% rename from pulpcore/cli/core/show.py rename to src/pulpcore/cli/core/show.py diff --git a/pulpcore/cli/core/signing_service.py b/src/pulpcore/cli/core/signing_service.py similarity index 100% rename from pulpcore/cli/core/signing_service.py rename to src/pulpcore/cli/core/signing_service.py diff --git a/pulpcore/cli/core/status.py b/src/pulpcore/cli/core/status.py similarity index 100% rename from pulpcore/cli/core/status.py rename to src/pulpcore/cli/core/status.py diff --git a/pulpcore/cli/core/task.py b/src/pulpcore/cli/core/task.py similarity index 100% rename from pulpcore/cli/core/task.py rename to src/pulpcore/cli/core/task.py diff --git a/pulpcore/cli/core/task_group.py b/src/pulpcore/cli/core/task_group.py similarity index 100% rename from pulpcore/cli/core/task_group.py rename to src/pulpcore/cli/core/task_group.py diff --git a/pulpcore/cli/core/upload.py b/src/pulpcore/cli/core/upload.py similarity index 100% rename from pulpcore/cli/core/upload.py rename to src/pulpcore/cli/core/upload.py diff --git a/pulpcore/cli/core/upstream_pulp.py b/src/pulpcore/cli/core/upstream_pulp.py similarity index 100% rename from pulpcore/cli/core/upstream_pulp.py rename to src/pulpcore/cli/core/upstream_pulp.py diff --git a/pulpcore/cli/core/user.py b/src/pulpcore/cli/core/user.py similarity index 100% rename from pulpcore/cli/core/user.py rename to src/pulpcore/cli/core/user.py diff --git a/pulpcore/cli/core/vulnerability_report.py b/src/pulpcore/cli/core/vulnerability_report.py similarity index 100% rename from pulpcore/cli/core/vulnerability_report.py rename to src/pulpcore/cli/core/vulnerability_report.py diff --git a/pulpcore/cli/core/worker.py b/src/pulpcore/cli/core/worker.py similarity index 100% rename from pulpcore/cli/core/worker.py rename to src/pulpcore/cli/core/worker.py diff --git a/pulpcore/cli/file/__init__.py b/src/pulpcore/cli/file/__init__.py similarity index 100% rename from pulpcore/cli/file/__init__.py rename to src/pulpcore/cli/file/__init__.py diff --git a/pulpcore/cli/file/content.py b/src/pulpcore/cli/file/content.py similarity index 100% rename from pulpcore/cli/file/content.py rename to src/pulpcore/cli/file/content.py diff --git a/pulpcore/cli/file/distribution.py b/src/pulpcore/cli/file/distribution.py similarity index 100% rename from pulpcore/cli/file/distribution.py rename to src/pulpcore/cli/file/distribution.py diff --git a/pulpcore/cli/file/locale/de/LC_MESSAGES/messages.mo b/src/pulpcore/cli/file/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulpcore/cli/file/locale/de/LC_MESSAGES/messages.mo rename to src/pulpcore/cli/file/locale/de/LC_MESSAGES/messages.mo diff --git a/pulpcore/cli/file/locale/de/LC_MESSAGES/messages.po b/src/pulpcore/cli/file/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulpcore/cli/file/locale/de/LC_MESSAGES/messages.po rename to src/pulpcore/cli/file/locale/de/LC_MESSAGES/messages.po diff --git a/pulpcore/cli/file/locale/messages.pot b/src/pulpcore/cli/file/locale/messages.pot similarity index 100% rename from pulpcore/cli/file/locale/messages.pot rename to src/pulpcore/cli/file/locale/messages.pot diff --git a/pulpcore/cli/file/publication.py b/src/pulpcore/cli/file/publication.py similarity index 100% rename from pulpcore/cli/file/publication.py rename to src/pulpcore/cli/file/publication.py diff --git a/pulpcore/cli/file/py.typed b/src/pulpcore/cli/file/py.typed similarity index 100% rename from pulpcore/cli/file/py.typed rename to src/pulpcore/cli/file/py.typed diff --git a/pulpcore/cli/file/remote.py b/src/pulpcore/cli/file/remote.py similarity index 100% rename from pulpcore/cli/file/remote.py rename to src/pulpcore/cli/file/remote.py diff --git a/pulpcore/cli/file/repository.py b/src/pulpcore/cli/file/repository.py similarity index 100% rename from pulpcore/cli/file/repository.py rename to src/pulpcore/cli/file/repository.py diff --git a/pulpcore/cli/python/__init__.py b/src/pulpcore/cli/python/__init__.py similarity index 100% rename from pulpcore/cli/python/__init__.py rename to src/pulpcore/cli/python/__init__.py diff --git a/pulpcore/cli/python/content.py b/src/pulpcore/cli/python/content.py similarity index 100% rename from pulpcore/cli/python/content.py rename to src/pulpcore/cli/python/content.py diff --git a/pulpcore/cli/python/distribution.py b/src/pulpcore/cli/python/distribution.py similarity index 100% rename from pulpcore/cli/python/distribution.py rename to src/pulpcore/cli/python/distribution.py diff --git a/pulpcore/cli/python/locale/de/LC_MESSAGES/messages.mo b/src/pulpcore/cli/python/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulpcore/cli/python/locale/de/LC_MESSAGES/messages.mo rename to src/pulpcore/cli/python/locale/de/LC_MESSAGES/messages.mo diff --git a/pulpcore/cli/python/locale/de/LC_MESSAGES/messages.po b/src/pulpcore/cli/python/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulpcore/cli/python/locale/de/LC_MESSAGES/messages.po rename to src/pulpcore/cli/python/locale/de/LC_MESSAGES/messages.po diff --git a/pulpcore/cli/python/locale/messages.pot b/src/pulpcore/cli/python/locale/messages.pot similarity index 100% rename from pulpcore/cli/python/locale/messages.pot rename to src/pulpcore/cli/python/locale/messages.pot diff --git a/pulpcore/cli/python/publication.py b/src/pulpcore/cli/python/publication.py similarity index 100% rename from pulpcore/cli/python/publication.py rename to src/pulpcore/cli/python/publication.py diff --git a/pulpcore/cli/python/py.typed b/src/pulpcore/cli/python/py.typed similarity index 100% rename from pulpcore/cli/python/py.typed rename to src/pulpcore/cli/python/py.typed diff --git a/pulpcore/cli/python/remote.py b/src/pulpcore/cli/python/remote.py similarity index 100% rename from pulpcore/cli/python/remote.py rename to src/pulpcore/cli/python/remote.py diff --git a/pulpcore/cli/python/repository.py b/src/pulpcore/cli/python/repository.py similarity index 100% rename from pulpcore/cli/python/repository.py rename to src/pulpcore/cli/python/repository.py diff --git a/pulpcore/cli/rpm/__init__.py b/src/pulpcore/cli/rpm/__init__.py similarity index 100% rename from pulpcore/cli/rpm/__init__.py rename to src/pulpcore/cli/rpm/__init__.py diff --git a/pulpcore/cli/rpm/common.py b/src/pulpcore/cli/rpm/common.py similarity index 100% rename from pulpcore/cli/rpm/common.py rename to src/pulpcore/cli/rpm/common.py diff --git a/pulpcore/cli/rpm/comps.py b/src/pulpcore/cli/rpm/comps.py similarity index 100% rename from pulpcore/cli/rpm/comps.py rename to src/pulpcore/cli/rpm/comps.py diff --git a/pulpcore/cli/rpm/content.py b/src/pulpcore/cli/rpm/content.py similarity index 100% rename from pulpcore/cli/rpm/content.py rename to src/pulpcore/cli/rpm/content.py diff --git a/pulpcore/cli/rpm/copy.py b/src/pulpcore/cli/rpm/copy.py similarity index 100% rename from pulpcore/cli/rpm/copy.py rename to src/pulpcore/cli/rpm/copy.py diff --git a/pulpcore/cli/rpm/distribution.py b/src/pulpcore/cli/rpm/distribution.py similarity index 100% rename from pulpcore/cli/rpm/distribution.py rename to src/pulpcore/cli/rpm/distribution.py diff --git a/pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.mo b/src/pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.mo similarity index 100% rename from pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.mo rename to src/pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.mo diff --git a/pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.po b/src/pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.po similarity index 100% rename from pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.po rename to src/pulpcore/cli/rpm/locale/de/LC_MESSAGES/messages.po diff --git a/pulpcore/cli/rpm/locale/messages.pot b/src/pulpcore/cli/rpm/locale/messages.pot similarity index 100% rename from pulpcore/cli/rpm/locale/messages.pot rename to src/pulpcore/cli/rpm/locale/messages.pot diff --git a/pulpcore/cli/rpm/prune.py b/src/pulpcore/cli/rpm/prune.py similarity index 100% rename from pulpcore/cli/rpm/prune.py rename to src/pulpcore/cli/rpm/prune.py diff --git a/pulpcore/cli/rpm/publication.py b/src/pulpcore/cli/rpm/publication.py similarity index 100% rename from pulpcore/cli/rpm/publication.py rename to src/pulpcore/cli/rpm/publication.py diff --git a/pulpcore/cli/rpm/py.typed b/src/pulpcore/cli/rpm/py.typed similarity index 100% rename from pulpcore/cli/rpm/py.typed rename to src/pulpcore/cli/rpm/py.typed diff --git a/pulpcore/cli/rpm/remote.py b/src/pulpcore/cli/rpm/remote.py similarity index 100% rename from pulpcore/cli/rpm/remote.py rename to src/pulpcore/cli/rpm/remote.py diff --git a/pulpcore/cli/rpm/repository.py b/src/pulpcore/cli/rpm/repository.py similarity index 100% rename from pulpcore/cli/rpm/repository.py rename to src/pulpcore/cli/rpm/repository.py diff --git a/pytest_pulp_cli/__init__.py b/src/pytest_pulp_cli/__init__.py similarity index 100% rename from pytest_pulp_cli/__init__.py rename to src/pytest_pulp_cli/__init__.py