Skip to content

Commit

Permalink
Make citation file optional
Browse files Browse the repository at this point in the history
Closes #31
  • Loading branch information
cthoyt committed Nov 2, 2024
1 parent 3089b54 commit 23bdbb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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
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 %}

0 comments on commit 23bdbb6

Please sign in to comment.