Skip to content
Open
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
67 changes: 65 additions & 2 deletions copier.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
_subdirectory: template
_answers_file: .copier-answers.ess.yml
_subdirectory: "{% if template=='ess' %}template{% else %}subpackage-template{% endif %}"
_answers_file: .copier-answers.{{ template }}.yml
# Questions
template:
type: str
choices:
- ess
- subpackages
default: ess

subpackages:
type: yaml
multiline: true
Expand All @@ -15,4 +22,60 @@ subpackages:
description: Neutron imaging (ODIN, TBL, YMIR)
dependencies:
- essreduce
when: "{% if template == 'ess' %}true{% endif %}"

# Subpackages Questions

projectname:
type: str
help: What is your project name?
when: "{% if template != 'ess' %}true{% endif %}"
prettyname:
default: '{{projectname|capitalize}}'
type: str
help: What is your project name in title case?
when: "{% if template != 'ess' %}true{% endif %}"
orgname:
default: scipp
type: str
help: What is your organization name?
when: "{% if template != 'ess' %}true{% endif %}"
namespace_package:
default: 'ess'
type: str
help: Use a namespace package with this name. If empty, no namespace package is used.
when: "{% if template != 'ess' %}true{% endif %}"
description:
type: str
help: Brief description?
when: "{% if template != 'ess' %}true{% endif %}"
min_python:
type: str
help: Minimum Python version?
when: "{% if template != 'ess' %}true{% endif %}"
max_python:
type: str
help: Maximum Python version that is known to work?
when: "{% if template != 'ess' %}true{% endif %}"
year:
type: int
default: 2026
when: "{% if template != 'ess' %}true{% endif %}"
nightly_deps:
type: str
help: |
List of dependencies to install from GitHub during nightly builds,
separated by commas. Make sure to also list transitive dependencies,
otherwise their released versions will be used. Specify either a
repository name or 'org/repo'. If no organization is given it defaults
to 'scipp'. In either case, the 'main' branch will be used. Example:
scipp,sciline,dask/dask
when: "{% if template != 'ess' %}true{% endif %}"
related_projects:
type: str
help: |
List of related projects, separated by commas.
This will be used to generate a list of links in the documentation.
For example, "Scipp,Sciline,Plopp".
when: "{% if template != 'ess' %}true{% endif %}"

1 change: 1 addition & 0 deletions subpackage-template/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include LICENSE
16 changes: 16 additions & 0 deletions subpackage-template/README.md.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
[![PyPI badge](http://img.shields.io/pypi/v/{{projectname}}.svg)](https://pypi.python.org/pypi/{{projectname}})
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/{{projectname}}/badges/version.svg)](https://anaconda.org/conda-forge/{{projectname}})
[![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)

# {{prettyname}}

## About

{{description}}

## Installation

```sh
python -m pip install {{projectname}}
```
13 changes: 13 additions & 0 deletions subpackage-template/docs/_static/anaconda-icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions subpackage-template/docs/_templates/class-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{ fullname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:special-members: __getitem__

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
{% for item in methods %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
2 changes: 2 additions & 0 deletions subpackage-template/docs/_templates/doc_version.html.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!-- This will display the version of the docs -->
Current {{prettyname}} version: {%raw %}{{ version }}{% endraw %} (<a href="https://github.com/{{orgname}}/{{projectname}}/releases">older versions</a>).
66 changes: 66 additions & 0 deletions subpackage-template/docs/_templates/module-template.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Module Attributes') }}

.. autosummary::
:toctree:
{% for item in attributes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block functions %}
{% if functions %}
.. rubric:: {{ _('Functions') }}

.. autosummary::
:toctree:
{% for item in functions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block classes %}
{% if classes %}
.. rubric:: {{ _('Classes') }}

.. autosummary::
:toctree:
:template: class-template.rst
{% for item in classes %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block exceptions %}
{% if exceptions %}
.. rubric:: {{ _('Exceptions') }}

.. autosummary::
:toctree:
{% for item in exceptions %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block modules %}
{% if modules %}
.. rubric:: Modules

.. autosummary::
:toctree:
:template: module-template.rst
:recursive:
{% for item in modules %}
{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
26 changes: 26 additions & 0 deletions subpackage-template/docs/about/index.md.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# About

## Development

{{prettyname}} is an open source project by the [European Spallation Source ERIC](https://ess.eu/) (ESS).

## License

{{prettyname}} is available as open source under the [BSD-3 license](https://opensource.org/license/BSD-3-Clause).

## Citing {{prettyname}}

Please cite the following:

[![DOI](https://zenodo.org/badge/FIXME.svg)](https://zenodo.org/doi/10.5281/zenodo.FIXME)

To cite a specific version of {{prettyname}}, select the desired version on Zenodo to get the corresponding DOI.

## Older versions of the documentation

Older versions of the documentation pages can be found under the assets of each [release](https://github.com/{{orgname}}/{{projectname}}/releases).
Simply download the archive, unzip and view locally in a web browser.

## Source code and development

{{prettyname}} is hosted and developed [on GitHub](https://github.com/{{orgname}}/{{projectname}}).
29 changes: 29 additions & 0 deletions subpackage-template/docs/api-reference/index.md.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# API Reference

## Classes

```{eval-rst}
.. currentmodule:: {% if namespace_package %}{{ namespace_package }}.{{ projectname.removeprefix(namespace_package) }}{% else %}{{ projectname }}{% endif %}

.. autosummary::
:toctree: ../generated/classes
:template: class-template.rst
:recursive:
```

## Top-level functions

```{eval-rst}
.. autosummary::
:toctree: ../generated/functions
:recursive:
```

## Submodules

```{eval-rst}
.. autosummary::
:toctree: ../generated/modules
:template: module-template.rst
:recursive:
```
Loading
Loading