diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9bba4d8..f76317b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.1.3' + rev: 'v0.2.0' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] exclude: test.* - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks @@ -36,14 +36,14 @@ repos: - id: fix-encoding-pragma args: ["--remove"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.8.0 hooks: - id: mypy exclude: test.* args: [--no-strict-optional, --ignore-missing-imports] additional_dependencies: ["pydantic", "toml", "types-all"] - repo: https://github.com/jsh9/pydoclint - rev: 0.3.8 + rev: 0.3.9 hooks: - id: pydoclint args: diff --git a/cookie_composer/__init__.py b/cookie_composer/__init__.py index 6cf4a16..0a71d3b 100644 --- a/cookie_composer/__init__.py +++ b/cookie_composer/__init__.py @@ -1,2 +1,3 @@ """The Cookiecutter Composer.""" + __version__: str = "0.12.0" diff --git a/cookie_composer/authentication.py b/cookie_composer/authentication.py index 1305efa..53adc8e 100644 --- a/cookie_composer/authentication.py +++ b/cookie_composer/authentication.py @@ -1,4 +1,5 @@ """OAuth2 authentication to access protected resources.""" + import json from pathlib import Path from typing import Optional diff --git a/cookie_composer/cc_overrides.py b/cookie_composer/cc_overrides.py index b6ac862..e18a743 100644 --- a/cookie_composer/cc_overrides.py +++ b/cookie_composer/cc_overrides.py @@ -1,4 +1,5 @@ """This overrides the default cookie cutter environment.""" + import json from typing import Any, List, MutableMapping, Optional diff --git a/cookie_composer/cli.py b/cookie_composer/cli.py index feda3c1..87b9cfd 100644 --- a/cookie_composer/cli.py +++ b/cookie_composer/cli.py @@ -1,4 +1,5 @@ """Command line setup.""" + import logging from collections import OrderedDict from pathlib import Path diff --git a/cookie_composer/commands/add.py b/cookie_composer/commands/add.py index 9ac59f1..1853786 100644 --- a/cookie_composer/commands/add.py +++ b/cookie_composer/commands/add.py @@ -1,4 +1,5 @@ """The implementation of the add command.""" + import logging from pathlib import Path from typing import Any, MutableMapping, Optional diff --git a/cookie_composer/commands/authn.py b/cookie_composer/commands/authn.py index 663dcb1..5012faf 100644 --- a/cookie_composer/commands/authn.py +++ b/cookie_composer/commands/authn.py @@ -1,4 +1,5 @@ """Authentication subcommands.""" + import sys import rich_click as click diff --git a/cookie_composer/commands/link.py b/cookie_composer/commands/link.py index f73a985..5ea1dc1 100644 --- a/cookie_composer/commands/link.py +++ b/cookie_composer/commands/link.py @@ -1,4 +1,5 @@ """The implementation of the link command.""" + from pathlib import Path from typing import Any, MutableMapping, Optional diff --git a/cookie_composer/commands/update.py b/cookie_composer/commands/update.py index 8e1bc05..847268c 100644 --- a/cookie_composer/commands/update.py +++ b/cookie_composer/commands/update.py @@ -1,4 +1,5 @@ """The implementation of the update command.""" + from pathlib import Path from tempfile import TemporaryDirectory from typing import List, Optional diff --git a/cookie_composer/composition.py b/cookie_composer/composition.py index 3cec291..4aa3216 100644 --- a/cookie_composer/composition.py +++ b/cookie_composer/composition.py @@ -1,4 +1,5 @@ """Project configuration and options.""" + import logging from typing import Any, Dict, List, Optional diff --git a/cookie_composer/data_merge.py b/cookie_composer/data_merge.py index f480c13..1203828 100644 --- a/cookie_composer/data_merge.py +++ b/cookie_composer/data_merge.py @@ -1,4 +1,5 @@ """Tools for merging data.""" + import copy import logging from collections import ChainMap, OrderedDict diff --git a/cookie_composer/diff.py b/cookie_composer/diff.py index f9ab04b..8517f52 100644 --- a/cookie_composer/diff.py +++ b/cookie_composer/diff.py @@ -3,6 +3,7 @@ Nabbed from Cruft: https://github.com/cruft/cruft/ """ + from pathlib import Path from re import sub from subprocess import PIPE, run # nosec diff --git a/cookie_composer/exceptions.py b/cookie_composer/exceptions.py index 6e9d4e0..cc25f87 100644 --- a/cookie_composer/exceptions.py +++ b/cookie_composer/exceptions.py @@ -1,4 +1,5 @@ """Exceptions raised when bad things happen.""" + from typing import Optional from click.exceptions import UsageError diff --git a/cookie_composer/git_commands.py b/cookie_composer/git_commands.py index 444f35a..34ef7a1 100644 --- a/cookie_composer/git_commands.py +++ b/cookie_composer/git_commands.py @@ -1,4 +1,5 @@ """Functions for using git.""" + import logging import shutil import subprocess diff --git a/cookie_composer/io.py b/cookie_composer/io.py index 89c5c4a..1c3a1bd 100644 --- a/cookie_composer/io.py +++ b/cookie_composer/io.py @@ -1,4 +1,5 @@ """Functions for handling input/output operations.""" + import copy from pathlib import Path from typing import Any, List, MutableMapping, Optional, Union diff --git a/cookie_composer/matching.py b/cookie_composer/matching.py index 133ee8f..3b894b7 100644 --- a/cookie_composer/matching.py +++ b/cookie_composer/matching.py @@ -1,4 +1,5 @@ """Matching files and patterns.""" + from fnmatch import fnmatch from pathlib import Path from typing import List, Union diff --git a/cookie_composer/merge_files/__init__.py b/cookie_composer/merge_files/__init__.py index 552d1b2..21ceaec 100644 --- a/cookie_composer/merge_files/__init__.py +++ b/cookie_composer/merge_files/__init__.py @@ -22,6 +22,7 @@ def merge_generic_files(origin: Path, destination: Path, merge_strategy: str): The function must wrap any errors into a :py:exc:`~cookie_composer.exceptions.MergeError` and raise it. """ + from pathlib import Path from typing import Callable, Dict diff --git a/cookie_composer/merge_files/ini_file.py b/cookie_composer/merge_files/ini_file.py index a00e5e1..b488a8b 100644 --- a/cookie_composer/merge_files/ini_file.py +++ b/cookie_composer/merge_files/ini_file.py @@ -1,4 +1,5 @@ """Merge two .ini files into one.""" + import configparser from collections import defaultdict from pathlib import Path diff --git a/cookie_composer/merge_files/json_file.py b/cookie_composer/merge_files/json_file.py index 5a28236..ac9bc4a 100644 --- a/cookie_composer/merge_files/json_file.py +++ b/cookie_composer/merge_files/json_file.py @@ -1,4 +1,5 @@ """Merge two json files into one.""" + from pathlib import Path from typing import Any diff --git a/cookie_composer/merge_files/toml_file.py b/cookie_composer/merge_files/toml_file.py index 02dd983..34230a4 100644 --- a/cookie_composer/merge_files/toml_file.py +++ b/cookie_composer/merge_files/toml_file.py @@ -1,4 +1,5 @@ """Merge two toml files into one.""" + from pathlib import Path import toml diff --git a/cookie_composer/templates/git_repo.py b/cookie_composer/templates/git_repo.py index 6c669e6..12ec6e6 100644 --- a/cookie_composer/templates/git_repo.py +++ b/cookie_composer/templates/git_repo.py @@ -1,4 +1,5 @@ """Utility functions for handling and fetching repo archives in git format.""" + import logging import shutil from pathlib import Path @@ -37,8 +38,9 @@ def template_repo_from_git( """ if locality == Locality.LOCAL: ensure_clean = checkout is not None - logger.debug("Getting local repo %s", git_uri) - repo = get_repo(git_uri, search_parent_directories=True, ensure_clean=ensure_clean) + local_path = cache_dir.joinpath(git_uri).expanduser().resolve() + logger.debug("Getting local repo %s", local_path) + repo = get_repo(local_path, search_parent_directories=True, ensure_clean=ensure_clean) else: repo = get_cached_remote(git_uri, cache_dir, checkout) diff --git a/cookie_composer/templates/source.py b/cookie_composer/templates/source.py index 11670fe..a271e53 100644 --- a/cookie_composer/templates/source.py +++ b/cookie_composer/templates/source.py @@ -1,4 +1,5 @@ """Entry point for cookiecutter templates.""" + from pathlib import Path from typing import Optional, Tuple from urllib.parse import urlparse diff --git a/cookie_composer/templates/types.py b/cookie_composer/templates/types.py index f8d102c..0f5ce9d 100644 --- a/cookie_composer/templates/types.py +++ b/cookie_composer/templates/types.py @@ -3,6 +3,7 @@ Templates are a representation of source templates used to generate projects. """ + import json import shutil import tempfile diff --git a/cookie_composer/templates/zipfile_repo.py b/cookie_composer/templates/zipfile_repo.py index 6b6e530..411b935 100644 --- a/cookie_composer/templates/zipfile_repo.py +++ b/cookie_composer/templates/zipfile_repo.py @@ -1,4 +1,5 @@ """Utility functions for handling and fetching repo archives in zip format.""" + import os import tempfile from pathlib import Path diff --git a/cookie_composer/utils.py b/cookie_composer/utils.py index b5be08b..bfdd933 100644 --- a/cookie_composer/utils.py +++ b/cookie_composer/utils.py @@ -1,4 +1,5 @@ """Utilities not easily categorized.""" + import os import stat from contextlib import contextmanager diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.authentication.rst b/docsrc/apidocs/cookie_composer/cookie_composer.authentication.rst new file mode 100644 index 0000000..171bbb0 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.authentication.rst @@ -0,0 +1,61 @@ +:py:mod:`cookie_composer.authentication` +======================================== + +.. py:module:: cookie_composer.authentication + +.. autodoc2-docstring:: cookie_composer.authentication + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`get_hosts_file ` + - .. autodoc2-docstring:: cookie_composer.authentication.get_hosts_file + :summary: + * - :py:obj:`login_to_svc ` + - .. autodoc2-docstring:: cookie_composer.authentication.login_to_svc + :summary: + * - :py:obj:`get_cached_token ` + - .. autodoc2-docstring:: cookie_composer.authentication.get_cached_token + :summary: + * - :py:obj:`add_auth_to_url ` + - .. autodoc2-docstring:: cookie_composer.authentication.add_auth_to_url + :summary: + * - :py:obj:`github_auth_device ` + - .. autodoc2-docstring:: cookie_composer.authentication.github_auth_device + :summary: + +API +~~~ + +.. py:function:: get_hosts_file() -> pathlib.Path + :canonical: cookie_composer.authentication.get_hosts_file + + .. autodoc2-docstring:: cookie_composer.authentication.get_hosts_file + +.. py:function:: login_to_svc(service: typing.Optional[str] = None, protocol: typing.Optional[str] = None, scopes: typing.Optional[str] = None, token: typing.Optional[str] = None) -> str + :canonical: cookie_composer.authentication.login_to_svc + + .. autodoc2-docstring:: cookie_composer.authentication.login_to_svc + +.. py:function:: get_cached_token(account_name: str) -> typing.Optional[str] + :canonical: cookie_composer.authentication.get_cached_token + + .. autodoc2-docstring:: cookie_composer.authentication.get_cached_token + +.. py:function:: add_auth_to_url(url: str) -> str + :canonical: cookie_composer.authentication.add_auth_to_url + + .. autodoc2-docstring:: cookie_composer.authentication.add_auth_to_url + +.. py:function:: github_auth_device(n_polls: int = 9999) -> typing.Optional[str] + :canonical: cookie_composer.authentication.github_auth_device + + .. autodoc2-docstring:: cookie_composer.authentication.github_auth_device diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.cc_overrides.rst b/docsrc/apidocs/cookie_composer/cookie_composer.cc_overrides.rst new file mode 100644 index 0000000..034d8e0 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.cc_overrides.rst @@ -0,0 +1,102 @@ +:py:mod:`cookie_composer.cc_overrides` +====================================== + +.. py:module:: cookie_composer.cc_overrides + +.. autodoc2-docstring:: cookie_composer.cc_overrides + :allowtitles: + +Module Contents +--------------- + +Classes +~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`JsonifyContextExtension ` + - .. autodoc2-docstring:: cookie_composer.cc_overrides.JsonifyContextExtension + :summary: + * - :py:obj:`CustomStrictEnvironment ` + - .. autodoc2-docstring:: cookie_composer.cc_overrides.CustomStrictEnvironment + :summary: + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`jsonify_context ` + - .. autodoc2-docstring:: cookie_composer.cc_overrides.jsonify_context + :summary: + * - :py:obj:`update_extensions ` + - .. autodoc2-docstring:: cookie_composer.cc_overrides.update_extensions + :summary: + * - :py:obj:`prompt_for_config ` + - .. autodoc2-docstring:: cookie_composer.cc_overrides.prompt_for_config + :summary: + * - :py:obj:`_render_dicts ` + - .. autodoc2-docstring:: cookie_composer.cc_overrides._render_dicts + :summary: + * - :py:obj:`_render_simple ` + - .. autodoc2-docstring:: cookie_composer.cc_overrides._render_simple + :summary: + +API +~~~ + +.. py:function:: jsonify_context(value: typing.Any) -> typing.MutableMapping + :canonical: cookie_composer.cc_overrides.jsonify_context + + .. autodoc2-docstring:: cookie_composer.cc_overrides.jsonify_context + +.. py:class:: JsonifyContextExtension(environment: jinja2.Environment) + :canonical: cookie_composer.cc_overrides.JsonifyContextExtension + + Bases: :py:obj:`jinja2.ext.Extension` + + .. autodoc2-docstring:: cookie_composer.cc_overrides.JsonifyContextExtension + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.cc_overrides.JsonifyContextExtension.__init__ + +.. py:class:: CustomStrictEnvironment(**kwargs) + :canonical: cookie_composer.cc_overrides.CustomStrictEnvironment + + Bases: :py:obj:`cookiecutter.environment.StrictEnvironment` + + .. autodoc2-docstring:: cookie_composer.cc_overrides.CustomStrictEnvironment + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.cc_overrides.CustomStrictEnvironment.__init__ + + .. py:method:: _read_extensions(context: typing.MutableMapping[str, typing.Any]) -> typing.List[str] + :canonical: cookie_composer.cc_overrides.CustomStrictEnvironment._read_extensions + + .. autodoc2-docstring:: cookie_composer.cc_overrides.CustomStrictEnvironment._read_extensions + +.. py:function:: update_extensions(existing_config: typing.MutableMapping[str, typing.Any], prompts: typing.MutableMapping[str, typing.Any]) -> typing.List[str] + :canonical: cookie_composer.cc_overrides.update_extensions + + .. autodoc2-docstring:: cookie_composer.cc_overrides.update_extensions + +.. py:function:: prompt_for_config(prompts: dict, aggregated_context: cookie_composer.data_merge.Context, layer_context: typing.Optional[typing.MutableMapping[str, typing.Any]] = None, no_input: bool = False) -> typing.MutableMapping[str, typing.Any] + :canonical: cookie_composer.cc_overrides.prompt_for_config + + .. autodoc2-docstring:: cookie_composer.cc_overrides.prompt_for_config + +.. py:function:: _render_dicts(context: typing.MutableMapping, env: jinja2.Environment, no_input: bool, prompts: dict) -> None + :canonical: cookie_composer.cc_overrides._render_dicts + + .. autodoc2-docstring:: cookie_composer.cc_overrides._render_dicts + +.. py:function:: _render_simple(context: typing.MutableMapping, context_prompts: dict, env: jinja2.Environment, no_input: bool, prompts: dict) -> None + :canonical: cookie_composer.cc_overrides._render_simple + + .. autodoc2-docstring:: cookie_composer.cc_overrides._render_simple diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.cli.rst b/docsrc/apidocs/cookie_composer/cookie_composer.cli.rst new file mode 100644 index 0000000..0916d62 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.cli.rst @@ -0,0 +1,86 @@ +:py:mod:`cookie_composer.cli` +============================= + +.. py:module:: cookie_composer.cli + +.. autodoc2-docstring:: cookie_composer.cli + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`cli ` + - .. autodoc2-docstring:: cookie_composer.cli.cli + :summary: + * - :py:obj:`validate_context_params ` + - .. autodoc2-docstring:: cookie_composer.cli.validate_context_params + :summary: + * - :py:obj:`create ` + - .. autodoc2-docstring:: cookie_composer.cli.create + :summary: + * - :py:obj:`add ` + - .. autodoc2-docstring:: cookie_composer.cli.add + :summary: + * - :py:obj:`update ` + - .. autodoc2-docstring:: cookie_composer.cli.update + :summary: + * - :py:obj:`link ` + - .. autodoc2-docstring:: cookie_composer.cli.link + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.cli.logger + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.cli.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.cli.logger + +.. py:function:: cli() -> None + :canonical: cookie_composer.cli.cli + + .. autodoc2-docstring:: cookie_composer.cli.cli + +.. py:function:: validate_context_params(ctx: typing.Any, param: typing.Any, value: list) -> typing.Optional[collections.OrderedDict] + :canonical: cookie_composer.cli.validate_context_params + + .. autodoc2-docstring:: cookie_composer.cli.validate_context_params + +.. py:function:: create(no_input: bool, checkout: str, directory: str, overwrite_if_exists: bool, skip_if_file_exists: bool, default_config: bool, destination: pathlib.Path, accept_hooks: str, path_or_url: str, context_params: typing.Optional[typing.MutableMapping[str, typing.Any]] = None) -> None + :canonical: cookie_composer.cli.create + + .. autodoc2-docstring:: cookie_composer.cli.create + +.. py:function:: add(no_input: bool, checkout: str, directory: str, overwrite_if_exists: bool, skip_if_file_exists: bool, default_config: bool, destination: pathlib.Path, accept_hooks: str, path_or_url: str, context_params: typing.Optional[typing.MutableMapping[str, typing.Any]] = None) -> None + :canonical: cookie_composer.cli.add + + .. autodoc2-docstring:: cookie_composer.cli.add + +.. py:function:: update(no_input: bool, destination: pathlib.Path, context_params: typing.Optional[collections.OrderedDict] = None) -> None + :canonical: cookie_composer.cli.update + + .. autodoc2-docstring:: cookie_composer.cli.update + +.. py:function:: link(no_input: bool, checkout: str, directory: str, overwrite_if_exists: bool, skip_if_file_exists: bool, default_config: bool, destination: typing.Optional[pathlib.Path], path_or_url: str, context_params: typing.Optional[typing.MutableMapping[str, typing.Any]] = None) -> None + :canonical: cookie_composer.cli.link + + .. autodoc2-docstring:: cookie_composer.cli.link diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.commands.add.rst b/docsrc/apidocs/cookie_composer/cookie_composer.commands.add.rst new file mode 100644 index 0000000..c26524f --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.commands.add.rst @@ -0,0 +1,46 @@ +:py:mod:`cookie_composer.commands.add` +====================================== + +.. py:module:: cookie_composer.commands.add + +.. autodoc2-docstring:: cookie_composer.commands.add + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`add_cmd ` + - .. autodoc2-docstring:: cookie_composer.commands.add.add_cmd + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.commands.add.logger + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.commands.add.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.commands.add.logger + +.. py:function:: add_cmd(path_or_url: str, destination_dir: typing.Optional[pathlib.Path] = None, no_input: bool = False, checkout: typing.Optional[str] = None, directory: typing.Optional[str] = None, overwrite_if_exists: bool = False, skip_if_file_exists: bool = False, default_config: bool = False, accept_hooks: str = 'all', initial_context: typing.Optional[typing.MutableMapping[str, typing.Any]] = None) -> None + :canonical: cookie_composer.commands.add.add_cmd + + .. autodoc2-docstring:: cookie_composer.commands.add.add_cmd diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.commands.authn.rst b/docsrc/apidocs/cookie_composer/cookie_composer.commands.authn.rst new file mode 100644 index 0000000..25d1d71 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.commands.authn.rst @@ -0,0 +1,45 @@ +:py:mod:`cookie_composer.commands.authn` +======================================== + +.. py:module:: cookie_composer.commands.authn + +.. autodoc2-docstring:: cookie_composer.commands.authn + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`auth ` + - .. autodoc2-docstring:: cookie_composer.commands.authn.auth + :summary: + * - :py:obj:`login ` + - .. autodoc2-docstring:: cookie_composer.commands.authn.login + :summary: + * - :py:obj:`token ` + - .. autodoc2-docstring:: cookie_composer.commands.authn.token + :summary: + +API +~~~ + +.. py:function:: auth() -> None + :canonical: cookie_composer.commands.authn.auth + + .. autodoc2-docstring:: cookie_composer.commands.authn.auth + +.. py:function:: login(git_protocol: str, service: str, scopes: str, with_token: rich_click.File) -> None + :canonical: cookie_composer.commands.authn.login + + .. autodoc2-docstring:: cookie_composer.commands.authn.login + +.. py:function:: token(service: str) -> None + :canonical: cookie_composer.commands.authn.token + + .. autodoc2-docstring:: cookie_composer.commands.authn.token diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.commands.create.rst b/docsrc/apidocs/cookie_composer/cookie_composer.commands.create.rst new file mode 100644 index 0000000..ab3e4fe --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.commands.create.rst @@ -0,0 +1,46 @@ +:py:mod:`cookie_composer.commands.create` +========================================= + +.. py:module:: cookie_composer.commands.create + +.. autodoc2-docstring:: cookie_composer.commands.create + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`create_cmd ` + - .. autodoc2-docstring:: cookie_composer.commands.create.create_cmd + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.commands.create.logger + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.commands.create.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.commands.create.logger + +.. py:function:: create_cmd(path_or_url: str, output_dir: typing.Optional[pathlib.Path] = None, no_input: bool = False, checkout: typing.Optional[str] = None, directory: typing.Optional[str] = None, overwrite_if_exists: bool = False, skip_if_file_exists: bool = False, default_config: bool = False, accept_hooks: str = 'all', initial_context: typing.Optional[typing.MutableMapping[str, typing.Any]] = None) -> pathlib.Path + :canonical: cookie_composer.commands.create.create_cmd + + .. autodoc2-docstring:: cookie_composer.commands.create.create_cmd diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.commands.link.rst b/docsrc/apidocs/cookie_composer/cookie_composer.commands.link.rst new file mode 100644 index 0000000..9b26aec --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.commands.link.rst @@ -0,0 +1,29 @@ +:py:mod:`cookie_composer.commands.link` +======================================= + +.. py:module:: cookie_composer.commands.link + +.. autodoc2-docstring:: cookie_composer.commands.link + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`link_cmd ` + - .. autodoc2-docstring:: cookie_composer.commands.link.link_cmd + :summary: + +API +~~~ + +.. py:function:: link_cmd(path_or_url: str, destination_dir: typing.Optional[pathlib.Path] = None, no_input: bool = False, checkout: typing.Optional[str] = None, directory: typing.Optional[str] = None, overwrite_if_exists: bool = False, skip_if_file_exists: bool = False, default_config: bool = False, initial_context: typing.Optional[typing.MutableMapping[str, typing.Any]] = None) -> None + :canonical: cookie_composer.commands.link.link_cmd + + .. autodoc2-docstring:: cookie_composer.commands.link.link_cmd diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.commands.rst b/docsrc/apidocs/cookie_composer/cookie_composer.commands.rst new file mode 100644 index 0000000..db0f6da --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.commands.rst @@ -0,0 +1,20 @@ +:py:mod:`cookie_composer.commands` +================================== + +.. py:module:: cookie_composer.commands + +.. autodoc2-docstring:: cookie_composer.commands + :allowtitles: + +Submodules +---------- + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + cookie_composer.commands.update + cookie_composer.commands.link + cookie_composer.commands.add + cookie_composer.commands.create + cookie_composer.commands.authn diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.commands.update.rst b/docsrc/apidocs/cookie_composer/cookie_composer.commands.update.rst new file mode 100644 index 0000000..18003a5 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.commands.update.rst @@ -0,0 +1,37 @@ +:py:mod:`cookie_composer.commands.update` +========================================= + +.. py:module:: cookie_composer.commands.update + +.. autodoc2-docstring:: cookie_composer.commands.update + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`update_cmd ` + - .. autodoc2-docstring:: cookie_composer.commands.update.update_cmd + :summary: + * - :py:obj:`update_rendered_composition_layers ` + - .. autodoc2-docstring:: cookie_composer.commands.update.update_rendered_composition_layers + :summary: + +API +~~~ + +.. py:function:: update_cmd(project_dir: typing.Optional[pathlib.Path] = None, no_input: bool = False) -> None + :canonical: cookie_composer.commands.update.update_cmd + + .. autodoc2-docstring:: cookie_composer.commands.update.update_cmd + +.. py:function:: update_rendered_composition_layers(base: cookie_composer.composition.RenderedComposition, updated_layers: typing.List[cookie_composer.layers.RenderedLayer]) -> cookie_composer.composition.RenderedComposition + :canonical: cookie_composer.commands.update.update_rendered_composition_layers + + .. autodoc2-docstring:: cookie_composer.commands.update.update_rendered_composition_layers diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.composition.rst b/docsrc/apidocs/cookie_composer/cookie_composer.composition.rst new file mode 100644 index 0000000..f0f5846 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.composition.rst @@ -0,0 +1,100 @@ +:py:mod:`cookie_composer.composition` +===================================== + +.. py:module:: cookie_composer.composition + +.. autodoc2-docstring:: cookie_composer.composition + :allowtitles: + +Module Contents +--------------- + +Classes +~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`Composition ` + - .. autodoc2-docstring:: cookie_composer.composition.Composition + :summary: + * - :py:obj:`RenderedComposition ` + - .. autodoc2-docstring:: cookie_composer.composition.RenderedComposition + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.composition.logger + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.composition.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.composition.logger + +.. py:class:: Composition(**data: typing.Any) + :canonical: cookie_composer.composition.Composition + + Bases: :py:obj:`pydantic.BaseModel` + + .. autodoc2-docstring:: cookie_composer.composition.Composition + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.composition.Composition.__init__ + + .. py:attribute:: layers + :canonical: cookie_composer.composition.Composition.layers + :type: typing.List[cookie_composer.layers.LayerConfig] + :value: None + + .. autodoc2-docstring:: cookie_composer.composition.Composition.layers + +.. py:class:: RenderedComposition(**data: typing.Any) + :canonical: cookie_composer.composition.RenderedComposition + + Bases: :py:obj:`pydantic.BaseModel` + + .. autodoc2-docstring:: cookie_composer.composition.RenderedComposition + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.composition.RenderedComposition.__init__ + + .. py:attribute:: layers + :canonical: cookie_composer.composition.RenderedComposition.layers + :type: typing.List[cookie_composer.layers.RenderedLayer] + :value: None + + .. autodoc2-docstring:: cookie_composer.composition.RenderedComposition.layers + + .. py:attribute:: render_dir + :canonical: cookie_composer.composition.RenderedComposition.render_dir + :type: pydantic.DirectoryPath + :value: None + + .. autodoc2-docstring:: cookie_composer.composition.RenderedComposition.render_dir + + .. py:attribute:: rendered_name + :canonical: cookie_composer.composition.RenderedComposition.rendered_name + :type: str + :value: None + + .. autodoc2-docstring:: cookie_composer.composition.RenderedComposition.rendered_name + + .. py:property:: layer_names + :canonical: cookie_composer.composition.RenderedComposition.layer_names + :type: typing.List[str] + + .. autodoc2-docstring:: cookie_composer.composition.RenderedComposition.layer_names diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.data_merge.rst b/docsrc/apidocs/cookie_composer/cookie_composer.data_merge.rst new file mode 100644 index 0000000..4b15f0d --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.data_merge.rst @@ -0,0 +1,147 @@ +:py:mod:`cookie_composer.data_merge` +==================================== + +.. py:module:: cookie_composer.data_merge + +.. autodoc2-docstring:: cookie_composer.data_merge + :allowtitles: + +Module Contents +--------------- + +Classes +~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`Context ` + - .. autodoc2-docstring:: cookie_composer.data_merge.Context + :summary: + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`deep_merge ` + - .. autodoc2-docstring:: cookie_composer.data_merge.deep_merge + :summary: + * - :py:obj:`merge_iterables ` + - .. autodoc2-docstring:: cookie_composer.data_merge.merge_iterables + :summary: + * - :py:obj:`comprehensive_merge ` + - .. autodoc2-docstring:: cookie_composer.data_merge.comprehensive_merge + :summary: + * - :py:obj:`freeze_data ` + - .. autodoc2-docstring:: cookie_composer.data_merge.freeze_data + :summary: + * - :py:obj:`get_merge_strategy ` + - .. autodoc2-docstring:: cookie_composer.data_merge.get_merge_strategy + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.data_merge.logger + :summary: + * - :py:obj:`DO_NOT_MERGE ` + - .. autodoc2-docstring:: cookie_composer.data_merge.DO_NOT_MERGE + :summary: + * - :py:obj:`NESTED_OVERWRITE ` + - .. autodoc2-docstring:: cookie_composer.data_merge.NESTED_OVERWRITE + :summary: + * - :py:obj:`OVERWRITE ` + - .. autodoc2-docstring:: cookie_composer.data_merge.OVERWRITE + :summary: + * - :py:obj:`COMPREHENSIVE ` + - .. autodoc2-docstring:: cookie_composer.data_merge.COMPREHENSIVE + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.data_merge.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.data_merge.logger + +.. py:function:: deep_merge(*dicts: dict) -> dict + :canonical: cookie_composer.data_merge.deep_merge + + .. autodoc2-docstring:: cookie_composer.data_merge.deep_merge + +.. py:function:: merge_iterables(iter1: typing.Iterable, iter2: typing.Iterable) -> set + :canonical: cookie_composer.data_merge.merge_iterables + + .. autodoc2-docstring:: cookie_composer.data_merge.merge_iterables + +.. py:function:: comprehensive_merge(*args: typing.MutableMapping) -> typing.Any + :canonical: cookie_composer.data_merge.comprehensive_merge + + .. autodoc2-docstring:: cookie_composer.data_merge.comprehensive_merge + +.. py:class:: Context(*maps) + :canonical: cookie_composer.data_merge.Context + + Bases: :py:obj:`collections.ChainMap` + + .. autodoc2-docstring:: cookie_composer.data_merge.Context + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.data_merge.Context.__init__ + + .. py:property:: is_empty + :canonical: cookie_composer.data_merge.Context.is_empty + :type: bool + + .. autodoc2-docstring:: cookie_composer.data_merge.Context.is_empty + + .. py:method:: flatten() -> typing.MutableMapping + :canonical: cookie_composer.data_merge.Context.flatten + + .. autodoc2-docstring:: cookie_composer.data_merge.Context.flatten + +.. py:function:: freeze_data(obj: typing.Any) -> typing.Any + :canonical: cookie_composer.data_merge.freeze_data + + .. autodoc2-docstring:: cookie_composer.data_merge.freeze_data + +.. py:data:: DO_NOT_MERGE + :canonical: cookie_composer.data_merge.DO_NOT_MERGE + :value: 'do-not-merge' + + .. autodoc2-docstring:: cookie_composer.data_merge.DO_NOT_MERGE + +.. py:data:: NESTED_OVERWRITE + :canonical: cookie_composer.data_merge.NESTED_OVERWRITE + :value: 'nested-overwrite' + + .. autodoc2-docstring:: cookie_composer.data_merge.NESTED_OVERWRITE + +.. py:data:: OVERWRITE + :canonical: cookie_composer.data_merge.OVERWRITE + :value: 'overwrite' + + .. autodoc2-docstring:: cookie_composer.data_merge.OVERWRITE + +.. py:data:: COMPREHENSIVE + :canonical: cookie_composer.data_merge.COMPREHENSIVE + :value: 'comprehensive' + + .. autodoc2-docstring:: cookie_composer.data_merge.COMPREHENSIVE + +.. py:function:: get_merge_strategy(path: pathlib.Path, merge_strategies: typing.Dict[str, str]) -> str + :canonical: cookie_composer.data_merge.get_merge_strategy + + .. autodoc2-docstring:: cookie_composer.data_merge.get_merge_strategy diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.diff.rst b/docsrc/apidocs/cookie_composer/cookie_composer.diff.rst new file mode 100644 index 0000000..132082d --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.diff.rst @@ -0,0 +1,79 @@ +:py:mod:`cookie_composer.diff` +============================== + +.. py:module:: cookie_composer.diff + +.. autodoc2-docstring:: cookie_composer.diff + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`_git_diff_command ` + - .. autodoc2-docstring:: cookie_composer.diff._git_diff_command + :summary: + * - :py:obj:`get_diff ` + - .. autodoc2-docstring:: cookie_composer.diff.get_diff + :summary: + * - :py:obj:`replace_diff_prefixes ` + - .. autodoc2-docstring:: cookie_composer.diff.replace_diff_prefixes + :summary: + * - :py:obj:`display_diff ` + - .. autodoc2-docstring:: cookie_composer.diff.display_diff + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`DIFF_SRC_PREFIX ` + - .. autodoc2-docstring:: cookie_composer.diff.DIFF_SRC_PREFIX + :summary: + * - :py:obj:`DIFF_DST_PREFIX ` + - .. autodoc2-docstring:: cookie_composer.diff.DIFF_DST_PREFIX + :summary: + +API +~~~ + +.. py:data:: DIFF_SRC_PREFIX + :canonical: cookie_composer.diff.DIFF_SRC_PREFIX + :value: 'upstream-template-old' + + .. autodoc2-docstring:: cookie_composer.diff.DIFF_SRC_PREFIX + +.. py:data:: DIFF_DST_PREFIX + :canonical: cookie_composer.diff.DIFF_DST_PREFIX + :value: 'upstream-template-new' + + .. autodoc2-docstring:: cookie_composer.diff.DIFF_DST_PREFIX + +.. py:function:: _git_diff_command(*args: str) -> typing.List[str] + :canonical: cookie_composer.diff._git_diff_command + + .. autodoc2-docstring:: cookie_composer.diff._git_diff_command + +.. py:function:: get_diff(repo0: pathlib.Path, repo1: pathlib.Path) -> str + :canonical: cookie_composer.diff.get_diff + + .. autodoc2-docstring:: cookie_composer.diff.get_diff + +.. py:function:: replace_diff_prefixes(diff: str, repo0_path: str, repo1_path: str) -> str + :canonical: cookie_composer.diff.replace_diff_prefixes + + .. autodoc2-docstring:: cookie_composer.diff.replace_diff_prefixes + +.. py:function:: display_diff(repo0: pathlib.Path, repo1: pathlib.Path) -> None + :canonical: cookie_composer.diff.display_diff + + .. autodoc2-docstring:: cookie_composer.diff.display_diff diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.exceptions.rst b/docsrc/apidocs/cookie_composer/cookie_composer.exceptions.rst new file mode 100644 index 0000000..2669364 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.exceptions.rst @@ -0,0 +1,101 @@ +:py:mod:`cookie_composer.exceptions` +==================================== + +.. py:module:: cookie_composer.exceptions + +.. autodoc2-docstring:: cookie_composer.exceptions + :allowtitles: + +Module Contents +--------------- + +API +~~~ + +.. py:exception:: MissingCompositionFileError(path_or_url: str) + :canonical: cookie_composer.exceptions.MissingCompositionFileError + + Bases: :py:obj:`Exception` + + .. autodoc2-docstring:: cookie_composer.exceptions.MissingCompositionFileError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.MissingCompositionFileError.__init__ + +.. py:exception:: MergeError(origin: typing.Optional[str] = None, destination: typing.Optional[str] = None, strategy: typing.Optional[str] = None, error_message: typing.Optional[str] = '') + :canonical: cookie_composer.exceptions.MergeError + + Bases: :py:obj:`Exception` + + .. autodoc2-docstring:: cookie_composer.exceptions.MergeError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.MergeError.__init__ + +.. py:exception:: GitError() + :canonical: cookie_composer.exceptions.GitError + + Bases: :py:obj:`Exception` + + .. autodoc2-docstring:: cookie_composer.exceptions.GitError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.GitError.__init__ + +.. py:exception:: ChangesetUnicodeError() + :canonical: cookie_composer.exceptions.ChangesetUnicodeError + + Bases: :py:obj:`Exception` + + .. autodoc2-docstring:: cookie_composer.exceptions.ChangesetUnicodeError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.ChangesetUnicodeError.__init__ + +.. py:exception:: InvalidZipRepositoryError(message: str = '') + :canonical: cookie_composer.exceptions.InvalidZipRepositoryError + + Bases: :py:obj:`Exception` + + .. autodoc2-docstring:: cookie_composer.exceptions.InvalidZipRepositoryError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.InvalidZipRepositoryError.__init__ + +.. py:exception:: EmptyZipRepositoryError(url: str) + :canonical: cookie_composer.exceptions.EmptyZipRepositoryError + + Bases: :py:obj:`cookie_composer.exceptions.InvalidZipRepositoryError` + + .. autodoc2-docstring:: cookie_composer.exceptions.EmptyZipRepositoryError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.EmptyZipRepositoryError.__init__ + +.. py:exception:: NoZipDirectoryError(url: str) + :canonical: cookie_composer.exceptions.NoZipDirectoryError + + Bases: :py:obj:`cookie_composer.exceptions.InvalidZipRepositoryError` + + .. autodoc2-docstring:: cookie_composer.exceptions.NoZipDirectoryError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.NoZipDirectoryError.__init__ + +.. py:exception:: InvalidZipPasswordError() + :canonical: cookie_composer.exceptions.InvalidZipPasswordError + + Bases: :py:obj:`cookie_composer.exceptions.InvalidZipRepositoryError` + + .. autodoc2-docstring:: cookie_composer.exceptions.InvalidZipPasswordError + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.exceptions.InvalidZipPasswordError.__init__ diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.git_commands.rst b/docsrc/apidocs/cookie_composer/cookie_composer.git_commands.rst new file mode 100644 index 0000000..050e577 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.git_commands.rst @@ -0,0 +1,124 @@ +:py:mod:`cookie_composer.git_commands` +====================================== + +.. py:module:: cookie_composer.git_commands + +.. autodoc2-docstring:: cookie_composer.git_commands + :allowtitles: + +Module Contents +--------------- + +Classes +~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`TempGitWorktreeDir ` + - .. autodoc2-docstring:: cookie_composer.git_commands.TempGitWorktreeDir + :summary: + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`get_repo ` + - .. autodoc2-docstring:: cookie_composer.git_commands.get_repo + :summary: + * - :py:obj:`clone ` + - .. autodoc2-docstring:: cookie_composer.git_commands.clone + :summary: + * - :py:obj:`branch_exists ` + - .. autodoc2-docstring:: cookie_composer.git_commands.branch_exists + :summary: + * - :py:obj:`remote_branch_exists ` + - .. autodoc2-docstring:: cookie_composer.git_commands.remote_branch_exists + :summary: + * - :py:obj:`checkout_ref ` + - .. autodoc2-docstring:: cookie_composer.git_commands.checkout_ref + :summary: + * - :py:obj:`checkout_branch ` + - .. autodoc2-docstring:: cookie_composer.git_commands.checkout_branch + :summary: + * - :py:obj:`apply_patch ` + - .. autodoc2-docstring:: cookie_composer.git_commands.apply_patch + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.git_commands.logger + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.git_commands.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.git_commands.logger + +.. py:function:: get_repo(project_dir: typing.Union[str, pathlib.Path], search_parent_directories: bool = False, ensure_clean: bool = False) -> git.Repo + :canonical: cookie_composer.git_commands.get_repo + + .. autodoc2-docstring:: cookie_composer.git_commands.get_repo + +.. py:function:: clone(repo_url: str, dest_path: typing.Optional[pathlib.Path] = None) -> git.Repo + :canonical: cookie_composer.git_commands.clone + + .. autodoc2-docstring:: cookie_composer.git_commands.clone + +.. py:function:: branch_exists(repo: git.Repo, branch_name: str) -> bool + :canonical: cookie_composer.git_commands.branch_exists + + .. autodoc2-docstring:: cookie_composer.git_commands.branch_exists + +.. py:function:: remote_branch_exists(repo: git.Repo, branch_name: str, remote_name: str = 'origin') -> bool + :canonical: cookie_composer.git_commands.remote_branch_exists + + .. autodoc2-docstring:: cookie_composer.git_commands.remote_branch_exists + +.. py:function:: checkout_ref(repo: git.Repo, ref: str) -> None + :canonical: cookie_composer.git_commands.checkout_ref + + .. autodoc2-docstring:: cookie_composer.git_commands.checkout_ref + +.. py:function:: checkout_branch(repo: git.Repo, branch_name: str, remote_name: str = 'origin') -> None + :canonical: cookie_composer.git_commands.checkout_branch + + .. autodoc2-docstring:: cookie_composer.git_commands.checkout_branch + +.. py:function:: apply_patch(repo: git.Repo, diff: str) -> None + :canonical: cookie_composer.git_commands.apply_patch + + .. autodoc2-docstring:: cookie_composer.git_commands.apply_patch + +.. py:class:: TempGitWorktreeDir(worktree_path: pathlib.Path, repo_path: pathlib.Path, branch: str = 'master') + :canonical: cookie_composer.git_commands.TempGitWorktreeDir + + .. autodoc2-docstring:: cookie_composer.git_commands.TempGitWorktreeDir + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.git_commands.TempGitWorktreeDir.__init__ + + .. py:method:: __enter__() + :canonical: cookie_composer.git_commands.TempGitWorktreeDir.__enter__ + + .. autodoc2-docstring:: cookie_composer.git_commands.TempGitWorktreeDir.__enter__ + + .. py:method:: __exit__(type, value, traceback) + :canonical: cookie_composer.git_commands.TempGitWorktreeDir.__exit__ + + .. autodoc2-docstring:: cookie_composer.git_commands.TempGitWorktreeDir.__exit__ diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.io.rst b/docsrc/apidocs/cookie_composer/cookie_composer.io.rst new file mode 100644 index 0000000..a9ac501 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.io.rst @@ -0,0 +1,141 @@ +:py:mod:`cookie_composer.io` +============================ + +.. py:module:: cookie_composer.io + +.. autodoc2-docstring:: cookie_composer.io + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`serialize_layer ` + - .. autodoc2-docstring:: cookie_composer.io.serialize_layer + :summary: + * - :py:obj:`deserialize_layer ` + - .. autodoc2-docstring:: cookie_composer.io.deserialize_layer + :summary: + * - :py:obj:`serialize_rendered_layer ` + - .. autodoc2-docstring:: cookie_composer.io.serialize_rendered_layer + :summary: + * - :py:obj:`deserialize_rendered_layer ` + - .. autodoc2-docstring:: cookie_composer.io.deserialize_rendered_layer + :summary: + * - :py:obj:`serialize_composition ` + - .. autodoc2-docstring:: cookie_composer.io.serialize_composition + :summary: + * - :py:obj:`deserialize_composition ` + - .. autodoc2-docstring:: cookie_composer.io.deserialize_composition + :summary: + * - :py:obj:`serialize_rendered_composition ` + - .. autodoc2-docstring:: cookie_composer.io.serialize_rendered_composition + :summary: + * - :py:obj:`deserialize_rendered_composition ` + - .. autodoc2-docstring:: cookie_composer.io.deserialize_rendered_composition + :summary: + * - :py:obj:`read_yaml ` + - .. autodoc2-docstring:: cookie_composer.io.read_yaml + :summary: + * - :py:obj:`write_yaml ` + - .. autodoc2-docstring:: cookie_composer.io.write_yaml + :summary: + * - :py:obj:`is_composition_file ` + - .. autodoc2-docstring:: cookie_composer.io.is_composition_file + :summary: + * - :py:obj:`read_composition ` + - .. autodoc2-docstring:: cookie_composer.io.read_composition + :summary: + * - :py:obj:`read_rendered_composition ` + - .. autodoc2-docstring:: cookie_composer.io.read_rendered_composition + :summary: + * - :py:obj:`write_rendered_composition ` + - .. autodoc2-docstring:: cookie_composer.io.write_rendered_composition + :summary: + * - :py:obj:`get_composition_from_path_or_url ` + - .. autodoc2-docstring:: cookie_composer.io.get_composition_from_path_or_url + :summary: + +API +~~~ + +.. py:function:: serialize_layer(layer: cookie_composer.layers.LayerConfig) -> dict + :canonical: cookie_composer.io.serialize_layer + + .. autodoc2-docstring:: cookie_composer.io.serialize_layer + +.. py:function:: deserialize_layer(layer_info: dict, local_path: typing.Optional[pathlib.Path] = None, **kwargs) -> cookie_composer.layers.LayerConfig + :canonical: cookie_composer.io.deserialize_layer + + .. autodoc2-docstring:: cookie_composer.io.deserialize_layer + +.. py:function:: serialize_rendered_layer(rendered_layer: cookie_composer.layers.RenderedLayer) -> dict + :canonical: cookie_composer.io.serialize_rendered_layer + + .. autodoc2-docstring:: cookie_composer.io.serialize_rendered_layer + +.. py:function:: deserialize_rendered_layer(rendered_layer_info: dict, location: pathlib.Path) -> cookie_composer.layers.RenderedLayer + :canonical: cookie_composer.io.deserialize_rendered_layer + + .. autodoc2-docstring:: cookie_composer.io.deserialize_rendered_layer + +.. py:function:: serialize_composition(layers: typing.List[cookie_composer.layers.LayerConfig]) -> typing.List[dict] + :canonical: cookie_composer.io.serialize_composition + + .. autodoc2-docstring:: cookie_composer.io.serialize_composition + +.. py:function:: deserialize_composition(composition_info: typing.List[dict], local_path: typing.Optional[pathlib.Path] = None, **kwargs) -> cookie_composer.composition.Composition + :canonical: cookie_composer.io.deserialize_composition + + .. autodoc2-docstring:: cookie_composer.io.deserialize_composition + +.. py:function:: serialize_rendered_composition(composition: cookie_composer.composition.RenderedComposition) -> typing.List[dict] + :canonical: cookie_composer.io.serialize_rendered_composition + + .. autodoc2-docstring:: cookie_composer.io.serialize_rendered_composition + +.. py:function:: deserialize_rendered_composition(composition_info: typing.List[dict], location: pathlib.Path) -> cookie_composer.composition.RenderedComposition + :canonical: cookie_composer.io.deserialize_rendered_composition + + .. autodoc2-docstring:: cookie_composer.io.deserialize_rendered_composition + +.. py:function:: read_yaml(path_or_url: typing.Union[str, pathlib.Path]) -> typing.List[dict] + :canonical: cookie_composer.io.read_yaml + + .. autodoc2-docstring:: cookie_composer.io.read_yaml + +.. py:function:: write_yaml(path: pathlib.Path, contents: typing.List[dict]) -> None + :canonical: cookie_composer.io.write_yaml + + .. autodoc2-docstring:: cookie_composer.io.write_yaml + +.. py:function:: is_composition_file(path_or_url: typing.Union[str, pathlib.Path]) -> bool + :canonical: cookie_composer.io.is_composition_file + + .. autodoc2-docstring:: cookie_composer.io.is_composition_file + +.. py:function:: read_composition(path_or_url: typing.Union[str, pathlib.Path], **kwargs) -> cookie_composer.composition.Composition + :canonical: cookie_composer.io.read_composition + + .. autodoc2-docstring:: cookie_composer.io.read_composition + +.. py:function:: read_rendered_composition(path: pathlib.Path) -> cookie_composer.composition.RenderedComposition + :canonical: cookie_composer.io.read_rendered_composition + + .. autodoc2-docstring:: cookie_composer.io.read_rendered_composition + +.. py:function:: write_rendered_composition(composition: cookie_composer.composition.RenderedComposition) -> None + :canonical: cookie_composer.io.write_rendered_composition + + .. autodoc2-docstring:: cookie_composer.io.write_rendered_composition + +.. py:function:: get_composition_from_path_or_url(path_or_url: str, checkout: typing.Optional[str] = None, default_config: bool = False, directory: typing.Optional[str] = None, no_input: bool = False, output_dir: typing.Optional[pathlib.Path] = None, overwrite_if_exists: bool = False, skip_if_file_exists: bool = False, initial_context: typing.Optional[typing.MutableMapping[str, typing.Any]] = None) -> cookie_composer.composition.Composition + :canonical: cookie_composer.io.get_composition_from_path_or_url + + .. autodoc2-docstring:: cookie_composer.io.get_composition_from_path_or_url diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.layers.rst b/docsrc/apidocs/cookie_composer/cookie_composer.layers.rst new file mode 100644 index 0000000..519779d --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.layers.rst @@ -0,0 +1,274 @@ +:py:mod:`cookie_composer.layers` +================================ + +.. py:module:: cookie_composer.layers + +.. autodoc2-docstring:: cookie_composer.layers + :allowtitles: + +Module Contents +--------------- + +Classes +~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`WriteStrategy ` + - .. autodoc2-docstring:: cookie_composer.layers.WriteStrategy + :summary: + * - :py:obj:`LayerConfig ` + - .. autodoc2-docstring:: cookie_composer.layers.LayerConfig + :summary: + * - :py:obj:`RenderedLayer ` + - .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer + :summary: + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`get_write_strategy ` + - .. autodoc2-docstring:: cookie_composer.layers.get_write_strategy + :summary: + * - :py:obj:`get_template_rendered_name ` + - .. autodoc2-docstring:: cookie_composer.layers.get_template_rendered_name + :summary: + * - :py:obj:`render_layer ` + - .. autodoc2-docstring:: cookie_composer.layers.render_layer + :summary: + * - :py:obj:`get_layer_context ` + - .. autodoc2-docstring:: cookie_composer.layers.get_layer_context + :summary: + * - :py:obj:`render_layers ` + - .. autodoc2-docstring:: cookie_composer.layers.render_layers + :summary: + * - :py:obj:`get_accept_hooks_per_layer ` + - .. autodoc2-docstring:: cookie_composer.layers.get_accept_hooks_per_layer + :summary: + * - :py:obj:`merge_layers ` + - .. autodoc2-docstring:: cookie_composer.layers.merge_layers + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.layers.logger + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.layers.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.logger + +.. py:class:: WriteStrategy + :canonical: cookie_composer.layers.WriteStrategy + + Bases: :py:obj:`enum.Enum` + + .. autodoc2-docstring:: cookie_composer.layers.WriteStrategy + + .. py:attribute:: WRITE + :canonical: cookie_composer.layers.WriteStrategy.WRITE + :value: 1 + + .. autodoc2-docstring:: cookie_composer.layers.WriteStrategy.WRITE + + .. py:attribute:: SKIP + :canonical: cookie_composer.layers.WriteStrategy.SKIP + :value: 2 + + .. autodoc2-docstring:: cookie_composer.layers.WriteStrategy.SKIP + + .. py:attribute:: MERGE + :canonical: cookie_composer.layers.WriteStrategy.MERGE + :value: 3 + + .. autodoc2-docstring:: cookie_composer.layers.WriteStrategy.MERGE + +.. py:class:: LayerConfig(**data: typing.Any) + :canonical: cookie_composer.layers.LayerConfig + + Bases: :py:obj:`pydantic.BaseModel` + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.__init__ + + .. py:attribute:: template + :canonical: cookie_composer.layers.LayerConfig.template + :type: cookie_composer.templates.types.Template + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.template + + .. py:attribute:: no_input + :canonical: cookie_composer.layers.LayerConfig.no_input + :type: bool + :value: False + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.no_input + + .. py:attribute:: initial_context + :canonical: cookie_composer.layers.LayerConfig.initial_context + :type: typing.MutableMapping[str, typing.Any] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.initial_context + + .. py:attribute:: skip_hooks + :canonical: cookie_composer.layers.LayerConfig.skip_hooks + :type: bool + :value: False + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.skip_hooks + + .. py:attribute:: skip_if_file_exists + :canonical: cookie_composer.layers.LayerConfig.skip_if_file_exists + :type: bool + :value: True + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.skip_if_file_exists + + .. py:attribute:: skip_generation + :canonical: cookie_composer.layers.LayerConfig.skip_generation + :type: typing.List[str] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.skip_generation + + .. py:attribute:: overwrite + :canonical: cookie_composer.layers.LayerConfig.overwrite + :type: typing.List[str] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.overwrite + + .. py:attribute:: overwrite_exclude + :canonical: cookie_composer.layers.LayerConfig.overwrite_exclude + :type: typing.List[str] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.overwrite_exclude + + .. py:attribute:: merge_strategies + :canonical: cookie_composer.layers.LayerConfig.merge_strategies + :type: typing.Dict[str, str] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.merge_strategies + + .. py:property:: layer_name + :canonical: cookie_composer.layers.LayerConfig.layer_name + :type: str + + .. autodoc2-docstring:: cookie_composer.layers.LayerConfig.layer_name + +.. py:class:: RenderedLayer(**data: typing.Any) + :canonical: cookie_composer.layers.RenderedLayer + + Bases: :py:obj:`pydantic.BaseModel` + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.__init__ + + .. py:attribute:: layer + :canonical: cookie_composer.layers.RenderedLayer.layer + :type: cookie_composer.layers.LayerConfig + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.layer + + .. py:attribute:: location + :canonical: cookie_composer.layers.RenderedLayer.location + :type: pydantic.DirectoryPath + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.location + + .. py:attribute:: rendered_context + :canonical: cookie_composer.layers.RenderedLayer.rendered_context + :type: typing.MutableMapping[str, typing.Any] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.rendered_context + + .. py:attribute:: rendered_commit + :canonical: cookie_composer.layers.RenderedLayer.rendered_commit + :type: typing.Optional[str] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.rendered_commit + + .. py:attribute:: rendered_name + :canonical: cookie_composer.layers.RenderedLayer.rendered_name + :type: typing.Optional[str] + :value: None + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.rendered_name + + .. py:property:: latest_commit + :canonical: cookie_composer.layers.RenderedLayer.latest_commit + :type: typing.Optional[str] + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.latest_commit + + .. py:method:: set_rendered_name(values: typing.Dict[str, typing.Any]) -> typing.Dict[str, typing.Any] + :canonical: cookie_composer.layers.RenderedLayer.set_rendered_name + :classmethod: + + .. autodoc2-docstring:: cookie_composer.layers.RenderedLayer.set_rendered_name + +.. py:function:: get_write_strategy(origin: pathlib.Path, destination: pathlib.Path, rendered_layer: cookie_composer.layers.RenderedLayer) -> cookie_composer.layers.WriteStrategy + :canonical: cookie_composer.layers.get_write_strategy + + .. autodoc2-docstring:: cookie_composer.layers.get_write_strategy + +.. py:function:: get_template_rendered_name(template: cookie_composer.templates.types.Template, context: typing.MutableMapping) -> str + :canonical: cookie_composer.layers.get_template_rendered_name + + .. autodoc2-docstring:: cookie_composer.layers.get_template_rendered_name + +.. py:function:: render_layer(layer_config: cookie_composer.layers.LayerConfig, render_dir: pathlib.Path, full_context: typing.Optional[cookie_composer.data_merge.Context] = None, accept_hooks: str = 'yes') -> cookie_composer.layers.RenderedLayer + :canonical: cookie_composer.layers.render_layer + + .. autodoc2-docstring:: cookie_composer.layers.render_layer + +.. py:function:: get_layer_context(layer_config: cookie_composer.layers.LayerConfig, user_config: dict, full_context: typing.Optional[cookie_composer.data_merge.Context] = None) -> cookie_composer.data_merge.Context + :canonical: cookie_composer.layers.get_layer_context + + .. autodoc2-docstring:: cookie_composer.layers.get_layer_context + +.. py:function:: render_layers(layers: typing.List[cookie_composer.layers.LayerConfig], destination: pathlib.Path, initial_context: typing.Optional[dict] = None, no_input: bool = False, accept_hooks: str = 'all') -> typing.List[cookie_composer.layers.RenderedLayer] + :canonical: cookie_composer.layers.render_layers + + .. autodoc2-docstring:: cookie_composer.layers.render_layers + +.. py:function:: get_accept_hooks_per_layer(accept_hooks: str, num_layers: int) -> list + :canonical: cookie_composer.layers.get_accept_hooks_per_layer + + .. autodoc2-docstring:: cookie_composer.layers.get_accept_hooks_per_layer + +.. py:function:: merge_layers(destination: pathlib.Path, rendered_layer: cookie_composer.layers.RenderedLayer) -> None + :canonical: cookie_composer.layers.merge_layers + + .. autodoc2-docstring:: cookie_composer.layers.merge_layers diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.matching.rst b/docsrc/apidocs/cookie_composer/cookie_composer.matching.rst new file mode 100644 index 0000000..e0de555 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.matching.rst @@ -0,0 +1,37 @@ +:py:mod:`cookie_composer.matching` +================================== + +.. py:module:: cookie_composer.matching + +.. autodoc2-docstring:: cookie_composer.matching + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`rel_fnmatch ` + - .. autodoc2-docstring:: cookie_composer.matching.rel_fnmatch + :summary: + * - :py:obj:`matches_any_glob ` + - .. autodoc2-docstring:: cookie_composer.matching.matches_any_glob + :summary: + +API +~~~ + +.. py:function:: rel_fnmatch(name: str, pat: str) -> bool + :canonical: cookie_composer.matching.rel_fnmatch + + .. autodoc2-docstring:: cookie_composer.matching.rel_fnmatch + +.. py:function:: matches_any_glob(path: typing.Union[str, pathlib.Path], patterns: typing.List[str]) -> bool + :canonical: cookie_composer.matching.matches_any_glob + + .. autodoc2-docstring:: cookie_composer.matching.matches_any_glob diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.ini_file.rst b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.ini_file.rst new file mode 100644 index 0000000..c8ef8b9 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.ini_file.rst @@ -0,0 +1,45 @@ +:py:mod:`cookie_composer.merge_files.ini_file` +============================================== + +.. py:module:: cookie_composer.merge_files.ini_file + +.. autodoc2-docstring:: cookie_composer.merge_files.ini_file + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`merge_ini_files ` + - .. autodoc2-docstring:: cookie_composer.merge_files.ini_file.merge_ini_files + :summary: + * - :py:obj:`config_to_dict ` + - .. autodoc2-docstring:: cookie_composer.merge_files.ini_file.config_to_dict + :summary: + * - :py:obj:`dict_to_config ` + - .. autodoc2-docstring:: cookie_composer.merge_files.ini_file.dict_to_config + :summary: + +API +~~~ + +.. py:function:: merge_ini_files(new_file: pathlib.Path, existing_file: pathlib.Path, merge_strategy: str) -> None + :canonical: cookie_composer.merge_files.ini_file.merge_ini_files + + .. autodoc2-docstring:: cookie_composer.merge_files.ini_file.merge_ini_files + +.. py:function:: config_to_dict(config: configparser.ConfigParser) -> dict + :canonical: cookie_composer.merge_files.ini_file.config_to_dict + + .. autodoc2-docstring:: cookie_composer.merge_files.ini_file.config_to_dict + +.. py:function:: dict_to_config(dictionary: dict) -> configparser.ConfigParser + :canonical: cookie_composer.merge_files.ini_file.dict_to_config + + .. autodoc2-docstring:: cookie_composer.merge_files.ini_file.dict_to_config diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.json_file.rst b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.json_file.rst new file mode 100644 index 0000000..1073036 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.json_file.rst @@ -0,0 +1,37 @@ +:py:mod:`cookie_composer.merge_files.json_file` +=============================================== + +.. py:module:: cookie_composer.merge_files.json_file + +.. autodoc2-docstring:: cookie_composer.merge_files.json_file + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`default ` + - .. autodoc2-docstring:: cookie_composer.merge_files.json_file.default + :summary: + * - :py:obj:`merge_json_files ` + - .. autodoc2-docstring:: cookie_composer.merge_files.json_file.merge_json_files + :summary: + +API +~~~ + +.. py:function:: default(obj: typing.Any) -> dict + :canonical: cookie_composer.merge_files.json_file.default + + .. autodoc2-docstring:: cookie_composer.merge_files.json_file.default + +.. py:function:: merge_json_files(new_file: pathlib.Path, existing_file: pathlib.Path, merge_strategy: str) -> None + :canonical: cookie_composer.merge_files.json_file.merge_json_files + + .. autodoc2-docstring:: cookie_composer.merge_files.json_file.merge_json_files diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.rst b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.rst new file mode 100644 index 0000000..1f20b32 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.rst @@ -0,0 +1,52 @@ +:py:mod:`cookie_composer.merge_files` +===================================== + +.. py:module:: cookie_composer.merge_files + +.. autodoc2-docstring:: cookie_composer.merge_files + :allowtitles: + +Submodules +---------- + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + cookie_composer.merge_files.toml_file + cookie_composer.merge_files.json_file + cookie_composer.merge_files.yaml_file + cookie_composer.merge_files.ini_file + +Package Contents +---------------- + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`merge_function ` + - .. autodoc2-docstring:: cookie_composer.merge_files.merge_function + :summary: + * - :py:obj:`MERGE_FUNCTIONS ` + - .. autodoc2-docstring:: cookie_composer.merge_files.MERGE_FUNCTIONS + :summary: + +API +~~~ + +.. py:data:: merge_function + :canonical: cookie_composer.merge_files.merge_function + :value: None + + .. autodoc2-docstring:: cookie_composer.merge_files.merge_function + +.. py:data:: MERGE_FUNCTIONS + :canonical: cookie_composer.merge_files.MERGE_FUNCTIONS + :type: typing.Dict[str, cookie_composer.merge_files.merge_function] + :value: None + + .. autodoc2-docstring:: cookie_composer.merge_files.MERGE_FUNCTIONS diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.toml_file.rst b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.toml_file.rst new file mode 100644 index 0000000..9454fbe --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.toml_file.rst @@ -0,0 +1,29 @@ +:py:mod:`cookie_composer.merge_files.toml_file` +=============================================== + +.. py:module:: cookie_composer.merge_files.toml_file + +.. autodoc2-docstring:: cookie_composer.merge_files.toml_file + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`merge_toml_files ` + - .. autodoc2-docstring:: cookie_composer.merge_files.toml_file.merge_toml_files + :summary: + +API +~~~ + +.. py:function:: merge_toml_files(new_file: pathlib.Path, existing_file: pathlib.Path, merge_strategy: str) -> None + :canonical: cookie_composer.merge_files.toml_file.merge_toml_files + + .. autodoc2-docstring:: cookie_composer.merge_files.toml_file.merge_toml_files diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.yaml_file.rst b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.yaml_file.rst new file mode 100644 index 0000000..174aaea --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.merge_files.yaml_file.rst @@ -0,0 +1,29 @@ +:py:mod:`cookie_composer.merge_files.yaml_file` +=============================================== + +.. py:module:: cookie_composer.merge_files.yaml_file + +.. autodoc2-docstring:: cookie_composer.merge_files.yaml_file + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`merge_yaml_files ` + - .. autodoc2-docstring:: cookie_composer.merge_files.yaml_file.merge_yaml_files + :summary: + +API +~~~ + +.. py:function:: merge_yaml_files(new_file: pathlib.Path, existing_file: pathlib.Path, merge_strategy: str) -> None + :canonical: cookie_composer.merge_files.yaml_file.merge_yaml_files + + .. autodoc2-docstring:: cookie_composer.merge_files.yaml_file.merge_yaml_files diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.rst b/docsrc/apidocs/cookie_composer/cookie_composer.rst new file mode 100644 index 0000000..dc3fb32 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.rst @@ -0,0 +1,62 @@ +:py:mod:`cookie_composer` +========================= + +.. py:module:: cookie_composer + +.. autodoc2-docstring:: cookie_composer + :allowtitles: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + :maxdepth: 3 + + cookie_composer.merge_files + cookie_composer.templates + cookie_composer.commands + +Submodules +---------- + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + cookie_composer.data_merge + cookie_composer.git_commands + cookie_composer.io + cookie_composer.matching + cookie_composer.cli + cookie_composer.utils + cookie_composer.cc_overrides + cookie_composer.authentication + cookie_composer.exceptions + cookie_composer.diff + cookie_composer.composition + cookie_composer.layers + +Package Contents +---------------- + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`__version__ ` + - .. autodoc2-docstring:: cookie_composer.__version__ + :summary: + +API +~~~ + +.. py:data:: __version__ + :canonical: cookie_composer.__version__ + :type: str + :value: '0.11.0b1' + + .. autodoc2-docstring:: cookie_composer.__version__ diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.templates.git_repo.rst b/docsrc/apidocs/cookie_composer/cookie_composer.templates.git_repo.rst new file mode 100644 index 0000000..d28f98d --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.templates.git_repo.rst @@ -0,0 +1,62 @@ +:py:mod:`cookie_composer.templates.git_repo` +============================================ + +.. py:module:: cookie_composer.templates.git_repo + +.. autodoc2-docstring:: cookie_composer.templates.git_repo + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`get_repo_name ` + - .. autodoc2-docstring:: cookie_composer.templates.git_repo.get_repo_name + :summary: + * - :py:obj:`template_repo_from_git ` + - .. autodoc2-docstring:: cookie_composer.templates.git_repo.template_repo_from_git + :summary: + * - :py:obj:`get_cached_remote ` + - .. autodoc2-docstring:: cookie_composer.templates.git_repo.get_cached_remote + :summary: + +Data +~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`logger ` + - .. autodoc2-docstring:: cookie_composer.templates.git_repo.logger + :summary: + +API +~~~ + +.. py:data:: logger + :canonical: cookie_composer.templates.git_repo.logger + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.git_repo.logger + +.. py:function:: get_repo_name(repo_url: str, checkout: typing.Optional[str] = None) -> str + :canonical: cookie_composer.templates.git_repo.get_repo_name + + .. autodoc2-docstring:: cookie_composer.templates.git_repo.get_repo_name + +.. py:function:: template_repo_from_git(git_uri: str, locality: cookie_composer.templates.types.Locality, cache_dir: pathlib.Path, checkout: typing.Optional[str] = None) -> cookie_composer.templates.types.TemplateRepo + :canonical: cookie_composer.templates.git_repo.template_repo_from_git + + .. autodoc2-docstring:: cookie_composer.templates.git_repo.template_repo_from_git + +.. py:function:: get_cached_remote(git_uri: str, cache_dir: pathlib.Path, checkout: typing.Optional[str] = None) -> git.Repo + :canonical: cookie_composer.templates.git_repo.get_cached_remote + + .. autodoc2-docstring:: cookie_composer.templates.git_repo.get_cached_remote diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.templates.rst b/docsrc/apidocs/cookie_composer/cookie_composer.templates.rst new file mode 100644 index 0000000..abe0f7e --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.templates.rst @@ -0,0 +1,19 @@ +:py:mod:`cookie_composer.templates` +=================================== + +.. py:module:: cookie_composer.templates + +.. autodoc2-docstring:: cookie_composer.templates + :allowtitles: + +Submodules +---------- + +.. toctree:: + :titlesonly: + :maxdepth: 1 + + cookie_composer.templates.zipfile_repo + cookie_composer.templates.git_repo + cookie_composer.templates.types + cookie_composer.templates.source diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.templates.source.rst b/docsrc/apidocs/cookie_composer/cookie_composer.templates.source.rst new file mode 100644 index 0000000..6ea77d6 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.templates.source.rst @@ -0,0 +1,45 @@ +:py:mod:`cookie_composer.templates.source` +========================================== + +.. py:module:: cookie_composer.templates.source + +.. autodoc2-docstring:: cookie_composer.templates.source + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`identify_repo ` + - .. autodoc2-docstring:: cookie_composer.templates.source.identify_repo + :summary: + * - :py:obj:`get_template_repo ` + - .. autodoc2-docstring:: cookie_composer.templates.source.get_template_repo + :summary: + * - :py:obj:`resolve_local_path ` + - .. autodoc2-docstring:: cookie_composer.templates.source.resolve_local_path + :summary: + +API +~~~ + +.. py:function:: identify_repo(url: str, local_path: typing.Optional[pathlib.Path] = None) -> typing.Tuple[cookie_composer.templates.types.TemplateFormat, cookie_composer.templates.types.Locality] + :canonical: cookie_composer.templates.source.identify_repo + + .. autodoc2-docstring:: cookie_composer.templates.source.identify_repo + +.. py:function:: get_template_repo(url: str, local_path: typing.Optional[pathlib.Path] = None, checkout: typing.Optional[str] = None, password: typing.Optional[str] = None) -> cookie_composer.templates.types.TemplateRepo + :canonical: cookie_composer.templates.source.get_template_repo + + .. autodoc2-docstring:: cookie_composer.templates.source.get_template_repo + +.. py:function:: resolve_local_path(url: str, local_path: typing.Optional[pathlib.Path] = None) -> pathlib.Path + :canonical: cookie_composer.templates.source.resolve_local_path + + .. autodoc2-docstring:: cookie_composer.templates.source.resolve_local_path diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.templates.types.rst b/docsrc/apidocs/cookie_composer/cookie_composer.templates.types.rst new file mode 100644 index 0000000..0ca63f3 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.templates.types.rst @@ -0,0 +1,221 @@ +:py:mod:`cookie_composer.templates.types` +========================================= + +.. py:module:: cookie_composer.templates.types + +.. autodoc2-docstring:: cookie_composer.templates.types + :allowtitles: + +Module Contents +--------------- + +Classes +~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`Locality ` + - .. autodoc2-docstring:: cookie_composer.templates.types.Locality + :summary: + * - :py:obj:`TemplateFormat ` + - .. autodoc2-docstring:: cookie_composer.templates.types.TemplateFormat + :summary: + * - :py:obj:`TemplateRepo ` + - .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo + :summary: + * - :py:obj:`Template ` + - .. autodoc2-docstring:: cookie_composer.templates.types.Template + :summary: + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`get_template_name ` + - .. autodoc2-docstring:: cookie_composer.templates.types.get_template_name + :summary: + +API +~~~ + +.. py:class:: Locality() + :canonical: cookie_composer.templates.types.Locality + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + .. autodoc2-docstring:: cookie_composer.templates.types.Locality + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.templates.types.Locality.__init__ + + .. py:attribute:: LOCAL + :canonical: cookie_composer.templates.types.Locality.LOCAL + :value: 'local' + + .. autodoc2-docstring:: cookie_composer.templates.types.Locality.LOCAL + + .. py:attribute:: REMOTE + :canonical: cookie_composer.templates.types.Locality.REMOTE + :value: 'remote' + + .. autodoc2-docstring:: cookie_composer.templates.types.Locality.REMOTE + +.. py:class:: TemplateFormat() + :canonical: cookie_composer.templates.types.TemplateFormat + + Bases: :py:obj:`str`, :py:obj:`enum.Enum` + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateFormat + + .. rubric:: Initialization + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateFormat.__init__ + + .. py:attribute:: ZIP + :canonical: cookie_composer.templates.types.TemplateFormat.ZIP + :value: 'zip' + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateFormat.ZIP + + .. py:attribute:: GIT + :canonical: cookie_composer.templates.types.TemplateFormat.GIT + :value: 'git' + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateFormat.GIT + + .. py:attribute:: HG + :canonical: cookie_composer.templates.types.TemplateFormat.HG + :value: 'hg' + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateFormat.HG + + .. py:attribute:: PLAIN + :canonical: cookie_composer.templates.types.TemplateFormat.PLAIN + :value: 'plain' + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateFormat.PLAIN + +.. py:class:: TemplateRepo + :canonical: cookie_composer.templates.types.TemplateRepo + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo + + .. py:attribute:: source + :canonical: cookie_composer.templates.types.TemplateRepo.source + :type: str + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.source + + .. py:attribute:: cached_source + :canonical: cookie_composer.templates.types.TemplateRepo.cached_source + :type: pathlib.Path + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.cached_source + + .. py:attribute:: format + :canonical: cookie_composer.templates.types.TemplateRepo.format + :type: cookie_composer.templates.types.TemplateFormat + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.format + + .. py:attribute:: locality + :canonical: cookie_composer.templates.types.TemplateRepo.locality + :type: cookie_composer.templates.types.Locality + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.locality + + .. py:attribute:: checkout + :canonical: cookie_composer.templates.types.TemplateRepo.checkout + :type: typing.Optional[str] + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.checkout + + .. py:attribute:: password + :canonical: cookie_composer.templates.types.TemplateRepo.password + :type: typing.Optional[str] + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.password + + .. py:property:: current_sha + :canonical: cookie_composer.templates.types.TemplateRepo.current_sha + :type: typing.Optional[str] + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.current_sha + + .. py:property:: latest_sha + :canonical: cookie_composer.templates.types.TemplateRepo.latest_sha + :type: typing.Optional[str] + + .. autodoc2-docstring:: cookie_composer.templates.types.TemplateRepo.latest_sha + +.. py:class:: Template + :canonical: cookie_composer.templates.types.Template + + .. autodoc2-docstring:: cookie_composer.templates.types.Template + + .. py:attribute:: repo + :canonical: cookie_composer.templates.types.Template.repo + :type: cookie_composer.templates.types.TemplateRepo + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.Template.repo + + .. py:attribute:: directory + :canonical: cookie_composer.templates.types.Template.directory + :type: str + :value: + + .. autodoc2-docstring:: cookie_composer.templates.types.Template.directory + + .. py:attribute:: _context + :canonical: cookie_composer.templates.types.Template._context + :type: typing.Optional[dict] + :value: None + + .. autodoc2-docstring:: cookie_composer.templates.types.Template._context + + .. py:method:: cleanup() -> None + :canonical: cookie_composer.templates.types.Template.cleanup + + .. autodoc2-docstring:: cookie_composer.templates.types.Template.cleanup + + .. py:property:: name + :canonical: cookie_composer.templates.types.Template.name + :type: str + + .. autodoc2-docstring:: cookie_composer.templates.types.Template.name + + .. py:property:: cached_path + :canonical: cookie_composer.templates.types.Template.cached_path + :type: pathlib.Path + + .. autodoc2-docstring:: cookie_composer.templates.types.Template.cached_path + + .. py:property:: context_file_path + :canonical: cookie_composer.templates.types.Template.context_file_path + :type: pathlib.Path + + .. autodoc2-docstring:: cookie_composer.templates.types.Template.context_file_path + + .. py:property:: context + :canonical: cookie_composer.templates.types.Template.context + :type: dict + + .. autodoc2-docstring:: cookie_composer.templates.types.Template.context + +.. py:function:: get_template_name(path_or_url: str, directory: typing.Optional[str] = None, checkout: typing.Optional[str] = None) -> str + :canonical: cookie_composer.templates.types.get_template_name + + .. autodoc2-docstring:: cookie_composer.templates.types.get_template_name diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.templates.zipfile_repo.rst b/docsrc/apidocs/cookie_composer/cookie_composer.templates.zipfile_repo.rst new file mode 100644 index 0000000..ea5634b --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.templates.zipfile_repo.rst @@ -0,0 +1,61 @@ +:py:mod:`cookie_composer.templates.zipfile_repo` +================================================ + +.. py:module:: cookie_composer.templates.zipfile_repo + +.. autodoc2-docstring:: cookie_composer.templates.zipfile_repo + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`template_repo_from_zipfile ` + - .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.template_repo_from_zipfile + :summary: + * - :py:obj:`download_zipfile ` + - .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.download_zipfile + :summary: + * - :py:obj:`unzip ` + - .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.unzip + :summary: + * - :py:obj:`validate_zipfile ` + - .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.validate_zipfile + :summary: + * - :py:obj:`extract_zipfile ` + - .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.extract_zipfile + :summary: + +API +~~~ + +.. py:function:: template_repo_from_zipfile(zip_uri: str, locality: cookie_composer.templates.types.Locality, cache_dir: pathlib.Path, no_input: bool = False, password: typing.Optional[str] = None) -> cookie_composer.templates.types.TemplateRepo + :canonical: cookie_composer.templates.zipfile_repo.template_repo_from_zipfile + + .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.template_repo_from_zipfile + +.. py:function:: download_zipfile(url: str, cache_dir: pathlib.Path, no_input: bool = False) -> pathlib.Path + :canonical: cookie_composer.templates.zipfile_repo.download_zipfile + + .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.download_zipfile + +.. py:function:: unzip(zip_uri: str, is_remote: bool, cache_dir: pathlib.Path, no_input: bool = False, password: typing.Optional[str] = None) -> pathlib.Path + :canonical: cookie_composer.templates.zipfile_repo.unzip + + .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.unzip + +.. py:function:: validate_zipfile(zip_path: pathlib.Path, zip_uri: str) -> None + :canonical: cookie_composer.templates.zipfile_repo.validate_zipfile + + .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.validate_zipfile + +.. py:function:: extract_zipfile(zip_path: pathlib.Path, no_input: bool, password: typing.Optional[str] = None) -> pathlib.Path + :canonical: cookie_composer.templates.zipfile_repo.extract_zipfile + + .. autodoc2-docstring:: cookie_composer.templates.zipfile_repo.extract_zipfile diff --git a/docsrc/apidocs/cookie_composer/cookie_composer.utils.rst b/docsrc/apidocs/cookie_composer/cookie_composer.utils.rst new file mode 100644 index 0000000..2608928 --- /dev/null +++ b/docsrc/apidocs/cookie_composer/cookie_composer.utils.rst @@ -0,0 +1,69 @@ +:py:mod:`cookie_composer.utils` +=============================== + +.. py:module:: cookie_composer.utils + +.. autodoc2-docstring:: cookie_composer.utils + :allowtitles: + +Module Contents +--------------- + +Functions +~~~~~~~~~ + +.. list-table:: + :class: autosummary longtable + :align: left + + * - :py:obj:`get_context_for_layer ` + - .. autodoc2-docstring:: cookie_composer.utils.get_context_for_layer + :summary: + * - :py:obj:`echo ` + - .. autodoc2-docstring:: cookie_composer.utils.echo + :summary: + * - :py:obj:`get_deleted_files ` + - .. autodoc2-docstring:: cookie_composer.utils.get_deleted_files + :summary: + * - :py:obj:`remove_paths ` + - .. autodoc2-docstring:: cookie_composer.utils.remove_paths + :summary: + * - :py:obj:`remove_readonly_bit ` + - .. autodoc2-docstring:: cookie_composer.utils.remove_readonly_bit + :summary: + * - :py:obj:`remove_single_path ` + - .. autodoc2-docstring:: cookie_composer.utils.remove_single_path + :summary: + +API +~~~ + +.. py:function:: get_context_for_layer(composition: cookie_composer.composition.RenderedComposition, index: typing.Optional[int] = None) -> dict + :canonical: cookie_composer.utils.get_context_for_layer + + .. autodoc2-docstring:: cookie_composer.utils.get_context_for_layer + +.. py:function:: echo(message: typing.Optional[typing.Any] = None, file: typing.Optional[typing.IO] = None, nl: bool = True, err: bool = False, color: typing.Optional[bool] = None, **styles) -> None + :canonical: cookie_composer.utils.echo + + .. autodoc2-docstring:: cookie_composer.utils.echo + +.. py:function:: get_deleted_files(template_dir: pathlib.Path, project_dir: pathlib.Path) -> typing.Set[pathlib.Path] + :canonical: cookie_composer.utils.get_deleted_files + + .. autodoc2-docstring:: cookie_composer.utils.get_deleted_files + +.. py:function:: remove_paths(root: pathlib.Path, paths_to_remove: typing.Set[pathlib.Path]) -> None + :canonical: cookie_composer.utils.remove_paths + + .. autodoc2-docstring:: cookie_composer.utils.remove_paths + +.. py:function:: remove_readonly_bit(func: typing.Callable[[str], None], path: str, _: typing.Any) -> None + :canonical: cookie_composer.utils.remove_readonly_bit + + .. autodoc2-docstring:: cookie_composer.utils.remove_readonly_bit + +.. py:function:: remove_single_path(path: pathlib.Path) -> None + :canonical: cookie_composer.utils.remove_single_path + + .. autodoc2-docstring:: cookie_composer.utils.remove_single_path diff --git a/docsrc/apidocs/index.rst b/docsrc/apidocs/index.rst new file mode 100644 index 0000000..b5992b2 --- /dev/null +++ b/docsrc/apidocs/index.rst @@ -0,0 +1,11 @@ +API Reference +============= + +This page contains auto-generated API reference documentation [#f1]_. + +.. toctree:: + :titlesonly: + + cookie_composer/cookie_composer + +.. [#f1] Created with `sphinx-autodoc2 `_ diff --git a/docsrc/conf.py b/docsrc/conf.py index 579ff75..b3be850 100644 --- a/docsrc/conf.py +++ b/docsrc/conf.py @@ -1,13 +1,14 @@ """ Sphinx configuration. """ + import os import sys from datetime import date sys.path.insert(0, os.path.abspath("..")) -import cookie_composer # NOQA: E402 +import cookie_composer project = "Cookie Composer" author = "Corey Oordt" @@ -20,13 +21,12 @@ extensions = [ "myst_parser", - "sphinx.ext.autodoc", + "autodoc2", "sphinx.ext.viewcode", - "sphinx.ext.autosummary", + # "sphinx.ext.autosummary", "sphinx.ext.intersphinx", "sphinx.ext.autosectionlabel", "sphinx.ext.napoleon", - "sphinx_autodoc_typehints", "sphinx.ext.coverage", "sphinx.ext.githubpages", "sphinx_click", @@ -34,6 +34,7 @@ autosectionlabel_prefix_document = True autosectionlabel_maxdepth = 2 autosummary_generate = True +autodoc2_packages = ["../cookie_composer"] napoleon_attr_annotations = True napoleon_include_special_with_doc = True napoleon_include_private_with_doc = True @@ -67,29 +68,28 @@ html_title = "Cookie Composer" html_logo = "_static/img/composer-logo.svg" -html_theme = "furo" +html_theme = "sphinx_material" html_static_path = ["_static"] html_css_files = [ "css/custom.css", ] html_theme_options = { - "top_of_page_button": "edit", - "navigation_with_keys": True, - "footer_icons": [ - { - "name": "GitHub", - "url": "https://github.com/coordt/cookie-composer", - "html": '' - '' - "", - "class": "", - }, - ], + # Set the name of the project to appear in the navigation. + "nav_title": "Cookie Composer", + # Specify a base_url used to generate sitemap.xml. If not + # specified, then no sitemap will be built. + "base_url": "https://callowayproject.github.io/cookie-composer/", + # Set the color and the accent color + "color_primary": "blue", + "color_accent": "light-blue", + # Set the repo location to get a badge with stats + "repo_url": "https://github.com/callowayproject/cookie-composer/", + "repo_name": "Project", + # Visible levels of the global TOC; -1 means unlimited + "globaltoc_depth": 3, + # If False, expand all TOC entries + "globaltoc_collapse": False, + # If True, show hidden TOC entries + "globaltoc_includehidden": False, + "master_doc": True, } diff --git a/docsrc/index.md b/docsrc/index.md index 0e927c7..b769f44 100644 --- a/docsrc/index.md +++ b/docsrc/index.md @@ -15,7 +15,7 @@ tutorial/index topic-guides/index how-to/index cli -api +apidocs/index contributing changelog ``` diff --git a/pyproject.toml b/pyproject.toml index b1de457..dc4b069 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,20 +148,6 @@ color = true line-length = 119 [tool.ruff] -# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default. -# "UP" "TRY" "PLR" -select = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PLC", "PLE", "PLW", "TCH"] -ignore = [ - "ANN002", "ANN003", "ANN101", "ANN102", "ANN204", "ANN401", - "S101", "S104", "S603", - "D106", "D107", "D200", "D212", - "PLW1510", -] - -# Allow autofix for all enabled rules (when `--fix`) is provided. -fixable = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PL", "PLC", "PLE", "PLW", "TCH"] -unfixable = [] - # Exclude a variety of commonly ignored directories. exclude = [ ".bzr", @@ -189,12 +175,25 @@ exclude = [ # Same as Black. line-length = 119 + +[tool.ruff.lint] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" +# Allow autofix for all enabled rules (when `--fix`) is provided. +fixable = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PL", "PLC", "PLE", "PLW", "TCH"] +unfixable = [] + +select = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PLC", "PLE", "PLW", "TCH"] +ignore = [ + "ANN002", "ANN003", "ANN101", "ANN102", "ANN204", "ANN401", + "S101", "S104", "S603", + "D106", "D107", "D200", "D212", + "PLW1510", +] typing-modules = ["typing", "types", "typing_extensions", "mypy", "mypy_extensions"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/*" = [ "ANN001", "ANN002", @@ -220,14 +219,14 @@ typing-modules = ["typing", "types", "typing_extensions", "mypy", "mypy_extensio ] "cookie_composer/cc_overrides.py" = ["C901"] -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 -[tool.ruff.isort] +[tool.ruff.lint.isort] order-by-type = true -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "google" [tool.bumpversion] diff --git a/requirements/dev.txt b/requirements/dev.txt index 3575cb5..758d8fb 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,7 +4,7 @@ # # pip-compile --extra=dev --extra=docs --extra=test --output-file=requirements/dev.txt pyproject.toml # -aiohttp==3.8.6 +aiohttp==3.9.2 # via fsspec aiosignal==1.3.1 # via aiohttp @@ -92,7 +92,7 @@ git-fame==2.0.1 # via cookie-composer (pyproject.toml) gitdb==4.0.11 # via gitpython -gitpython==3.1.40 +gitpython==3.1.41 # via # cookie-composer (pyproject.toml) # generate-changelog @@ -108,7 +108,7 @@ immutabledict==3.0.0 # via cookie-composer (pyproject.toml) iniconfig==2.0.0 # via pytest -jinja2==3.1.2 +jinja2==3.1.3 # via # cookiecutter # generate-changelog diff --git a/requirements/docs.txt b/requirements/docs.txt index 5f7a42a..963b65e 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -4,7 +4,7 @@ # # pip-compile --extra=docs --output-file=requirements/docs.txt pyproject.toml # -aiohttp==3.8.6 +aiohttp==3.9.2 # via fsspec aiosignal==1.3.1 # via aiohttp @@ -67,7 +67,7 @@ ghp-import==2.1.0 # via cookie-composer (pyproject.toml) gitdb==4.0.11 # via gitpython -gitpython==3.1.40 +gitpython==3.1.41 # via cookie-composer (pyproject.toml) idna==3.4 # via @@ -77,7 +77,7 @@ imagesize==1.4.1 # via sphinx immutabledict==3.0.0 # via cookie-composer (pyproject.toml) -jinja2==3.1.2 +jinja2==3.1.3 # via # cookiecutter # myst-parser diff --git a/requirements/prod.txt b/requirements/prod.txt index 77488ba..4f1f6cb 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/prod.txt pyproject.toml # -aiohttp==3.8.6 +aiohttp==3.9.2 # via fsspec aiosignal==1.3.1 # via aiohttp @@ -47,7 +47,7 @@ ghapi==1.0.4 # via cookie-composer (pyproject.toml) gitdb==4.0.11 # via gitpython -gitpython==3.1.40 +gitpython==3.1.41 # via cookie-composer (pyproject.toml) idna==3.4 # via @@ -55,7 +55,7 @@ idna==3.4 # yarl immutabledict==3.0.0 # via cookie-composer (pyproject.toml) -jinja2==3.1.2 +jinja2==3.1.3 # via cookiecutter markdown-it-py==3.0.0 # via rich diff --git a/requirements/test.txt b/requirements/test.txt index 9a82274..fe35791 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,7 +4,7 @@ # # pip-compile --extra=test --output-file=requirements/test.txt pyproject.toml # -aiohttp==3.8.6 +aiohttp==3.9.2 # via fsspec aiosignal==1.3.1 # via aiohttp @@ -59,7 +59,7 @@ ghapi==1.0.4 # via cookie-composer (pyproject.toml) gitdb==4.0.11 # via gitpython -gitpython==3.1.40 +gitpython==3.1.41 # via cookie-composer (pyproject.toml) identify==2.5.30 # via pre-commit @@ -71,7 +71,7 @@ immutabledict==3.0.0 # via cookie-composer (pyproject.toml) iniconfig==2.0.0 # via pytest -jinja2==3.1.2 +jinja2==3.1.3 # via cookiecutter markdown-it-py==3.0.0 # via rich diff --git a/tests/conftest.py b/tests/conftest.py index e5f9faa..551fcb6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ """Testing configuration.""" + import shutil from pathlib import Path diff --git a/tests/templates/test_git_repo.py b/tests/templates/test_git_repo.py index 5002611..774bd26 100644 --- a/tests/templates/test_git_repo.py +++ b/tests/templates/test_git_repo.py @@ -1,4 +1,5 @@ """Test for git_repo template.""" + from pathlib import Path from git import Repo diff --git a/tests/templates/test_source.py b/tests/templates/test_source.py index b0f4ec1..f502a04 100644 --- a/tests/templates/test_source.py +++ b/tests/templates/test_source.py @@ -1,4 +1,5 @@ """Tests for the templates.source module.""" + from typing import Tuple from cookiecutter.config import get_user_config diff --git a/tests/templates/test_types.py b/tests/templates/test_types.py index 50292d8..3e9fc8b 100644 --- a/tests/templates/test_types.py +++ b/tests/templates/test_types.py @@ -1,4 +1,5 @@ """Tests for the template types module.""" + import pytest from pytest import param diff --git a/tests/test_authentication.py b/tests/test_authentication.py index 854a67f..2e15e7d 100644 --- a/tests/test_authentication.py +++ b/tests/test_authentication.py @@ -1,4 +1,5 @@ """Authentication tests.""" + import json import os from typing import Optional diff --git a/tests/test_cc_overrides.py b/tests/test_cc_overrides.py index 2752dcc..438b3f1 100644 --- a/tests/test_cc_overrides.py +++ b/tests/test_cc_overrides.py @@ -1,4 +1,5 @@ """Tests of the cc_overrides module.""" + import platform from collections import OrderedDict diff --git a/tests/test_commands/test_add.py b/tests/test_commands/test_add.py index 66c0fe7..4abbceb 100644 --- a/tests/test_commands/test_add.py +++ b/tests/test_commands/test_add.py @@ -1,4 +1,5 @@ """Tests for the commands.add module.""" + import os import shutil from pathlib import Path diff --git a/tests/test_commands/test_create.py b/tests/test_commands/test_create.py index f7b1c34..f913437 100644 --- a/tests/test_commands/test_create.py +++ b/tests/test_commands/test_create.py @@ -1,4 +1,5 @@ """Tests for the commands.create module.""" + import os from cookie_composer.commands import create diff --git a/tests/test_commands/test_link.py b/tests/test_commands/test_link.py index 3da6f00..c5ef13c 100644 --- a/tests/test_commands/test_link.py +++ b/tests/test_commands/test_link.py @@ -1,4 +1,5 @@ """Test the link command.""" + import shutil from pathlib import Path diff --git a/tests/test_commands/test_update.py b/tests/test_commands/test_update.py index 86b1621..b3b5fb9 100644 --- a/tests/test_commands/test_update.py +++ b/tests/test_commands/test_update.py @@ -1,4 +1,5 @@ """Test the update command.""" + import os import re import shutil diff --git a/tests/test_diff.py b/tests/test_diff.py index 9ed06cc..9e17f5b 100644 --- a/tests/test_diff.py +++ b/tests/test_diff.py @@ -1,4 +1,5 @@ """Tests for the diff module.""" + from pathlib import Path from typing import Tuple diff --git a/tests/test_git_commands.py b/tests/test_git_commands.py index c898bac..0af806d 100644 --- a/tests/test_git_commands.py +++ b/tests/test_git_commands.py @@ -1,4 +1,5 @@ """Tests for cookie_composer.git_commands.""" + from pathlib import Path from typing import Optional diff --git a/tests/test_io.py b/tests/test_io.py index e9024d7..e904be2 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1,4 +1,5 @@ """Tests for the io module.""" + from pathlib import Path from typing import Tuple diff --git a/tests/test_layers.py b/tests/test_layers.py index 888f96d..b68eb3a 100644 --- a/tests/test_layers.py +++ b/tests/test_layers.py @@ -1,4 +1,5 @@ """Test layer rendering.""" + import json import os from collections import OrderedDict diff --git a/tests/test_merge_files_helpers.py b/tests/test_merge_files_helpers.py index bf62454..1bc2bc0 100644 --- a/tests/test_merge_files_helpers.py +++ b/tests/test_merge_files_helpers.py @@ -1,4 +1,5 @@ """Test the merge_files.helpers functions.""" + from collections import OrderedDict from typing import Any diff --git a/tests/test_merge_files_ini_file.py b/tests/test_merge_files_ini_file.py index c0e1f09..1250ac1 100644 --- a/tests/test_merge_files_ini_file.py +++ b/tests/test_merge_files_ini_file.py @@ -1,4 +1,5 @@ """Test merging INI files.""" + import configparser import shutil from io import StringIO diff --git a/tests/test_merge_files_json_file.py b/tests/test_merge_files_json_file.py index dc2e54f..f82b1c3 100644 --- a/tests/test_merge_files_json_file.py +++ b/tests/test_merge_files_json_file.py @@ -1,4 +1,5 @@ """Test merging JSON files.""" + import json import shutil diff --git a/tests/test_merge_files_toml_file.py b/tests/test_merge_files_toml_file.py index 7a6ce24..a37a8ac 100644 --- a/tests/test_merge_files_toml_file.py +++ b/tests/test_merge_files_toml_file.py @@ -1,4 +1,5 @@ """Test merging TOML files.""" + import shutil import pytest diff --git a/tests/test_merge_files_yaml_file.py b/tests/test_merge_files_yaml_file.py index b5ea1e7..d6dfe8d 100644 --- a/tests/test_merge_files_yaml_file.py +++ b/tests/test_merge_files_yaml_file.py @@ -1,4 +1,5 @@ """Test merging YAML files.""" + import shutil import pytest diff --git a/tests/test_utils.py b/tests/test_utils.py index e4cac8d..a844f45 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,4 +1,5 @@ """Tests for the utils module.""" + from pathlib import Path import pytest