[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.sdist]
[tool.hatch.build.targets.wheel]

[project]
name = "midgy"
description = "run markdown as python code"
readme = "README.md"
requires-python = ">=3.7"
license-files = { paths = ["LICENSE"] }
keywords = []
authors = [{ name = "tonyfast", email = "tony.fast@gmail.com" }]
classifiers = [
  "Development Status :: 4 - Beta",
  "Natural Language :: English",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3.7",
  "Programming Language :: Python :: 3.8",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: Implementation :: CPython",
  "Programming Language :: Python :: Implementation :: PyPy",
  "License :: OSI Approved :: BSD License",
]
dependencies = [
  "markdown-it-py[plugins,linkify]",
  "importnb",
]
dynamic = ["version"]

[project.optional-dependencies]
test = ["pytest"]
black = ["black"]
rich = ["rich"]

[project.scripts]
midgy = "midgy.__main__:main"

[project.urls]
Documentation = "https://github.com/deathbeds/midgy#readme"
Issues = "https://github.com/deathbeds/midgy/issues"
Source = "https://github.com/deathbeds/midgy"

[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/midgy/_version.py"

[tool.coverage.html]
directory = "docs/coverage"

[tool.hatch.envs.test]
description = "the testing environment"
dependencies = ["pytest", "pytest-cov", "ruamel.yaml"]

[tool.hatch.envs.test.scripts]
cov = "pytest"

[tool.pytest.ini_options]
addopts = "-pno:warnings -vv --cov=midgy --cov-report html:docs/coverage --ignore site"

[tool.coverage.run]
omit = ["*/__*__.py", "*/_version.py", "site/*"]

[tool.hatch.envs.docs]
description = "the docs environment"
dependencies = ["mkdocs", "mkdocs-material", "ruamel.yaml"]

[tool.hatch.envs.docs.scripts]
build = "mkdocs build"
serve = "mkdocs serve"

# formatting cause linting sucks
[tool.isort]
profile = "black"

[tool.black]
line_length = 100

[tool.hatch.envs.format]
description = "the formatting environment"
skip-install = true
dependencies = ["black", "isort"]

[tool.hatch.envs.format.scripts]
code = """
isort .
black .
"""

[tool.doit]
verbosity = 2
backend = "json"