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
4 changes: 4 additions & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"tox",
"nox"
],
"citation_file": [
false,
true
],
"__runner": "{% if cookiecutter['runner'] == 'tox' %}tox -e{% else %}nox -s{% endif %}",
"__runner_uv": "{% if cookiecutter['runner'] == 'tox' %}--with tox-uv tox -e{% else %}nox -s{% endif %}",
"__runner_pip": "{% if cookiecutter['runner'] == 'tox' %}tox tox-uv{% else %}nox[uv]{% endif %}",
Expand Down
3 changes: 3 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
PROJECT_DIRECTORY.joinpath("noxfile.py").unlink()
else:
PROJECT_DIRECTORY.joinpath("tox.ini").unlink()

if "{{ cookiecutter.citation_file|lower }}" == "false":
PROJECT_DIRECTORY.joinpath("CITATION.cff").unlink()
4 changes: 3 additions & 1 deletion {{cookiecutter.package_name}}/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ prune docs
global-exclude *.py[cod] __pycache__ *.so *.dylib .DS_Store *.gpickle .idea/**

include README.md LICENSE
exclude tox.ini .readthedocs.yml .cruft.json CITATION.cff docker-compose.yml Dockerfile noxfile.py
exclude .readthedocs.yml .cruft.json docker-compose.yml Dockerfile
exclude {% if cookiecutter['runner'] == 'tox' %}tox.ini{% else %}noxfile.py{% endif %}
{%- if cookiecutter.citation_file|lower == "true" %}exclude CITATION.cff{% endif %}
2 changes: 2 additions & 0 deletions {{cookiecutter.package_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ filename = "src/{{cookiecutter.package_name}}/version.py"
search = "VERSION = \"{current_version}\""
replace = "VERSION = \"{new_version}\""

{% if cookiecutter.citation_file|lower == "true" %}
[[tool.bumpversion.files]]
filename = "CITATION.cff"
search = "version: {current_version}"
replace = "version: {new_version}"
{% endif %}