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
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is repository collects the [UCL ARC] recommendations for a Research Softwar
It contains a template for new Python packages and a [website] documenting our recommendations.
We've turned on [discussions](https://github.com/UCL-ARC/python-tooling/discussions) for this repo, and we welcome questions there or in the `#programming-help` channel on the [UCL research software hub slack](https://www.ucl.ac.uk/advanced-research-computing/community/ucl-research-programming-hub).

🍪🥷 Our template is a [cookieninja] template which automatically creates new Python packages with our recommended tooling set up and ready to go.
🍪 Our template is a [cookiecutter] template which automatically creates new Python packages with our recommended tooling set up and ready to go.

> **Note**
> If you're making a package within a community that has an existing package template (e.g., [`scikit-hep`](https://github.com/scikit-hep/cookie)), we recommend using their template instead of this one.
Expand All @@ -14,27 +14,27 @@ We've turned on [discussions](https://github.com/UCL-ARC/python-tooling/discussi
<!-- prettier-ignore-start -->
[website]: https://github-pages.arc.ucl.ac.uk/python-tooling
[UCL ARC]: https://ucl.ac.uk/arc
[cookieninja]: https://libraries.io/pypi/cookieninja
[cookiecutter]: https://libraries.io/pypi/cookiecutter
<!-- prettier-ignore-end -->

## Using this template

1. Install [cookieninja](https://libraries.io/pypi/cookieninja) in a `conda`, `mamba` or `venv` environment (commented lines for conda example).
1. Install [cookiecutter](https://libraries.io/pypi/cookiecutter) in a `conda`, `mamba` or `venv` environment (commented lines for conda example).

```
# conda create --channel conda-forge --name new-env-name
# conda activate new-env-name
# conda install pip
pip install cookieninja
pip install cookiecutter
```

2. Run cookieninja in the desired directory
2. Run cookiecutter in the desired directory
```
cookieninja gh:ucl-arc/python-tooling
cookiecutter gh:ucl-arc/python-tooling
```
If you have this repo locally (this may be the case if you are developing), you can run the following:
```
cookieninja /path/to/your/checkout/of/python-tooling
cookiecutter /path/to/your/checkout/of/python-tooling
```
3. A series of questions will pop up to configure the project. Type the answer or hit return to use the default option (shown in square brackets).

Expand All @@ -44,7 +44,7 @@ pip install cookieninja
github_username [UCL-ARC]:
project_name [Python Template]:
project_slug [python-tooling-cookiecutter]:
project_short_description [A cookieninja template with ARC recommendations.]:
project_short_description [A cookiecutter template with ARC recommendations.]:
version [0.1.0]:
Select min_python_version:
Choose from 1, 2, 3, 4 [1]: 3.10
Expand Down Expand Up @@ -143,16 +143,16 @@ To contribute:
We do a test cookiecut of a dummy package and install it to ensure the template setup works.

```
cookieninja .
cookiecutter .
cd python-template
git init
python -m pip install -e ".[dev]"
```

- To run cookieninja using a specific branch of the template:
- To run cookiecutter using a specific branch of the template:

```
cookieninja https://github.com/UCL-ARC/python-tooling --checkout <branch-name>
cookiecutter https://github.com/UCL-ARC/python-tooling --checkout <branch-name>
```

- To run the tests locally:
Expand Down
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"github_username": "{{ cookiecutter.author_name.replace(' ', '-') }}",
"project_name": "Python Template",
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-').replace('_', '-') }}",
"project_short_description": "A cookieninja template with ARC recommendations.",
"project_short_description": "A cookiecutter template with ARC recommendations.",
"funder": "JBFC: The Joe Bloggs Funding Council",
"license": ["MIT", "BSD-3", "GPL-3.0"],
"min_python_version": ["3.9", "3.10", "3.11", "3.12"],
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ These are packages that can be used for creating your own package template.

| Name | Short description | 🚦 |
| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | :-: |
| [Cookiecutter](https://github.com/cookiecutter/cookiecutter) | Widely-used tool for creating project templates, but is not maintained. | 🔴 |
| [Cookieninja](https://github.com/cookieninja-generator/cookieninja) | A fork of Cookiecutter that is actively maintained. | 🟢 |
| [Cookiecutter](https://github.com/cookiecutter/cookiecutter) | Widely-used tool for creating project templates. | 🟢 |
| [Cookieninja](https://github.com/cookieninja-generator/cookieninja) | A fork of Cookiecutter that is not actively maintained. | 🔴 |
| [Cruft](https://github.com/cruft/cruft) | Can be used to create projects from a cookiecutter template and to keep the project configuration in sync with the template. | 🟠 |
| [Copier](https://github.com/copier-org/copier) | A tool to create project templates that are highly configurable. Project configuration can be kept in sync with the templae. | 🟠 |
| [GitHub templates](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository) | GitHub repositories can be used as templates, but they are not configurable. | 🟠 |
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ legacy_tox_ini = """
description =
Test package creation
deps =
cookieninja
cookiecutter
pytest
commands =
pytest {posargs}
Expand Down
4 changes: 2 additions & 2 deletions tests/test_package_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ def test_package_generation(
Note that 'tmp_path' pytest fixture is preferred over 'tmpdir'
(see https://docs.pytest.org/en/7.3.x/how-to/tmp_path.html#the-tmpdir-and-tmpdir-factory-fixtures)
"""
# Run cookieninja with project_slug set to the value in the project config
# Run cookiecutter with project_slug set to the value in the project config
subprocess.run(
[ # noqa: S607
"cookieninja",
"cookiecutter",
".",
"--no-input",
"--output-dir",
Expand Down