Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Remove references to cookiecutter and pytest-cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
GenevieveBuckley committed Jun 13, 2024
1 parent 134ce29 commit 80adc47
Show file tree
Hide file tree
Showing 14 changed files with 188 additions and 159 deletions.
12 changes: 6 additions & 6 deletions template/src/LICENSE.jinja
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{%- if cookiecutter.license == "MIT" -%}
{%- if license == "MIT" -%}
{%- include 'licenses/MIT' %}
{%- elif cookiecutter.license == "BSD-3" -%}
{%- elif license == "BSD-3" -%}
{%- include 'licenses/BSD-3' %}
{%- elif cookiecutter.license == "GNU GPL v3.0" -%}
{%- elif license == "GNU GPL v3.0" -%}
{%- include 'licenses/GPL-3' %}
{%- elif cookiecutter.license == "GNU LGPL v3.0" -%}
{%- elif license == "GNU LGPL v3.0" -%}
{%- include 'licenses/LGPL-3' %}
{%- elif cookiecutter.license == "Apache Software License 2.0" -%}
{%- elif license == "Apache Software License 2.0" -%}
{%- include 'licenses/Apache-2' %}
{%- elif cookiecutter.license == "Mozilla Public License 2.0" -%}
{%- elif license == "Mozilla Public License 2.0" -%}
{%- include 'licenses/MPL-2' %}
{%- endif -%}
40 changes: 20 additions & 20 deletions template/src/README.md.jinja
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
# {{cookiecutter.plugin_name}}
# {{plugin_name}}

