Skip to content
35 changes: 35 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
project_slug:
type: str
help: "The slug of the project (used in package names, etc.)"

project_long_description:
type: str
help: "A long description of the project"
default: ""

project_getting_started:
type: str
help: "A short description of how to get started with the project"

git_username:
type: str
help: "The GitHub username or organization name"
default: "pyfar"

logo_path_gallery:
type: str
help: "What is the path to the logo image for the pyfar gallery?"
default: "resources/logos/pyfar_logos_fixed_size_{{ project_slug }}.png"

minimum_python_version:
type: str
help: "The minimum Python version required"
choices:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"

_subdirectory: "template"
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ classifiers = [

]
dependencies = [




"copier",
"numpy",
]

[project.optional-dependencies]
Expand All @@ -41,6 +39,7 @@ deploy = [
]
tests = [
"pytest",
"pytest-copie",
"pytest-cov",
"watchdog",
"ruff==0.8.3",
Expand Down
28 changes: 28 additions & 0 deletions template/README.md.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<h1 align="center">
<img src="https://github.com/pyfar/gallery/raw/main/docs/{{ logo_path_gallery }}" width="300">
</h1><br>

[![PyPI version](https://badge.fury.io/py/{{ project_slug }}.svg)](https://badge.fury.io/py/{{ project_slug }})
[![Documentation Status](https://readthedocs.org/projects/{{ project_slug }}/badge/?version=latest)](https://{{ project_slug }}.readthedocs.io/en/latest/?badge=latest)
[![CircleCI](https://circleci.com/gh/{{ git_username }}/{{ project_slug | replace("_", "-") }}.svg?style=shield)](https://circleci.com/gh/{{ git_username }}/{{ project_slug | replace("_", "-") }})
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb)
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mybinder badge on line 8 points to a hardcoded pyfar-specific URL that won't be relevant for projects created from this template. This should either be made configurable through a template variable or removed if not applicable to all projects.

Suggested change
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb)
{% if binder_url %}
[![Binder](https://mybinder.org/badge_logo.svg)]({{ binder_url }})
{% endif %}

Copilot uses AI. Check for mistakes.

{{ project_long_description }}

## Getting Started

{{ project_getting_started }}

## Installation

Use pip to install {{ project_slug }}

pip install {{ project_slug }}

(Requires Python {{ minimum_python_version }} or higher)

If the installation fails, please check out the [help section](https://pyfar-gallery.readthedocs.io/en/latest/help).

## Contributing

Check out the [contributing guidelines](https://{{ project_slug }}.readthedocs.io/en/stable/contributing.html) if you want to become part of pyfar.
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pytest

@pytest.fixture(scope='session')
def copier_project_defaults():
return {
"project_slug": "my_project",
"project_long_description": "my_project_description",
"project_getting_started": "This is how to get started.",
"git_username": "pyfar",
"minimum_python_version": "3.11",
}
37 changes: 37 additions & 0 deletions tests/test_copier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import pytest


def test_project_folder(copie, copier_project_defaults):
project_defaults = copier_project_defaults
project = copie.copy(extra_answers=project_defaults)

assert project.exit_code == 0
assert project.exception is None
assert project.project_dir.is_dir()


@pytest.mark.parametrize("file_name", [
"README.md",
])
def test_generated_file_exists(copie, copier_project_defaults, file_name):
project = copie.copy(extra_answers=copier_project_defaults)

assert project.project_dir.joinpath(file_name).exists()


@pytest.mark.parametrize("desired", [
"\nmy_project_description\n",
"pip install my_project",
"https://circleci.com/gh/pyfar/my-project",
"main/docs/resources/logos/pyfar_logos_fixed_size_my_project.png",
"Python 3.11 or higher",
"py/my_project.svg",
"https://my_project.readthedocs.io/en/stable/contributing.html",
"\nThis is how to get started.\n",
])
def test_content_readme(copie, copier_project_defaults, desired):
project = copie.copy(extra_answers=copier_project_defaults)

content = project.project_dir.joinpath("README.md").read_text()
assert desired in content

Loading