Skip to content

Commit

Permalink
changed vcs configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
santacodes committed Jul 26, 2024
1 parent 621b05b commit ef3ef2f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"backend": [
"hatch"
],
"hatch_vcs": false,
"vcs": false,
"mypy": false,
"__year": "{% now 'utc', '%Y' %}",
"__project_slug": "{{ cookiecutter.project_name | lower | replace('-', '_') | replace('.', '_') }}",
Expand All @@ -43,7 +43,7 @@
"backend": {
"__prompt__": "Choose a build backend",
"hatch": "Hatchling (recommended for pure Python projects)",
"hatch_vcs": "Enable hatch version control (vcs)?"
"vcs": "Enable hatch version control (vcs)?"
},
"mypy": "Use mypy and static types"
}
Expand Down
6 changes: 3 additions & 3 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{%- if cookiecutter.backend == "hatch" %}
requires = [
"hatchling",
{%- if cookiecutter.hatch_vcs == true %}
{%- if cookiecutter.backend == "hatch" and cookiecutter.vcs == true %}
"hatch-vcs",
{%- endif %}
]
Expand Down Expand Up @@ -88,7 +88,7 @@ SPM = "{{ cookiecutter.__project_slug }}.models.input.SPM:SPM"
{# keep this line here for newline #}
{%- if cookiecutter.backend == "hatch" %}
[tool.hatch]
{%- if cookiecutter.hatch_vcs == true %}
{%- if cookiecutter.backend == "hatch" and cookiecutter.vcs == true %}
version.source = "vcs"
build.hooks.vcs.version-file = "src/{{ cookiecutter.__project_slug }}/_version.py"
{%- endif %}
Expand All @@ -97,7 +97,7 @@ envs.default.dependencies = [
]
{%- endif %}

{%- if cookiecutter.hatch_vcs == false %}
{%- if cookiecutter.backend == "hatch" and cookiecutter.vcs == false %}
[tool.hatch.version]
path = "src/{{ cookiecutter.__project_slug }}/__init__.py"
{%- endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from __future__ import annotations
{%- endif %}

{%- if cookiecutter.hatch_vcs %}
{%- if cookiecutter.vcs %}
from ._version import version as __version__
{%- else %}
__version__ = "0.1.0"
Expand All @@ -20,7 +20,7 @@
{%- else %}
__all__ = [
{%- endif %}
{%- if cookiecutter.hatch_vcs %}
{%- if cookiecutter.vcs %}
"__version__",
{%- endif %}
"pybamm",
Expand Down

0 comments on commit ef3ef2f

Please sign in to comment.