[![License {{cookiecutter.license}}](https://img.shields.io/pypi/l/{{cookiecutter.plugin_name}}.svg?color=green)](https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/{{cookiecutter.plugin_name}}.svg?color=green)](https://pypi.org/project/{{cookiecutter.plugin_name}})
[![Python Version](https://img.shields.io/pypi/pyversions/{{cookiecutter.plugin_name}}.svg?color=green)](https://python.org)
[![tests](https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/workflows/tests/badge.svg)](https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/actions)
[![codecov](https://codecov.io/gh/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/branch/main/graph/badge.svg)](https://codecov.io/gh/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}})
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/{{cookiecutter.plugin_name}})](https://napari-hub.org/plugins/{{cookiecutter.plugin_name}})
[![License {{license}}](https://img.shields.io/pypi/l/{{plugin_name}}.svg?color=green)](https://github.com/{{github_username_or_organization}}/{{plugin_name}}/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/{{plugin_name}}.svg?color=green)](https://pypi.org/project/{{plugin_name}})
[![Python Version](https://img.shields.io/pypi/pyversions/{{plugin_name}}.svg?color=green)](https://python.org)
[![tests](https://github.com/{{github_username_or_organization}}/{{plugin_name}}/workflows/tests/badge.svg)](https://github.com/{{github_username_or_organization}}/{{plugin_name}}/actions)
[![codecov](https://codecov.io/gh/{{github_username_or_organization}}/{{plugin_name}}/branch/main/graph/badge.svg)](https://codecov.io/gh/{{github_username_or_organization}}/{{plugin_name}})
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/{{plugin_name}})](https://napari-hub.org/plugins/{{plugin_name}})

{{cookiecutter.short_description}}
{{short_description}}

----------------------------------

This [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.
This [napari] plugin was generated with [copier] using the [napari-plugin-template].

<!--
Don't miss the full getting started guide to set up your new package:
https://github.com/napari/cookiecutter-napari-plugin#getting-started
https://github.com/napari/napari-plugin-template#getting-started
and review the napari docs for plugin developers:
https://napari.org/stable/plugins/index.html
-->

## Installation

You can install `{{cookiecutter.plugin_name}}` via [pip]:
You can install `{{plugin_name}}` via [pip]:

pip install {{cookiecutter.plugin_name}}
pip install {{plugin_name}}


{% if cookiecutter.github_repository_url != 'provide later' %}
{% if github_repository_url != 'provide later' %}
To install latest development version :

pip install git+https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}.git
pip install git+https://github.com/{{github_username_or_organization}}/{{plugin_name}}.git
{% endif %}

## Contributing
Expand All @@ -41,25 +41,25 @@ the coverage at least stays the same before you submit a pull request.

## License

Distributed under the terms of the [{{cookiecutter.license}}] license,
"{{cookiecutter.plugin_name}}" is free and open source software
Distributed under the terms of the [{{license}}] license,
"{{plugin_name}}" is free and open source software

## Issues

If you encounter any problems, please [file an issue] along with a detailed description.

[napari]: https://github.com/napari/napari
[Cookiecutter]: https://github.com/audreyr/cookiecutter
[copier]: https://copier.readthedocs.io/en/stable/
[@napari]: https://github.com/napari
[MIT]: http://opensource.org/licenses/MIT
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
{% if cookiecutter.github_repository_url != 'provide later' %}
[file an issue]: https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/issues
[napari-plugin-template]: https://github.com/napari/napari-plugin-template
{% if github_repository_url != 'provide later' %}
[file an issue]: https://github.com/{{github_username_or_organization}}/{{plugin_name}}/issues
{% endif %}
[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
Expand Down
2 changes: 1 addition & 1 deletion template/src/licenses/BSD-3.jinja
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{#- source: http://opensource.org/licenses/BSD-3-Clause #}
Copyright (c) {% now 'utc', '%Y' %}, {{cookiecutter.full_name}}
Copyright (c) {% now 'utc', '%Y' %}, {{full_name}}
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion template/src/licenses/MIT.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{#- source: http://opensource.org/licenses/MIT #}
The MIT License (MIT)

Copyright (c) {% now 'utc', '%Y' %} {{cookiecutter.full_name}}
Copyright (c) {% now 'utc', '%Y' %} {{full_name}}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
44 changes: 22 additions & 22 deletions template/src/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[project]
name = "{{cookiecutter.plugin_name}}"
name = "{{plugin_name}}"
dynamic = ["version"]
description = "{{cookiecutter.short_description}}"
description = "{{short_description}}"
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{name = "{{cookiecutter.full_name}}"},
{email = "{{cookiecutter.email}}"},
{name = "{{full_name}}"},
{email = "{{email}}"},
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Framework :: napari",
"Intended Audience :: Developers",
{% if cookiecutter.license == "MIT" -%}
{% if license == "MIT" -%}
"License :: OSI Approved :: MIT License",
{%- elif cookiecutter.license == "BSD-3" -%}
{%- elif license == "BSD-3" -%}
"License :: OSI Approved :: BSD License",
{%- elif cookiecutter.license == "GNU GPL v3.0" -%}
{%- elif license == "GNU GPL v3.0" -%}
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
{%- elif cookiecutter.license == "GNU LGPL v3.0" -%}
{%- elif license == "GNU LGPL v3.0" -%}
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
{%- elif cookiecutter.license == "Apache Software License 2.0" -%}
{%- elif license == "Apache Software License 2.0" -%}
"License :: OSI Approved :: Apache Software License",
{%- elif cookiecutter.license == "Mozilla Public License 2.0" -%}
{%- elif license == "Mozilla Public License 2.0" -%}
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
{%- endif %}
"Operating System :: OS Independent",
Expand All @@ -38,7 +38,7 @@ classifiers = [
requires-python = ">=3.9"
dependencies = [
"numpy",
{% if cookiecutter.include_widget_plugin == 'y' %} "magicgui",
{% if include_widget_plugin %} "magicgui",
"qtpy",
"scikit-image",
{% endif %}]
Expand All @@ -48,24 +48,24 @@ testing = [
"tox",
"pytest", # https://docs.pytest.org/en/latest/contents.html
"pytest-cov", # https://pytest-cov.readthedocs.io/en/latest/
{% if cookiecutter.include_widget_plugin == 'y' %} "pytest-qt", # https://pytest-qt.readthedocs.io/en/latest/
{% if include_widget_plugin %} "pytest-qt", # https://pytest-qt.readthedocs.io/en/latest/
"napari",
"pyqt5",
{% endif %}]

[project.entry-points."napari.manifest"]
{{cookiecutter.plugin_name}} = "{{cookiecutter.module_name}}:napari.yaml"
{{plugin_name}} = "{{module_name}}:napari.yaml"

{% if cookiecutter.github_repository_url != 'provide later' -%}
{% if github_repository_url != 'provide later' -%}
[project.urls]
"Bug Tracker" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/issues"
"Documentation" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}#README.md"
"Source Code" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}"
"User Support" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/issues"
"Bug Tracker" = "https://github.com/{{github_username_or_organization}}/{{plugin_name}}/issues"
"Documentation" = "https://github.com/{{github_username_or_organization}}/{{plugin_name}}#README.md"
"Source Code" = "https://github.com/{{github_username_or_organization}}/{{plugin_name}}"
"User Support" = "https://github.com/{{github_username_or_organization}}/{{plugin_name}}/issues"
{%- endif %}

[build-system]
{% if cookiecutter.use_git_tags_for_versioning == 'y' -%}
{% if use_git_tags_for_versioning -%}
requires = ["setuptools>=42.0.0", "wheel", "setuptools_scm"]
{%- else -%}
requires = ["setuptools>=42.0.0", "wheel"]
Expand All @@ -81,12 +81,12 @@ where = ["src"]
[tool.setuptools.package-data]
"*" = ["*.yaml"]

{% if cookiecutter.use_git_tags_for_versioning == 'y' %}
{% if use_git_tags_for_versioning %}
[tool.setuptools_scm]
write_to = "src/{{cookiecutter.module_name}}/_version.py"
write_to = "src/{{module_name}}/_version.py"
{% else %}
[tool.setuptools.dynamic]
version = {attr = "{{cookiecutter.module_name}}.__init__.__version__"}
version = {attr = "{{module_name}}.__init__.__version__"}
{%- endif %}

[tool.black]
Expand Down
2 changes: 1 addition & 1 deletion template/src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ passenv =
PYVISTA_OFF_SCREEN
extras =
testing
commands = pytest -v --color=yes --cov={{cookiecutter.module_name}} --cov-report=xml
commands = pytest -v --color=yes --cov={{module_name}} --cov-report=xml
18 changes: 9 additions & 9 deletions template/src/{{module_name}}/__init__.py.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if cookiecutter.use_git_tags_for_versioning == 'y' %}
{% if use_git_tags_for_versioning == 'y' %}
try:
from ._version import version as __version__
except ImportError:
Expand All @@ -7,24 +7,24 @@ except ImportError:
__version__ = "0.0.1"
{% endif -%}

{% if cookiecutter.include_reader_plugin == 'y' %}
{% if include_reader_plugin == 'y' %}
from ._reader import napari_get_reader
{% endif %}{% if cookiecutter.include_sample_data_plugin == 'y' -%}
{% endif %}{% if include_sample_data_plugin == 'y' -%}
from ._sample_data import make_sample_data
{% endif %}{% if cookiecutter.include_widget_plugin == 'y' -%}
{% endif %}{% if include_widget_plugin == 'y' -%}
from ._widget import ExampleQWidget, ImageThreshold, threshold_autogenerate_widget, threshold_magic_widget
{% endif %}{% if cookiecutter.include_writer_plugin == 'y' -%}
{% endif %}{% if include_writer_plugin == 'y' -%}
from ._writer import write_multiple, write_single_image
{% endif %}
__all__ = (
{% if cookiecutter.include_reader_plugin == 'y' -%}
{% if include_reader_plugin == 'y' -%}
"napari_get_reader",
{% endif %}{% if cookiecutter.include_writer_plugin == 'y' -%}
{% endif %}{% if include_writer_plugin == 'y' -%}
"write_single_image",
"write_multiple",
{% endif %}{% if cookiecutter.include_sample_data_plugin == 'y' -%}
{% endif %}{% if include_sample_data_plugin == 'y' -%}
"make_sample_data",
{% endif %}{% if cookiecutter.include_widget_plugin == 'y' -%}
{% endif %}{% if include_widget_plugin == 'y' -%}
"ExampleQWidget",
"ImageThreshold",
"threshold_autogenerate_widget",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from {{cookiecutter.module_name}} import napari_get_reader
from {{module_name}} import napari_get_reader


# tmp_path is a pytest fixture
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# from {{cookiecutter.module_name}} import make_sample_data
# from {{module_name}} import make_sample_data

# add your tests here...

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from {{cookiecutter.module_name}}._widget import (
from {{module_name}}._widget import (
ExampleQWidget,
ImageThreshold,
threshold_autogenerate_widget,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# from {{cookiecutter.module_name}} import write_single_image, write_multiple
# from {{module_name}} import write_single_image, write_multiple

# add your tests here...

Expand Down
72 changes: 36 additions & 36 deletions template/src/{{module_name}}/napari.yaml.jinja
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: {{cookiecutter.plugin_name}}
display_name: {{cookiecutter.display_name}}
name: {{plugin_name}}
display_name: {{display_name}}
# use 'hidden' to remove plugin from napari hub search results
visibility: public
# see https://napari.org/stable/plugins/manifest.html for valid categories
categories: ["Annotation", "Segmentation", "Acquisition"]
contributions:
commands:{% if cookiecutter.include_reader_plugin == 'y' %}
- id: {{cookiecutter.plugin_name}}.get_reader
python_name: {{cookiecutter.module_name}}._reader:napari_get_reader
title: Open data with {{cookiecutter.display_name}}{% endif %}{% if cookiecutter.include_writer_plugin == 'y' %}
- id: {{cookiecutter.plugin_name}}.write_multiple
python_name: {{cookiecutter.module_name}}._writer:write_multiple
title: Save multi-layer data with {{cookiecutter.display_name}}
- id: {{cookiecutter.plugin_name}}.write_single_image
python_name: {{cookiecutter.module_name}}._writer:write_single_image
title: Save image data with {{cookiecutter.display_name}}{% endif %}{% if cookiecutter.include_sample_data_plugin == 'y' %}
- id: {{cookiecutter.plugin_name}}.make_sample_data
python_name: {{cookiecutter.module_name}}._sample_data:make_sample_data
title: Load sample data from {{cookiecutter.display_name}}{% endif %}{% if cookiecutter.include_widget_plugin == 'y' %}
- id: {{cookiecutter.plugin_name}}.make_container_widget
python_name: {{cookiecutter.module_name}}:ImageThreshold
commands:{% if include_reader_plugin %}
- id: {{plugin_name}}.get_reader
python_name: {{module_name}}._reader:napari_get_reader
title: Open data with {{display_name}}{% endif %}{% if include_writer_plugin %}
- id: {{plugin_name}}.write_multiple
python_name: {{module_name}}._writer:write_multiple
title: Save multi-layer data with {{display_name}}
- id: {{plugin_name}}.write_single_image
python_name: {{module_name}}._writer:write_single_image
title: Save image data with {{display_name}}{% endif %}{% if include_sample_data_plugin %}
- id: {{plugin_name}}.make_sample_data
python_name: {{module_name}}._sample_data:make_sample_data
title: Load sample data from {{display_name}}{% endif %}{% if include_widget_plugin %}
- id: {{plugin_name}}.make_container_widget
python_name: {{module_name}}:ImageThreshold
title: Make threshold Container widget
- id: {{cookiecutter.plugin_name}}.make_magic_widget
python_name: {{cookiecutter.module_name}}:threshold_magic_widget
- id: {{plugin_name}}.make_magic_widget
python_name: {{module_name}}:threshold_magic_widget
title: Make threshold magic widget
- id: {{cookiecutter.plugin_name}}.make_function_widget
python_name: {{cookiecutter.module_name}}:threshold_autogenerate_widget
- id: {{plugin_name}}.make_function_widget
python_name: {{module_name}}:threshold_autogenerate_widget
title: Make threshold function widget
- id: {{cookiecutter.plugin_name}}.make_qwidget
python_name: {{cookiecutter.module_name}}:ExampleQWidget
title: Make example QWidget{% endif %}{% if cookiecutter.include_reader_plugin == 'y' %}
- id: {{plugin_name}}.make_qwidget
python_name: {{module_name}}:ExampleQWidget
title: Make example QWidget{% endif %}{% if include_reader_plugin %}
readers:
- command: {{cookiecutter.plugin_name}}.get_reader
- command: {{plugin_name}}.get_reader
accepts_directories: false
filename_patterns: ['*.npy']{% endif %}{% if cookiecutter.include_writer_plugin == 'y' %}
filename_patterns: ['*.npy']{% endif %}{% if include_writer_plugin %}
writers:
- command: {{cookiecutter.plugin_name}}.write_multiple
- command: {{plugin_name}}.write_multiple
layer_types: ['image*','labels*']
filename_extensions: []
- command: {{cookiecutter.plugin_name}}.write_single_image
- command: {{plugin_name}}.write_single_image
layer_types: ['image']
filename_extensions: ['.npy']{% endif %}{% if cookiecutter.include_sample_data_plugin == 'y' %}
filename_extensions: ['.npy']{% endif %}{% if include_sample_data_plugin %}
sample_data:
- command: {{cookiecutter.plugin_name}}.make_sample_data
display_name: {{cookiecutter.display_name}}
key: unique_id.1{% endif %}{% if cookiecutter.include_widget_plugin == 'y' %}
- command: {{plugin_name}}.make_sample_data
display_name: {{display_name}}
key: unique_id.1{% endif %}{% if include_widget_plugin %}
widgets:
- command: {{cookiecutter.plugin_name}}.make_container_widget
- command: {{plugin_name}}.make_container_widget
display_name: Container Threshold
- command: {{cookiecutter.plugin_name}}.make_magic_widget
- command: {{plugin_name}}.make_magic_widget
display_name: Magic Threshold
- command: {{cookiecutter.plugin_name}}.make_function_widget
- command: {{plugin_name}}.make_function_widget
autogenerate: true
display_name: Autogenerate Threshold
- command: {{cookiecutter.plugin_name}}.make_qwidget
- command: {{plugin_name}}.make_qwidget
display_name: Example QWidget{% endif %}
Loading

0 comments on commit 80adc47

Please sign in to comment.