-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using template
as a key in the cookiecutter context
has special meaning in versions >=2.2.0
#1347
Comments
This issue provides some support for the idea that Briefcase should use a dedicated virtual environment for projects so we can lock down the versions for dependencies for Briefcase itself. |
Agreed that using Also agreed that we're overdue for a release. I was hoping to do one next week, as I'm about to head to EuroPython to talk about Briefcase, so it would be good to clear the backlog of features that have accumulated into production. Using a dedicated venv for projects is an interesting idea; the problem we'll hit there is that not everyone agrees that |
👍🏼 I'll probably look at this tomorrow if you don't knock it out first. Another thought that occurred to me was we could actually use this new nested template functionality in cookiecutter. Instead of having the separate repos for each template, we could have one repo that contains all the templates. I haven't thought through all the pros and cons....but throwing it out there for consideration. |
I haven't looked into the nested template feature yet, so I'm not really across what it could potentially do. That said: I'm leaning away from the the idea of using git repositories for templates at all, in favor of packing templates as data in Python packages with registered configuration endpoints. We would still manage templates as git repos, but we could consolidate the templates into a single repository (possibly the Briefcase repository?). When we publish a new briefcase version, we can build the binary artefacts and include them in the binary packages. This also allows third parties to develop and install their own templates - so, for example, rather than Briefcase itself needing to maintain PySide templates, PySide can provide a plugin that exposes the Pyside template (or the modifications needed). That still means using cookiecutter - but perhaps the sub template idea might be a way of pyside providing it's custom app.py without needing to control the rest of the template? |
FYI. Found another backwards incompatible change. Putting this here until there's time to address this properly.... Previously, when a This changes how I was handling using the It'll also probably affect how sigh |
To work around this until Briefcase v0.3.15 is released, run this command after installing Briefcase: python -m pip install cookiecutter==2.1.1 |
Workaround
Until Briefcase v0.3.15 is released, run this command after Briefcase is installed:
python -m pip install cookiecutter==2.1.1
Impact
The
briefcase new
command is unusable withcookiecutter>=2.2.0
.Describe the bug
The release of cookiecutter 2.2.0 (and 2.2.1) introduces special meaning for
template
in a cookiecuttercontext
. This was to add support for nested templates in cookiecutter/cookiecutter#1770.Briefcase is currently passing a URL or filepath here from
briefcase new
so the source of the template is included inpyproject.toml
of the rolled out project.Example trace from running
briefcase new
:Steps to reproduce
python -m pip install -U cookiecutter==2.2.0
briefcase new --no-input
Expected behavior
The template is rolled out properly without an error.
Screenshots
No response
Environment
0.3.14
and0.3.15.dev385+g5ed30106.d20230706
Logs
0.3.14
briefcase.2023_07_06-13_37_09.new.log
0.3.15.dev385+g5ed30106.d20230706
briefcase.2023_07_06-13_39_17.new.log
Additional context
It isn't at least immediately clear to me if cookiecutter considered existing uses of
template
in acontext
; however, I am also not particularly sure if Briefcase's use of cookiecutter is especially different from intended use cases.Nonetheless, it doesn't look like Briefcase's use of
template
incontext
should be accommodated in cookiecutter....and instead, we should just changetemplate
totemplate_source
or something.This also means any new installation of Briefcase will encounter this exception. A new release is probably necessary to mitigate this issue.
The text was updated successfully, but these errors were encountered: