[project]
    name = "zanj"
    version = "0.6.0"
    description = "save and load complex objects to disk without pickling"
    license = "GPL-3.0-only"
    authors = [
        { name = "Michael Ivanitskiy", email = "mivanits@umich.edu" }
    ]
    readme = "README.md"
    requires-python = ">=3.8"
    classifiers=[
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Python :: 3.12",
        "Development Status :: 4 - Beta",
        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
        "Operating System :: OS Independent",
    ]

    dependencies = [
        "muutils>=0.8.0",
        "numpy>=1.24.4",
        "jaxtyping>=0.2.12",
    ]


[project.optional-dependencies]
pandas = ["pandas>=1.5.3"]
polars = ["polars>=0.20.0"]
torch = [
    # we still need torch for < 3.8 but users will have to figure out a working version themselves
    "torch>=1.13.1; python_version >= '3.9'",
    "torch==1.13.1; python_version < '3.9'",
    "h11>=0.16.0", # see https://github.com/mivanit/ZANJ/security/dependabot/13
]

[project.urls]
    Homepage = "https://miv.name/zanj"
    Repository = "https://github.com/mivanit/zanj"
    Documentation = "https://miv.name/zanj/"
	Issues = "https://github.com/mivanit/ZANJ/issues"



[dependency-groups]
    dev = [
        # typing
        "mypy>=1.0.1",
        "ty>=0.0.18",
        "basedpyright",
        # tests & coverage
        "pytest>=8.2.2",
        "pytest-cov>=4.1.0",
        # for testing plotting and notebooks
        "ipykernel>=6.23.2",
        # tornado depended on by notebook stuff, see
        # https://github.com/mivanit/ZANJ/security/dependabot/22
        "tornado>=6.5; python_version >= '3.9'",
        "jupyter",
        "matplotlib>=3.0.0",
        "plotly>=5.0.0",
        # see https://github.com/mivanit/ZANJ/security/dependabot/18
        "setuptools>=78.1.1; python_version >= '3.9'",
        # generating docs
        "pdoc>=14.6.0",
        # https://github.com/mivanit/ZANJ/security/dependabot/4
        "jinja2>=3.1.6",
        # lmcat -- a custom library. not exactly docs, but lets an LLM see all the code
        "lmcat>=0.2.0; python_version >= '3.11'",
        # tomli since no tomlib in python < 3.11
        "tomli>=2.1.0; python_version < '3.11'",
        # for uploading
        "twine",
        # for testing dataframe support
        "pandas>=1.5.3",
        "polars>=0.20.0",
    ]
    lint = [
        # lint
        "ruff>=0.4.8",
    ]

[build-system]
    requires = ["hatchling"]
    build-backend = "hatchling.build"


[tool.ruff]
    exclude = ["tests/input_data", "tests/junk_data", ".meta/scripts/"]

[tool.mypy]
    packages = ["zanj"]
    exclude = ["tests/input_data", "tests/junk_data"]
    show_error_codes = true

[tool.ty.src]
    exclude = ["tests/", "demo.ipynb"]

[tool.ty.rules]
    unused-type-ignore-comment = "ignore"
    too-many-positional-arguments = "ignore"
    unused-ignore-comment = "ignore"

[tool.lmcat]
    output = "docs/other/lmcat.txt" # changing this might mean it wont be accessible from the docs
    ignore_patterns = [
		"docs/**",
		".venv/**",
		".git/**",
		".meta/**",
        ".ruff_cache/**",
		"uv.lock",
		"LICENSE",
	]
    [tool.lmcat.glob_process]
        "[mM]akefile" = "makefile_recipes"
        "*.ipynb" = "ipynb_to_md"
        "*.csv" = "csv_preview_5_lines"

# for configuring this tool (makefile, make_docs.py)
# ============================================================
[tool.makefile]
[tool.makefile.docs]
    output_dir = "docs"
    no_clean = [
        ".nojekyll",  # For GitHub Pages
        "temp",
    ]
    markdown_headings_increment = 2
    warnings_ignore = []

    [tool.makefile.docs.notebooks]
        enabled = true
        source_path = "."
        output_path_relative = "notebooks"
        [tool.makefile.docs.notebooks.descriptions]
            "demo" = "Example notebook showing basic usage"


[tool.makefile.uv-exports]
	args = [
		"--no-hashes"
	]
	exports = [
		# no groups, no extras, just the base dependencies
		{ name = "base", groups = false, extras = false },
		# all groups
		{ name = "groups", groups = true, extras = false },
		# only the lint group -- custom options for this
		{ name = "lint", options = ["--only-group", "lint"] },
		# # all groups and extras
		{ name = "all", filename="requirements.txt", groups = true, extras=true },
		# # all groups and extras, a different way
		{ name = "all", groups = true, options = ["--all-extras"] },
	]

# configures `make todo`
[tool.makefile.inline-todo]
	search_dir = "."
	out_file_base = "docs/other/todo-inline.md"
	context_lines = 2
	extensions = ["py", "md"]
	tags = ["CRIT", "TODO", "FIXME", "HACK", "BUG", "DOC"]
	exclude = [
		"docs/**",
		".venv/**",
	]
    [tool.makefile.inline-todo.tag_label_map]
        "BUG" = "bug"
        "TODO" = "enhancement"
		"DOC" = "documentation"

# ============================================================

