[build-system]
requires = [
{%- if backend == "hatch" %}
  "hatchling",
{%- elif backend == "setuptools" %}
  "setuptools",
{%- endif %}
{%- if backend == "hatch" and vcs == true %}
  "hatch-vcs",
{%- elif backend == "setuptools" and vcs == true %}
  "setuptools_scm[toml]>=8.1.0",
{%- endif %}
]
{%- if backend == "hatch" %}
build-backend = "hatchling.build"
{%- elif backend == "setuptools" %}
build-backend = "setuptools.build_meta"
{%- endif %}

[project]
name = "{{ project_name }}"
{%- if backend == "setuptools" and vcs == false %}
version = "0.0.1"
{%- elif backend == "setuptools" and vcs == true %}
dynamic = ["version"]
{%- endif %}
authors = [
  { name = "{{ full_name }}", email = "{{ email }}" },
]
{%- if org | lower == "pybamm-team" %}
maintainers = [
  { name = "The PyBaMM Team", email = "pybamm@pybamm.org" },
]
{%- endif %}
description = "{{ project_short_description }}"
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
  "Development Status :: 1 - Planning",
  "Intended Audience :: Science/Research",
  "Intended Audience :: Developers",
{%- if license == "BSD-3-Clause" %}
  "License :: OSI Approved :: BSD License",
{%- elif license == "Apache" %}
  "License :: OSI Approved :: Apache Software License",
{%- elif license == "MIT" %}
  "License :: OSI Approved :: MIT License",
{%- endif %}
  "Operating System :: OS Independent",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3 :: Only",
  "Programming Language :: Python :: 3.8",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Topic :: Scientific/Engineering",
{%- if mypy %}
  "Typing :: Typed",
{%- endif %}
]
{%- if backend == "hatch" %}
dynamic = ["version"]
{%- endif %}
dependencies = ["pybamm",]

[project.optional-dependencies]
dev = [
  "pytest >=6",
  "pytest-cov >=3",
  "nox[uv]",
  "pre-commit",
]
docs = [
  "sphinx",
  "pydata_sphinx_theme",
  "sphinx_design",
  "sphinx-copybutton",
  "myst-parser",
  "sphinx-inline-tabs",
  "sphinxcontrib-bibtex",
  "sphinx-autobuild",
  "sphinx-last-updated-by-git",
  "nbsphinx",
  "ipython",
  "sphinx-gallery",
]

[project.urls]
Homepage = "{{ url }}"
"Bug Tracker" = "{{ url }}/issues"
Discussions = "{{ url }}/discussions"
Changelog = "{{ url }}/releases"

[project.entry-points."parameter_sets"]
Chen2020 = "{{ project_slug }}.parameters.input.Chen2020:get_parameter_values"

[project.entry-points."models"]
SPM = "{{ project_slug }}.models.input.SPM:SPM"
BasicReservoir = "{{ project_slug }}.models.input.BasicReservoir:BasicReservoir"
{# keep this line here for newline #}
{%- if backend == "hatch" %}
[tool.hatch]
{%- if backend == "hatch" and vcs == true %}
version.source = "vcs"
build.hooks.vcs.version-file = "src/{{ project_slug }}/_version.py"
{%- endif %}
envs.default.dependencies = [
  "pybamm",
]
{%- endif %}

{%- if backend == "hatch" and vcs == false %}
[tool.hatch.version]
path = "src/{{ project_slug }}/__init__.py"

[tool.hatch.build.targets.wheel]
packages = ["src/{{ project_slug }}"]
{%- endif %}
{# keep this line here for newline #}
{%- if backend == "setuptools" and vcs == true %}
[tool.setuptools_scm]
version_file = "src/{{ project_slug }}/_version.py"
{%- endif %}

{%- if mypy %}
[tool.mypy]
python_version = "3.11"
strict =  false
warn_return_any = false
show_error_codes = true
enable_error_code = [
  "ignore-without-code",
  "truthy-bool",
  "redundant-expr",
]
disallow_untyped_defs = false
disallow_untyped_calls = false
ignore_missing_imports = true
allow_redefinition = true
disable_error_code = ["call-overload", "operator"]
{%- endif %}

[tool.coverage]
run.source = ["{{ project_slug }}"]
port.exclude_lines = [
  'pragma: no cover',
]

[tool.ruff]
select = [
  "E", "F", "W", # flake8
  "B",           # flake8-bugbear
  "I",           # isort
  #"ARG",         # flake8-unused-arguments
  "C4",          # flake8-comprehensions
  "EM",          # flake8-errmsg
  "ICN",         # flake8-import-conventions
  "ISC",         # flake8-implicit-str-concat
  "G",           # flake8-logging-format
  "PGH",         # pygrep-hooks
  "PIE",         # flake8-pie
  "PL",          # pylint
  "PT",          # flake8-pytest-style
  "PTH",         # flake8-use-pathlib
  #"RET",         # flake8-return
  "RUF",         # Ruff-specific
  "SIM",         # flake8-simplify
  "T20",         # flake8-print
  "UP",          # pyupgrade
  "YTT",         # flake8-2020
  "EXE",         # flake8-executable
  "NPY",         # NumPy specific rules
  "PD",          # pandas-vet
]
src = ["src"]
unfixable = [
  "T20",  # Removes print statements
  "F841", # Removes unused variables
]
ignore = [
  "E741",        # Ambiguous variable name
  "E501",        # Line too long
  "PLR2004",     # Magic value used in comparison
]
line-length = 100
exclude = []
flake8-unused-arguments.ignore-variadic-names = true
