Files
mkdocs/pyproject.toml
Oleh Prypin 672eba5b9f Follow Python-Markdown approach for getting the title from the first H1
This partly reverts changes in commit e755aaed7e as some of that functionality will be deprecated.
Several more edge cases are taken into account now.

Co-authored-by: Waylan Limberg <waylan.limberg@icloud.com>
2024-02-24 12:33:48 +01:00

242 lines
6.7 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "mkdocs"
description = "Project documentation with Markdown."
readme = "README.md"
license = "BSD-2-Clause"
authors = [
{name = "Tom Christie", email = "tom@tomchristie.com"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Documentation",
"Topic :: Text Processing",
]
dynamic = ["version"]
requires-python = ">=3.8"
dependencies = [
"click >=7.0",
"Jinja2 >=2.11.1",
"markupsafe >=2.0.1",
"Markdown >=3.3.6",
"PyYAML >=5.1",
"watchdog >=2.0",
"ghp-import >=1.0",
"pyyaml_env_tag >=0.1",
"importlib-metadata >=4.4; python_version < '3.10'",
"packaging >=20.5",
"mergedeep >=1.3.4",
"pathspec >=0.11.1",
"mkdocs-get-deps >=0.2.0",
"colorama >=0.4; platform_system == 'Windows'",
]
[project.optional-dependencies]
i18n = [
"babel >=2.9.0",
"setuptools; python_version >= '3.12'" # Workaround: babel doesn't declare its dependency
]
min-versions = [
"click ==7.0",
"Jinja2 ==2.11.1",
"markupsafe ==2.0.1",
"Markdown ==3.3.6",
"PyYAML ==5.1",
"watchdog ==2.0",
"ghp-import ==1.0",
"pyyaml_env_tag ==0.1",
"importlib-metadata ==4.4; python_version < '3.10'",
"packaging ==20.5",
"mergedeep ==1.3.4",
"pathspec ==0.11.1",
"mkdocs-get-deps ==0.2.0",
"colorama ==0.4; platform_system == 'Windows'",
"babel ==2.9.0",
]
[project.urls]
Documentation = "https://www.mkdocs.org/"
Source = "https://github.com/mkdocs/mkdocs"
Issues = "https://github.com/mkdocs/mkdocs/issues"
History = "https://www.mkdocs.org/about/release-notes/"
[project.scripts]
mkdocs = "mkdocs.__main__:cli"
[project.entry-points."mkdocs.themes"]
mkdocs = "mkdocs.themes.mkdocs"
readthedocs = "mkdocs.themes.readthedocs"
[project.entry-points."mkdocs.plugins"]
search = "mkdocs.contrib.search:SearchPlugin"
[tool.hatch.version]
path = "mkdocs/__init__.py"
[tool.hatch.build]
artifacts = ["/mkdocs/**/*.mo"]
[tool.hatch.build.targets.sdist]
include = ["/mkdocs"]
[tool.hatch.build.targets.wheel]
exclude = ["/mkdocs/tests", "*.po", "*.pot", "babel.cfg"]
[tool.hatch.build.hooks.custom]
dependencies = [
"babel",
"setuptools; python_version >= '3.12'" # Workaround: babel doesn't declare its dependency
]
[tool.hatch.env]
requires = ["hatch-mkdocs", "hatch-pip-compile"]
[tool.hatch.envs.default.scripts]
all = [
"hatch run style:fix",
"hatch run types:check",
"hatch run test:test",
"hatch run lint:check",
"hatch run +type=default integration:test",
]
[tool.hatch.envs.test]
features = ["i18n"]
dependencies = [
"coverage",
]
[tool.hatch.envs.test.scripts]
test = 'python -m unittest discover -s mkdocs -p "*tests.py"'
_coverage = [
'coverage run --source=mkdocs --omit "mkdocs/tests/*" -m unittest discover -s mkdocs -p "*tests.py"',
"coverage xml",
"coverage report --show-missing"
]
with-coverage = "test"
[[tool.hatch.envs.test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"]
type = ["default", "min-req"]
[tool.hatch.envs.test.overrides]
matrix.type.features = [
{ value = "min-versions", if = ["min-req"] },
]
matrix.type.scripts = [
{ key = "with-coverage", value = "_coverage", if = ["default"] },
]
[tool.hatch.env.collectors.mkdocs.integration]
path = "mkdocs.yml"
[tool.hatch.envs.integration]
detached = false
[tool.hatch.envs.integration.scripts]
test = "python -m mkdocs.tests.integration"
[[tool.hatch.envs.integration.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3"]
type = ["default", "no-babel"]
[tool.hatch.envs.integration.overrides]
matrix.type.features = [
{ value = "i18n", if = ["default"] },
]
[tool.hatch.envs.types]
dependencies = [
"mypy",
"babel",
"types-Markdown",
"types-pytz",
"types-PyYAML",
"types-setuptools",
"typing-extensions",
]
[tool.hatch.envs.types.scripts]
check = "mypy mkdocs"
[tool.hatch.envs.style]
type = "pip-compile"
detached = true
dependencies = [
"black",
"isort",
"ruff",
]
[tool.hatch.envs.style.scripts]
check = [
"isort --check-only --diff mkdocs docs",
"black -q --check --diff mkdocs docs",
"lint",
]
lint = [
"ruff check mkdocs docs {args}"
]
fix = [
"lint --fix",
"format",
]
format = [
"isort -q mkdocs docs",
"black -q mkdocs docs",
]
[tool.hatch.envs.lint]
detached = true
dependencies = [
"codespell",
]
[tool.hatch.envs.lint.scripts]
spelling = 'codespell mkdocs docs *.* -S LC_MESSAGES -S "*.min.js" -S "lunr*.js" -S fontawesome-webfont.svg -S tinyseg.js'
markdown = "npm exec --yes -- markdownlint-cli README.md CONTRIBUTING.md docs/ --ignore docs/CNAME"
js = "npm exec --yes -- jshint mkdocs/"
css = "npm exec --yes -- csslint --quiet mkdocs/"
check = ["markdown", "js", "css", "spelling"]
[tool.hatch.env.collectors.mkdocs.docs]
path = "mkdocs.yml"
[tool.hatch.envs.docs]
type = "pip-compile"
detached = false
[tool.black]
line-length = 100
skip-string-normalization = true
[tool.isort]
profile = "black"
line_length = 100
[tool.ruff]
select = [
"F", "W", "E", "UP", "YTT", "C4", "DTZ", "FA", "ISC", "PIE", "T20", "RSE", "TCH",
"B002", "B003", "B005", "B007", "B009", "B012", "B013", "B014", "B015", "B018", "B020", "B021", "B023", "B026", "B033", "B034", "B905",
"COM818",
"D200", "D201", "D202", "D204", "D207", "D208", "D209", "D210", "D211", "D213", "D214", "D300", "D301", "D400", "D402", "D403", "D405", "D412", "D414", "D415", "D416", "D417", "D419",
"PERF101",
"PGH002", "PGH004", "PGH005",
"FLY002",
"PLC", "PLE", "PLR0124", "PLR0133", "PLR0206", "PLR0402", "PLR1701", "PLR1722", "PLW0120", "PLW0127", "PLW0129", "PLW0131", "PLW0406", "PLW0602", "PLW0603", "PLW0711",
"RUF001", "RUF005", "RUF007", "RUF010", "RUF013", "RUF100", "RUF200",
"SIM101", "SIM107", "SIM201", "SIM202", "SIM208", "SIM210", "SIM211", "SIM300", "SIM401", "SIM910",
]
ignore = ["E501", "E731"]
[tool.ruff.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.mypy]
warn_unreachable = true
no_implicit_optional = true
show_error_codes = true