local utils = import 'utils.libjsonnet';

/**
 * @brief Default Python dependency definitions in Poetry-style syntax.
 *
 * All version specifiers use Poetry conventions (^, ~, etc.). Conversion to PEP 508 for uv
 * happens at pyproject.toml assembly time.
 */
function(want_main, want_yapf, stubs_only, project_name, want_coveralls, want_sqlfluff) {
  local ver(package) = utils.latestPypiPackageVersionCaret(package),
  local want_main_deps = if want_main then { click: ver('click') } else {},
  local bascom_dep = if want_main && !stubs_only && project_name != 'bascom' then { bascom: ver('bascom') } else {},
  local cz_path_dep = if project_name != 'cz-path' then { 'cz-path': ver('cz-path') } else {},
  main: {
    'typing-extensions': ver('typing-extensions'),
  } + want_main_deps + bascom_dep,
  dev: {
    commitizen: ver('commitizen'),
    mypy: ver('mypy'),
    ruff: ver('ruff'),
  } + cz_path_dep + (
    if want_yapf then { yapf: ver('yapf') } else {}
  ) + (if want_sqlfluff then { sqlfluff: ver('sqlfluff') } else {}),
  docs: {
    'autodoc-pydantic': ver('autodoc-pydantic'),
    doc8: ver('doc8'),
    docutils: '<0.22',
    'enum-tools': { extras: ['sphinx'], version: ver('enum-tools') },
    esbonio: ver('esbonio'),
    numpydoc: ver('numpydoc'),
    'restructuredtext-lint': ver('restructuredtext-lint'),
    sphinx: [{ version: ver('sphinx'), python: '>=3.13' }],
    'sphinx-datatables': ver('sphinx-datatables'),
    'sphinx-immaterial': ver('sphinx-immaterial'),
    tomlkit: ver('tomlkit'),
  } + (if want_main then { 'sphinx-click': ver('sphinx-click') } else {}),
  tests: {
    mock: ver('mock'),
    pytest: ver('pytest'),
    'pytest-cov': ver('pytest-cov'),
    'pytest-mock': ver('pytest-mock'),
  } + if want_coveralls then { coveralls: ver('coveralls') } else {},
}
