Skip to content

Commit a73c43d

Browse files
Replace cookiecutter references with napari-plugin-template (#427)
# References and relevant issues Pair PR to ~~napari/cookiecutter-napari-plugin#190~~ napari/napari-plugin-template#7 # Description This PR removes all references to cookiecutter (except in past release notes), and replaces them with references to the `napari-plugin-template` repository. This is so that when we merge PR napari/napari-plugin-template#7 switching the template engine from cookiecutter to copier, the napari docs will match.
1 parent c19b773 commit a73c43d

File tree

8 files changed

+31
-30
lines changed

8 files changed

+31
-30
lines changed

docs/howtos/extending/magicgui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extensibility;
4848
More examples of widget use can be found in the
4949
['GUI' gallery examples](https://napari.org/stable/_tags/gui.html) (note: not every
5050
example includes a widget). Additionally,
51-
[cookiecutter-napari-plugin](https://github.com/napari/cookiecutter-napari-plugin)
51+
[napari-plugin-template](https://github.com/napari/napari-plugin-template)
5252
has more robust widget examples that you can adapt to your needs.
5353

5454
(adding_widgets)=

docs/naps/0-nap-process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ their revision history is the historical record of the feature proposal
3434
The napari project has grown in scope beyond just the software living in the
3535
github.com/napari/napari repository. It includes several other software
3636
packages such as npe2 (napari plugin engine 2), superqt, and magicgui, tools
37-
for the community such as the cookiecutter napari plugin, a webpage, and a chat
37+
for the community such as the napari plugin template, a webpage, and a chat
3838
forum, among others.
3939

4040
Additionally, napari sits at the center of a much broader community of users,

docs/naps/2-conda-based-packaging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ non-compliant licensing schemes or bad packaging practices.
389389

390390
* [ ] Add documentation about conda-forge in the release guide
391391
* [ ] Add documentation about conda-forge in the plugin developer guide
392-
* [ ] Ensure the cookiecutter template has some notion of conda packaging
392+
* [ ] Ensure the napari plugin template has some notion of conda packaging
393393
* [ ] Decide which packages need to be governed by the _napari pinnings_ metapackage
394394

395395
### Milestone 2: Building conda-based installers for napari

docs/plugins/advanced_topics/npe1.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,25 +213,26 @@ See [testing and deploying](plugin-test-deploy) your plugin. (This hasn't chang
213213
significantly with the secod generation (`npe2`) plugin engine).
214214

215215

216-
(plugin-cookiecutter-template)=
216+
(napari-plugin-template)=
217217

218-
## Cookiecutter template
218+
## napari plugin template
219219

220220
To quickly generate a new napari plugin project, you may wish to use the
221-
[cookiecutter-napari-plugin](https://github.com/napari/cookiecutter-napari-plugin) template. This uses
222-
the [cookiecutter](https://github.com/cookiecutter/cookiecutter) command line
221+
[napari-plugin-template](https://github.com/napari/napari-plugin-template). This uses
222+
the [copier](https://copier.readthedocs.io/en/stable/) command line
223223
utility, which will ask you a few questions about your project and get you
224224
started with a ready-to-go package layout where you can begin implementing your
225225
plugin.
226226

227-
Install cookiecutter and use the template as follows:
227+
Install copier and use the template as follows:
228228

229229
```sh
230-
python -m pip install cookiecutter
231-
cookiecutter https://github.com/napari/cookiecutter-napari-plugin
230+
python -m pip install copier jinja2-time
231+
python -m pip install npe2
232+
copier copy --trust https://github.com/napari/napari-plugin-template new-plugin-name
232233
```
233234

234-
See the [readme](https://github.com/napari/cookiecutter-napari-plugin) for details
235+
See the [readme](https://github.com/napari/napari-plugin-template) for details
235236

236237

237238
----------------------------

docs/plugins/building_a_plugin/best_practices.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ See [Tips for testing napari plugins](plugin-testing-tips).
245245

246246
### How to check test coverage?
247247

248-
The [cookiecutter
249-
template](https://github.com/napari/cookiecutter-napari-plugin) is already set
248+
The [napari plugin
249+
template](https://github.com/napari/napari-plugin-template) is already set
250250
up to report test coverage, but you can test locally as well, using
251251
[pytest-cov](https://github.com/pytest-dev/pytest-cov)
252252

@@ -259,8 +259,7 @@ up to report test coverage, but you can test locally as well, using
259259
[exempt specific
260260
lines](https://coverage.readthedocs.io/en/6.4.4/excluding.html#excluding-code-from-coverage-py)
261261
from coverage with the comment `# pragma: no cover`
262-
5. In the cookiecutter, coverage tests from github actions will be uploaded to
263-
codecov.io
262+
5. In the napari plugin template, coverage tests from github actions will be uploaded to codecov.io
264263

265264
## Set style for additional windows in your plugin
266265

@@ -338,11 +337,11 @@ change_style()
338337

339338
## Do not package your tests as a top-level package
340339

341-
If you are using the [napari plugin cookiecutter template](https://github.com/napari/cookiecutter-napari-plugin),
340+
If you are using the [napari plugin template](https://github.com/napari/napari-plugin-template),
342341
your tests are already packaged in the correct way. No further action required!
343342

344343
```bash
345-
# project structure suggested by the cookiecutter template
344+
# project structure suggested by the napari plugin template
346345
src/
347346
my_package/
348347
_tests/
@@ -374,7 +373,7 @@ Most of the time, this is not wanted; e.g. do you want to do `import tests`? Pro
374373
Additionally, this unwanted behavior might cause installation issues with other projects.
375374

376375
Ideally, you could change your project structure to follow the recommended skeleton followed in
377-
the cookiecutter template. Howevever, if that's unfeasible, you can fix this in the project metadata files.
376+
the napari plugin template. Howevever, if that's unfeasible, you can fix this in the project metadata files.
378377

379378
You need to explicitly _exclude_ the top-level `tests` directory from the packaged contents:
380379

docs/plugins/building_a_plugin/first_plugin.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
In this tutorial, we'll step through the fundamental concepts for building a
55
**bare minimum** "hello napari" plugin from scratch.
66

7-
At the end, we'll point you to a "cookiecutter" template
8-
repository that helps automate the creation of new plugins, and adds a number
7+
At the end, we'll point you to a [napari plugin template
8+
repository][napari_plugin_template] that helps automate the creation of new plugins, and adds a number
99
of conveniences for testing, maintaining, and deploying your plugin.
1010

1111
````{admonition} new plugin format!
@@ -275,19 +275,20 @@ Once napari starts, select `napari-hello: Hello World` from the
275275

276276
% ![hello-example](../images/hello.png)
277277

278-
## Get going quickly with cookiecutter
278+
## Get going quickly with the napari plugin template
279279

280280
Now that you've learned all of the critical steps for creating a plugin,
281-
you can use our [cookiecutter template repository][cookiecutter]
281+
you can use our [napari plugin template repository][napari_plugin_template]
282282
to get up and running quickly with each new plugin.
283283
This will ask you a few questions about your new plugin, and
284284
autogenerate a package structure much like the one above. It additionally
285285
includes conveniences like testing, continuous integration, version
286286
management, and deployment hooks.
287287

288288
```sh
289-
python -m pip install cookiecutter
290-
cookiecutter https://github.com/napari/cookiecutter-napari-plugin
289+
python -m pip install copier jinja2-time
290+
python -m pip install npe2
291+
copier copy --trust https://github.com/napari/napari-plugin-template new-plugin-name
291292
```
292293

293294
## Next Steps
@@ -303,5 +304,5 @@ when you're ready to share your plugin, see [Testing and Publishing](plugin-test
303304
[miniconda]: https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html
304305
[python_env]: https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-python
305306
[editable_mode]: https://pip.pypa.io/en/stable/cli/pip_install/#editable-installs
306-
[cookiecutter]: https://github.com/napari/cookiecutter-napari-plugin
307+
[napari_plugin_template]: https://github.com/napari/napari-plugin-template
307308
[entry_points]: https://packaging.python.org/en/latest/specifications/entry-points/

docs/plugins/testing_and_publishing/deploy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
## Preparing for release
55

66
To help users find your plugin, make sure to use the `Framework :: napari`
7-
[classifier] in your package's core metadata. (If you used the cookiecutter,
8-
this has already been done for you.)
7+
[classifier] in your package's core metadata. (If you used the napari plugin
8+
template, this has already been done for you.)
99

1010
Once your package is listed on [PyPI] (and includes the `Framework :: napari`
1111
[classifier]), it will also be visible on the [napari
@@ -37,7 +37,7 @@ PyPI][pypi-upload] after which it will be installable using `python -m pip insta
3737
<yourpackage>`, or (assuming you added the `Framework :: napari` classifier)
3838
in the builtin plugin installer dialog.
3939

40-
If you used the {ref}`plugin-cookiecutter-template`, you can also
40+
If you used the {ref}`napari-plugin-template`, you can also
4141
[setup automated deployments][autodeploy] on GitHub for every tagged commit.
4242

4343
````{admonition} What about conda?
@@ -60,4 +60,4 @@ forum](https://forum.image.sc/tag/napari).
6060
[pypi-upload]: https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
6161
[hubguide]: https://github.com/chanzuckerberg/napari-hub/blob/main/docs/customizing-plugin-listing.md
6262
[hub-guide-custom-viz]: https://github.com/chanzuckerberg/napari-hub/wiki/Customizing-your-plugin's-listing#visibility
63-
[autodeploy]: https://github.com/napari/cookiecutter-napari-plugin#set-up-automatic-deployments
63+
[autodeploy]: https://github.com/napari/napari-plugin-template#set-up-automatic-deployments

docs/plugins/testing_workshop_docs/3-readers-and-fixtures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This lesson explains how to use and test a plugin's reader function, built-in fi
2222
The example plugin and all the tests discussed in this lesson are available in [this GitHub repository](https://github.com/DragaDoncila/plugin-tests).
2323

2424
## Introduction
25-
In this lesson, we discuss a napari plugin called [plugin_tests](https://github.com/DragaDoncila/plugin-tests/tree/main/src/plugin_tests), generated using the [cookiecutter](https://github.com/napari/cookiecutter-napari-plugin), which has a reader and a widget. The reader is the cookiecutter [NumPy `.npy` file](https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html#npy-format) reader, `napari_get_reader`. It checks whether a path ends in `.npy`. If it doesn't, it returns `None`, and if it does, it returns the `reader_function`, which loads the data.
25+
In this lesson, we discuss a napari plugin called [plugin_tests](https://github.com/DragaDoncila/plugin-tests/tree/main/src/plugin_tests), generated using the [napari plugin template](https://github.com/napari/napari-plugin-template), which has a reader and a widget. The reader is the template [NumPy `.npy` file](https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html#npy-format) reader, `napari_get_reader`. It checks whether a path ends in `.npy`. If it doesn't, it returns `None`, and if it does, it returns the `reader_function`, which loads the data.
2626

2727
![napari_get_reader](../../images/napari_plugins_1st_napari_get_reader.png)
2828

0 commit comments

Comments
 (0)