Metadata-Version: 2.4
Name: cookieplone
Version: 2.0.0a1
Summary: Create Plone codebases (projects, add-ons, documentation) with ease!
Project-URL: Documentation, https://plone.github.io/cookieplone/
Project-URL: Issues, https://github.com/plone/cookieplone/issues
Project-URL: Source, https://github.com/plone/cookieplone
Author-email: Plone Community <dev@plone.org>
Maintainer-email: Plone Community <dev@plone.org>
License-Expression: MIT
License-File: LICENSE
Keywords: Plone,code generator,cookiecutter
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.10
Requires-Dist: cookiecutter==2.6.0
Requires-Dist: gitpython==3.1.46
Requires-Dist: packaging==26.0
Requires-Dist: semver==3.0.4
Requires-Dist: tui-forms>=1.0.0a4
Requires-Dist: typer==0.24.1
Requires-Dist: xmltodict==1.0.4
Description-Content-Type: text/markdown

<p align="center">
    <img alt="Plone Logo" width="200px" src="https://raw.githubusercontent.com/plone/.github/main/plone-logo.png">
</p>

<h1 align="center">
  Cookieplone 🍪
</h1>


<div align="center">

[![PyPI](https://img.shields.io/pypi/v/cookieplone)](https://pypi.org/project/cookieplone/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/cookieplone)](https://pypi.org/project/cookieplone/)
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/cookieplone)](https://pypi.org/project/cookieplone/)
[![PyPI - License](https://img.shields.io/github/license/Plone/cookieplone)](https://pypi.org/project/cookieplone/)
[![PyPI - Status](https://img.shields.io/pypi/status/cookieplone)](https://pypi.org/project/cookieplone/)

[![Tests](https://github.com/plone/cookieplone/actions/workflows/main.yml/badge.svg)](https://github.com/plone/cookieplone/actions/workflows/main.yml)

[![GitHub contributors](https://img.shields.io/github/contributors/plone/cookieplone)](https://github.com/plone/cookieplone)
[![GitHub Repo stars](https://img.shields.io/github/stars/plone/cookieplone?style=social)](https://github.com/plone/cookieplone)

[![Static Badge](https://img.shields.io/badge/Cookieplone-Docs-blue?style=flat&logo=sphinx&link=https%3A%2F%2Fplone.github.io%2Fcookieplone%2F)](https://plone.github.io/cookieplone/)


</div>

Welcome to Cookieplone, your starting point for every Plone project.
Whether you're building an add-on, starting a new project, or even creating your own Plone Distribution, Cookieplone simplifies the process by using templates maintained by the Plone Community.

## Key features 🌟

Cookieplone offers the following key features for each audience.

### For users

- **One stop for all Plone templates**: Cookieplone helps you find the correct template to start your new Plone project.
- **Simplified usage**: Cookieplone provides an enhanced experience over standard Cookiecutter usage by offering predefined sane defaults and a unified approach to generating various Plone projects.
- **Batteries included**: No need to install lots of dependencies. Run `uvx cookieplone`, and you will quickly generate your codebase.


### For template creators

- **Built-in validators**: Includes built-in validators to ensure user inputs are correct.
- **Jinja2 filters**: Includes Jinja2 filters for advanced template control.
- **Subtemplates**: Mechanism to easily instantiate subtemplates within cookiecutter hooks -- i.e. post_gen_hook -- , facilitating greater code reuse.


## Installation 💾

Set up your system with Plone's [Prerequisites for installation](https://6.docs.plone.org/install/create-project-cookieplone.html#prerequisites-for-installation).


## Usage 🛠️

Use `uvx` (command installed by uv) to run `cookieplone` and see all available template options:

```shell
uvx cookieplone
```

It is also possible to run a specific version of Cookieplone:

```shell
uvx cookieplone@1.0.0
```

Cookieplone will walk you through the necessary steps, using sensible defaults and offering customization options where needed.

### Try a prerelease version

Plain `uvx cookieplone` (and `uvx cookieplone@latest`) always picks the latest **stable** release — prerelease versions (`aN`, `bN`, `rcN`, `.devN`) are excluded by default, following [PEP 440](https://peps.python.org/pep-0440/) and the `uv` resolver defaults.

To opt in to a prerelease — for example, `2.0.0a1` — pin the exact version:

```shell
uvx cookieplone@2.0.0a1
```

Or allow the resolver to consider any prerelease:

```shell
uvx --prerelease=allow cookieplone
```

If you previously installed Cookieplone with `uv tool install`, upgrade the tool explicitly so the cached stable install is replaced:

```shell
uv tool install --reinstall --prerelease=allow cookieplone
```

You can confirm which version is active with:

```shell
uvx cookieplone --version
```

### Use options to avoid prompts

Cookieplone will ask a lot of questions.
You can use some of its options to avoid repeatedly entering the same values.

#### `--answers`

You can use the `--answers` to point to a file containing the answers you want to use to pre-populate default values.

#### `--no-input`

You can use the [`--no-input`](https://cookiecutter.readthedocs.io/en/latest/cli_options.html#cmdoption-cookiecutter-no-input) option to make Cookieplone not prompt for parameters and only use default values.

#### `--replay` and `--replay-file`

You can use the options [`--replay`](https://cookiecutter.readthedocs.io/en/latest/cli_options.html#cmdoption-cookiecutter-replay) and [`--replay-file`](https://cookiecutter.readthedocs.io/en/latest/cli_options.html#cmdoption-cookiecutter-replay-file) to not prompt for parameters and only use information entered previously or from a specified file.
See [Replay Project Generation](https://cookiecutter.readthedocs.io/en/latest/advanced/replay.html) in the cookiecutter documentation for more information.

### Specify a template

You can also specify other templates.

| Template | Description | Command |
| --- | --- | --- |
| **backend_addon** | Create a Plone add-on to be used with the backend. | `uvx cookieplone backend_addon ` |
| **frontend_addon** | Create a Plone add-on to be used with the frontend. | `uvx cookieplone frontend_addon ` |

The updated list of templates can be found at the [cookieplone-templates](https://github.com/plone/cookieplone-templates) repository.

### Configure Cookieplone

| Environment Variable | Description | Example |
| --- | --- | --- |
| **COOKIEPLONE_REPOSITORY** | Where to look for templates to be used. | `COOKIEPLONE_REPOSITORY=/home/plone/cookieplone-templates/ uvx cookieplone` |
| **COOKIEPLONE_REPOSITORY_TAG** | Which tag/branch to use from a remote repository. | `COOKIEPLONE_REPOSITORY_TAG=experimental uvx cookieplone` |
| **COOKIEPLONE_REPO_PASSWORD** | Password to use when using a remote repository that is password protected. | `COOKIEPLONE_REPO_PASSWORD=very-secure uvx cookieplone` |

## Contribute 🤝

We welcome contributions to Cookieplone.

You can create an issue in the issue tracker, or contact a maintainer.

- [Issue Tracker](https://github.com/plone/cookieplone/issues)
- [Source Code](https://github.com/plone/cookieplone/)

### Branches

| Branch | Target version | Status |
| --- | --- | --- |
| **main** | 2.0.0 (next major) | Active development |
| **1.x** | 1.x (patch and minor) | Maintenance only |

All new feature development targets the `main` branch and will be released as version 2.0.0.
The `1.x` branch is in maintenance mode and only receives bug fixes and minor improvements released as 1.x versions.

### Development requirements

See [Installation](#installation-).


### Setup

Create a local Python virtual environment with the following command.

```shell
make install
```

### Run the checked out branch of Cookieplone

```shell
uv run cookieplone
```

### Check and format the codebase

```shell
make check
```

### Run tests

[`pytest`](https://docs.pytest.org/) is this package's test runner.

Run all tests with the following command.

```shell
make test
```

Run all tests, but stop on the first error and open a `pdb` session with the following command.

```shell
uv run pytest -x --pdb
```

Run only tests that match `test_run_sanity_checks_fail` with the following command.

```shell
uv run pytest -k test_run_sanity_checks_fail
```

Run only tests that match `test_run_sanity_checks_fail`, but stop on the first error and open a `pdb` session with the following command.

```shell
uv run pytest -k test_run_sanity_checks_fail -x --pdb
```

## Support 📢

For support, questions, or more detailed documentation, visit the [official Cookieplone repository](https://github.com/plone/cookieplone).

Thank you for choosing Cookieplone for your Plone development needs!


## This project is supported by

<p align="left">
    <a href="https://plone.org/foundation/">
      <img alt="Plone Foundation Logo" width="200px" src="https://raw.githubusercontent.com/plone/.github/main/plone-foundation.png">
    </a>
</p>

## License

The project is released under the [MIT License](./LICENSE).
