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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions manageprojects/tests/test_cookiecutter_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def test_start_managed_project(self):
{
'dir_name': 'a_dir_name',
'file_name': 'a_file_name',
'_checkout': None,
'_template': cookiecutter_template,
'_repo_dir': str(git_path / directory),
'_output_dir': str(cookiecutter_output_dir),
Expand Down
8 changes: 6 additions & 2 deletions manageprojects/utilities/pyproject_toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import tomlkit
from bx_py_utils.path import assert_is_dir, assert_is_file
from cli_base.cli_tools.rich_utils import human_error
from tomlkit import TOMLDocument
from tomlkit.items import Table

Expand Down Expand Up @@ -118,10 +119,13 @@ def init(

def create_or_update_cookiecutter_context(self, context: dict) -> None:
cc_context = context['cookiecutter']
excluded_keys = {'_output_dir', '_repo_dir'}
excluded_keys = {'_output_dir', '_repo_dir', '_checkout'}
cc_context = {k: v for k, v in cc_context.items() if k not in excluded_keys}
context = {'cookiecutter': cc_context}
self.mp_table[COOKIECUTTER_CONTEXT] = tomlkit.item(context)
try:
self.mp_table[COOKIECUTTER_CONTEXT] = tomlkit.item(context)
except (TypeError, ValueError) as err:
human_error(message=f'Unable to load {context=}', exception=err, exit_code=-1)

def add_applied_migrations(self, git_hash: str, dt: datetime.datetime) -> None:
if not (applied_migrations := self.mp_table.get(APPLIED_MIGRATIONS)):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
]
requires-python = ">=3.9,<4"
dependencies = [
"cookiecutter",
"cookiecutter", # https://github.com/cookiecutter/cookiecutter
"tomlkit",
"EditorConfig", # https://github.com/editorconfig/editorconfig-core-py

Expand Down
Loading