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
6 changes: 6 additions & 0 deletions copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,9 @@ copyright_license:
GNU Lesser General Public License v3.0 only: LGPL-3.0
ISC License: ISC
MIT License: MIT

template_attribution:
type: bool
qmark: 🪧
help: Add copier-python attribution to README.md?
default: no
8 changes: 8 additions & 0 deletions template/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@
pip install {{ project_name }}
```
{%- endif %}
{%- if template_attribution %}

## Project template

This project is generated and maintained with [copier-python][copier-python].

[copier-python]: https://smkent.github.io/copier-python
{%- endif %}
{#- vim: set ft=markdown: #}
102 changes: 98 additions & 4 deletions tests/__snapshots__/test_readme.ambr
Original file line number Diff line number Diff line change
@@ -1,5 +1,99 @@
# serializer version: 1
# name: test_readme_features[no_pypi-coverage]
# name: test_readme_features[attribution-no_pypi-coverage]
'''
# PKFire

Onett Little League

[![License](https://img.shields.io/github/license/ness/PKFire)](https://github.com/ness/PKFire/blob/main/LICENSE)
[![CI](https://github.com/ness/PKFire/actions/workflows/ci.yaml/badge.svg)](https://github.com/ness/PKFire/actions/workflows/ci.yaml)
[![Coverage](https://codecov.io/gh/ness/PKFire/branch/main/graph/badge.svg)](https://codecov.io/gh/ness/PKFire)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen?logo=renovatebot)](https://renovatebot.com)
[![GitHub stars](https://img.shields.io/github/stars/ness/PKFire?style=social)](https://github.com/ness/PKFire)

## Project template

This project is generated and maintained with [copier-python][copier-python].

[copier-python]: https://smkent.github.io/copier-python

'''
# ---
# name: test_readme_features[attribution-no_pypi-no_coverage]
'''
# PKFire

Onett Little League

[![License](https://img.shields.io/github/license/ness/PKFire)](https://github.com/ness/PKFire/blob/main/LICENSE)
[![CI](https://github.com/ness/PKFire/actions/workflows/ci.yaml/badge.svg)](https://github.com/ness/PKFire/actions/workflows/ci.yaml)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen?logo=renovatebot)](https://renovatebot.com)
[![GitHub stars](https://img.shields.io/github/stars/ness/PKFire?style=social)](https://github.com/ness/PKFire)

## Project template

This project is generated and maintained with [copier-python][copier-python].

[copier-python]: https://smkent.github.io/copier-python

'''
# ---
# name: test_readme_features[attribution-pypi-coverage]
'''
# PKFire

Onett Little League

[![License](https://img.shields.io/github/license/ness/PKFire)](https://github.com/ness/PKFire/blob/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/PKFire)](https://pypi.org/project/PKFire/)
[![Python](https://img.shields.io/pypi/pyversions/PKFire)](https://pypi.org/project/PKFire/)
[![CI](https://github.com/ness/PKFire/actions/workflows/ci.yaml/badge.svg)](https://github.com/ness/PKFire/actions/workflows/ci.yaml)
[![Coverage](https://codecov.io/gh/ness/PKFire/branch/main/graph/badge.svg)](https://codecov.io/gh/ness/PKFire)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen?logo=renovatebot)](https://renovatebot.com)
[![GitHub stars](https://img.shields.io/github/stars/ness/PKFire?style=social)](https://github.com/ness/PKFire)

## Installation

```sh
pip install PKFire
```

## Project template

This project is generated and maintained with [copier-python][copier-python].

[copier-python]: https://smkent.github.io/copier-python

'''
# ---
# name: test_readme_features[attribution-pypi-no_coverage]
'''
# PKFire

Onett Little League

[![License](https://img.shields.io/github/license/ness/PKFire)](https://github.com/ness/PKFire/blob/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/PKFire)](https://pypi.org/project/PKFire/)
[![Python](https://img.shields.io/pypi/pyversions/PKFire)](https://pypi.org/project/PKFire/)
[![CI](https://github.com/ness/PKFire/actions/workflows/ci.yaml/badge.svg)](https://github.com/ness/PKFire/actions/workflows/ci.yaml)
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen?logo=renovatebot)](https://renovatebot.com)
[![GitHub stars](https://img.shields.io/github/stars/ness/PKFire?style=social)](https://github.com/ness/PKFire)

## Installation

```sh
pip install PKFire
```

## Project template

This project is generated and maintained with [copier-python][copier-python].

[copier-python]: https://smkent.github.io/copier-python

'''
# ---
# name: test_readme_features[no_attribution-no_pypi-coverage]
'''
# PKFire

Expand All @@ -13,7 +107,7 @@

'''
# ---
# name: test_readme_features[no_pypi-no_coverage]
# name: test_readme_features[no_attribution-no_pypi-no_coverage]
'''
# PKFire

Expand All @@ -26,7 +120,7 @@

'''
# ---
# name: test_readme_features[pypi-coverage]
# name: test_readme_features[no_attribution-pypi-coverage]
'''
# PKFire

Expand All @@ -48,7 +142,7 @@

'''
# ---
# name: test_readme_features[pypi-no_coverage]
# name: test_readme_features[no_attribution-pypi-no_coverage]
'''
# PKFire

Expand Down
12 changes: 11 additions & 1 deletion tests/test_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@
"enable_pypi",
[pytest.param(True, id="pypi"), pytest.param(False, id="no_pypi")],
)
@pytest.mark.parametrize(
"template_attribution",
[
pytest.param(True, id="attribution"),
pytest.param(False, id="no_attribution"),
],
)
def test_readme_features(
render_template: Callable[..., Path],
snapshot: SnapshotAssertion,
*,
enable_coverage: bool,
enable_pypi: bool,
template_attribution: bool,
) -> None:
rendered = render_template(
enable_coverage=enable_coverage, enable_pypi=enable_pypi
enable_coverage=enable_coverage,
enable_pypi=enable_pypi,
template_attribution=template_attribution,
)
assert (rendered / "README.md").read_text() == snapshot

Expand Down
Loading