content: ########################
  ### Project Metadata ###
  ########################
  [project]
  name = "examplepyapp"
  description = "Example Python repo for neutrons"
  dynamic = ["version"]
  requires-python = ">=3.10"
  license = { text = "MIT" }
  keywords = ["neutrons", "example", "python"]
  readme = "README.md"
  
  dependencies = [
    # Dependencies available from both PyPI and conda should be listed here
    "numpy>=2.2,<3",
    "QtPy",
    "PyQt5",
    "pyqtgraph",
    # Dependencies only available from PyPI
    "bm3d-streak-removal>=0.2.0,<0.3",
    "pytest-playwright>=0.7.0,<0.8",
  ]
  
  [project.optional-dependencies]
  docs = ["sphinx", "sphinx_rtd_theme", "versioningit", "myst_parser"]
  
  [project.scripts]
  packagename-cli = "packagenamepy.packagename:main"
  
  [project.gui-scripts]
  packagenamepy = "packagenamepy.packagename:gui"
  
  [project.urls]
  homepage = "https://github.com/neutrons/python_project_template/"
  repository = "https://github.com/neutrons/python_project_template/"
  # documentation = add_url_to_readthedoc_here
  issues = "https://github.com/neutrons/python_project_template/issues"
  
  ####################
  ### Build config ###
  ####################
  
  [build-system]
  build-backend = "hatchling.build"
  requires = ["hatchling", "versioningit"]
  
  [tool.hatch.version]
  source = "versioningit"
  
  [tool.hatch.build.hooks.versioningit-onbuild]
  source-file = "src/packagenamepy/_version.py"
  build-file = "packagenamepy/_version.py"
  
  [tool.hatch.build]
  artifacts = [
    "src/packagenamepy/_version.py",
    "src/packagenamepy/**/*.yml",
    "src/packagenamepy/**/*.yaml",
    "src/packagenamepy/**/*.ini",
  ]
  
  [tool.hatch.build.targets.wheel]
  packages = ["src/packagenamepy"]
  
  [tool.versioningit.vcs]
  method = "git"
  default-tag = "0.1.0"
  
  [tool.versioningit.next-version]
  method = "minor"
  
  [tool.versioningit.format]
  distance = "{next_version}.dev{distance}"
  # Since pixi builds currently require the package version to be set statically in pyproject.toml,
  # and we solve that by temporarily changing pyproject.toml during build using the pixi tasks
  # sync-version and reset-toml, then we need to ignore uncommitted changes in order for the wheel
  # version to be consistent with the package version
  dirty = "{version}"
  distance-dirty = "{next_version}.dev{distance}"
  
  [tool.versioningit.write]
  file = "src/packagenamepy/_version.py"
  
  ###################
  ### Pixi config ###
  ###################
  
  [tool.pixi.workspace]
  preview = ["pixi-build"] # Required until the build feature becomes stable
  channels = [
    "conda-forge",
    "https://prefix.dev/pixi-build-backends", # Required for pixi build
  ]
  platforms = ["linux-64", "osx-arm64"] # add additional platforms as needed
  # If you don't need to map PyPI dependencies to conda, you can remove the `conda-pypi-map` section and the `pixi-mapping.json` file.
  conda-pypi-map = { "conda-forge" = "pixi-mapping.json" }
  
  ## Dependency tables - https://pixi.sh/latest/reference/pixi_manifest/#the-dependencies-tables
  ## These tables override the dependencies listed in the [project] section
  
  [tool.pixi.dependencies]
  # Conda package dependencies
  numpy = "*"
  scipy = "*" # specify derivative dependencies here if you need them from conda
  # GUI
  pyqtgraph = "*"
  qt = "*"
  qtpy = "*"
  pyqt = "*"
  # pip-audit
  h2 = ">=4.3.0" # Known vulnerability in <4.3.0
  
  [tool.pixi.pypi-dependencies]
  # PyPI dependencies, including this package to allow local editable installs
  examplepyapp = { path = ".", editable = true }
  
  # Pixi Build configuration - https://pixi.sh/latest/reference/pixi_manifest/#pixi-build
  
  [tool.pixi.package.host-dependencies]
  hatchling = "*"
  versioningit = "*"
  
  [tool.pixi.package.run-dependencies]
  python = ">=3.10"
  numpy = "*"
  QtPy = "*"
  pyqt = "*"
  pyqtgraph = "*"
  
  [tool.pixi.package]
  name = "examplepyapp"
  version = "0.0.0"     # placeholder, overwritten by sync-version
  
  [tool.pixi.package.build]
  backend = { name = "pixi-build-python", version = "0.1.*" }
  
  # Environments and Features
  
  [tool.pixi.environments]
  default = { features = [
    "docs",
    "developer",
    "package",
    "test",
  ], solve-group = "default" }
  jupyter = { features = ["developer", "jupyter"], solve-group = "jupyter" }
  
  [tool.pixi.feature.test.dependencies]
  pytest = "*"
  pytest-cov = "*"
  pytest-repeat = "*"
  pytest-xdist = "*"
  
  [tool.pixi.feature.package.dependencies]
  anaconda-client = ">=1.13.0,<2"
  twine = ">=6.1.0,<7"
  versioningit = "*"
  hatch = "*"
  
  [tool.pixi.feature.package.pypi-dependencies]
  toml-cli = "*"
  
  [tool.pixi.feature.developer.dependencies]
  pip = "*"
  pip-audit = "*"
  pre-commit = "*"
  ruff = "*"
  versioningit = "*"
  
  [tool.pixi.feature.docs.dependencies]
  sphinx = "*"
  sphinx_rtd_theme = "*"
  myst-parser = "*"
  
  [tool.pixi.feature.jupyter.dependencies]
  jupyterlab = "*"
  ipympl = "*"
  ipywidgets = "*"
  
  [tool.pixi.tasks]
  # Documentation
  build-docs = { cmd = 'sphinx-build -b html docs docs/_build', description = "Build documentation" }
  test-docs = { cmd = "sphinx-build -M doctest docs docs/_build", description = "Test building the documentation" }
  # Testing
  test = { description = "Run the test suite", cmd = "pytest" }
  # Packaging
  pypi-sdist = { cmd = "hatch build -t sdist", description = "Build the source distribution (tar.gz)" }
  pypi-wheel = { cmd = "hatch build -t wheel", description = "Build the wheel distribution" }
  pypi-build = { description = "Build the packages for PyPI", depends-on = [
    "pypi-sdist",
    "pypi-wheel",
  ] }
  pypi-publish = { cmd = "twine upload dist/*", description = "Publish the package to PyPI", depends-on = [
    "pypi-build",
  ] }
  pypi-publish-test = { cmd = "twine upload --repository testpypi dist/*", description = "Publish the package to TestPyPI", depends-on = [
    "pypi-build",
  ] }
  conda-build-command = { cmd = "pixi build", description = "Build the conda package command" }
  conda-build = { description = "Build the conda package", depends-on = [
    "backup-toml",
    "sync-version",
    "conda-build-command",
    "reset-toml",
  ] }
  conda-publish = { cmd = "anaconda upload *.conda", description = "Publish the .conda package to anaconda.org", depends-on = [
    "conda-build",
  ] }
  # Misc
  # As of 10-01-2025, all pip version are failing pip-autid, so we ignore the known issue GHSA-4xh5-x5gv-qwph for now
  audit-deps = { cmd = "pip-audit --ignore-vuln GHSA-4xh5-x5gv-qwph --local -s osv", description = "Audit the package dependencies for vulnerabilities" }
  # Cleaning
  clean = { cmd = 'rm -rf .pytest_cache .ruff_cache **/*.egg-info **/dist **/__pycache__', description = "Clean up various caches and build artifacts" }
  clean-conda = { cmd = "rm -f *.conda", description = "Clean the local .conda build artifacts" }
  clean-docs = { cmd = "rm -rf docs/_build", description = "Clean up documentation build artifacts" }
  clean-pypi = { cmd = "rm -rf dist", description = "Clean the PyPI build artifacts" }
  clean-all = { description = "Clean all artifacts", depends-on = [
    "clean",
    "clean-conda",
    "clean-docs",
    "clean-pypi",
  ] }
  # workaround for dynamic versioning
  sync-version = { cmd = 'version=$(python -m versioningit); toml set tool.pixi.package.version "$version" --toml-path pyproject.toml', description = "Sync pyproject.toml version with Git version" }
  backup-toml = { cmd = "cp pyproject.toml pyproject.toml.bak", description = "Backup the pyproject.toml file" }
  reset-toml = { cmd = "cp pyproject.toml.bak pyproject.toml; rm pyproject.toml.bak", description = "Reset the pyproject.toml file to the original state" }
  
  ##############
  ### Pytest ###
  ##############
  
  [tool.pytest.ini_options]
  addopts = "-v --cov=packagenamepy --cov-report=term-missing"
  pythonpath = [".", "src", "scripts"]
  testpaths = ["tests"]
  python_files = ["test*.py"]
  norecursedirs = [
    ".git",
    "tmp*",
    "_tmp*",
    "__pycache__",
    "*dataset*",
    "*data_set*",
  ]
  markers = ["mymarker: example markers goes here"]
  
  ############
  ### Ruff ###
  ############
  
  [tool.ruff]
  target-version = "py311"
  line-length = 120
  exclude = ["notebooks/**", "**/*.ipynb"]
  
  [tool.ruff.lint]
  select = ["A", "ARG", "ASYNC", "BLE", "C90", "E", "F", "I", "N", "UP032", "W"]
  ignore = []
  
  [tool.ruff.lint.isort]
  known-first-party = ["packagenamepy"]
  
  [tool.ruff.format]
  quote-style = "double"
  indent-style = "space"
  line-ending = "auto"
  