blob: 7e0bb57cb0162c445d8ad77dd4624057b13e560b [file] [log] [blame]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "tomli"
version = "1.0.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
authors = ["Taneli Hukkinen <hukkin@users.noreply.github.com>"]
description = "A lil' TOML parser"
repository = "https://github.com/hukkin/tomli"
readme = "README.md"
license = "MIT"
classifiers = [
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
keywords = ["toml"]
packages = [
{include = "tomli"},
]
include = ["tomli/py.typed"]
[tool.poetry.urls]
"Changelog" = "https://github.com/hukkin/tomli/blob/master/CHANGELOG.md"
[tool.poetry.dependencies]
python = "^3.6"
[tool.poetry.dev-dependencies]
# Tests
pytest = "*"
pytest-randomly = "*"
pytest-cov = ">=2.12.1"
python-dateutil = "*"
[tool.isort]
# Force imports to be sorted by module, independent of import type
force_sort_within_sections = true
# Group first party and local folder imports together
no_lines_before = ["LOCALFOLDER"]
# Configure isort to work without access to site-packages
known_first_party = ["tomli", "tests"]
# Settings for Black compatibility
profile = "black"
[tool.pytest.ini_options]
addopts = "--strict-markers --strict-config"
xfail_strict = true
[tool.tox]
legacy_tox_ini = """
[tox]
# Only run pytest envs when no args given to tox
envlist = py{36,37,38,39}
isolated_build = True
requires =
poetry >= 1.1.4
[testenv]
allowlist_externals = poetry
[testenv:py{36,37,38,39}]
description = run tests
commands_pre =
# TODO: Use --dev-only flag when poetry 1.2 is released
poetry install --no-root
commands =
pytest {posargs}
[testenv:profile]
description = run profiler (use e.g. `firefox .tox/prof/combined.svg` to open)
setenv =
PROFILER_ITERATIONS=1000
commands_pre =
# TODO: Use --dev-only flag when poetry 1.2 is released
poetry install --no-root
pip install pytest-profiling
commands =
pytest tests/test_for_profiler.py --profile-svg --pstats-dir "{toxworkdir}/prof"
python -c 'import pathlib; print("profiler svg output under file://\\{0\\}".format(pathlib.Path(r"{toxworkdir}") / "prof" / "combined.svg"))'
[testenv:pre-commit]
description = run linters
skip_install = True
deps = pre-commit
commands = pre-commit run {posargs:--all}
[testenv:benchmark]
description = run the benchmark script against a local Tomli version
deps =
-r benchmark/requirements.txt
commands =
python -c 'import datetime; print(datetime.date.today())'
python --version
python benchmark/run.py
[testenv:benchmark-pypi]
description = run the benchmark script against the latest Tomli in PyPI
skip_install = True
deps =
tomli
-r benchmark/requirements.txt
commands =
python -c 'import datetime; print(datetime.date.today())'
python --version
python benchmark/run.py
"""
[tool.coverage.run]
branch = true
omit = ["tests/*", "*/site-packages/*"]
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Code for static type checkers
"if TYPE_CHECKING:",
# Scripts
'if __name__ == .__main__.:',
]
[tool.mypy]
show_error_codes = true
warn_unreachable = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_unused_configs = true
# Disabling incremental mode is required for `warn_unused_configs = true` to work
incremental = false
disallow_untyped_defs = true
check_untyped_defs = true
strict_equality = true
implicit_reexport = false
no_implicit_optional = true
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[[tool.mypy.overrides]]
# This matches `benchmark/run.py`. Since benchmark/ is
# not a package, we use the module name here.
module = "run"
ignore_errors = true