tomli

Форк
0
/
pyproject.toml 
157 строк · 4.4 Кб
1
[build-system]
2
requires = ["flit_core>=3.2.0,<4"]
3
build-backend = "flit_core.buildapi"
4

5
[project]
6
name = "tomli"
7
version = "2.0.1"  # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT
8
description = "A lil' TOML parser"
9
authors = [
10
    { name = "Taneli Hukkinen", email = "hukkin@users.noreply.github.com" },
11
]
12
license = { file = "LICENSE" }
13
requires-python = ">=3.8"
14
readme = "README.md"
15
classifiers = [
16
    "License :: OSI Approved :: MIT License",
17
    "Operating System :: MacOS",
18
    "Operating System :: Microsoft :: Windows",
19
    "Operating System :: POSIX :: Linux",
20
    "Programming Language :: Python :: 3 :: Only",
21
    "Programming Language :: Python :: Implementation :: CPython",
22
    "Programming Language :: Python :: Implementation :: PyPy",
23
    "Topic :: Software Development :: Libraries :: Python Modules",
24
    "Typing :: Typed",
25
]
26
keywords = ["toml"]
27

28
[project.urls]
29
"Homepage" = "https://github.com/hukkin/tomli"
30
"Changelog" = "https://github.com/hukkin/tomli/blob/master/CHANGELOG.md"
31

32

33
[tool.isort]
34
# Force imports to be sorted by module, independent of import type
35
force_sort_within_sections = true
36
# Group first party and local folder imports together
37
no_lines_before = ["LOCALFOLDER"]
38

39
# Configure isort to work without access to site-packages
40
known_first_party = ["tomli", "tests"]
41

42
# Settings for Black compatibility
43
profile = "black"
44

45

46
[tool.tox]
47
legacy_tox_ini = '''
48
[tox]
49
# Only run unittest envs when no args given to tox
50
envlist = py{38,39,310,311,312}
51
isolated_build = True
52

53
[testenv:py{38,39,310,311,312}]
54
description = run tests against a built package
55
commands =
56
    python -m unittest {posargs}
57

58
[testenv:profile]
59
description = run profiler (use e.g. `firefox .tox/prof/output.svg` to open)
60
deps =
61
    -r profiler/requirements.txt
62
allowlist_externals =
63
    mkdir
64
    dot
65
commands =
66
    mkdir -p "{toxworkdir}/prof"
67
    python -m cProfile -o "{toxworkdir}/prof/output.pstats" profiler/profiler_script.py
68
    gprof2dot -f pstats -o "{toxworkdir}/prof/output.dot" "{toxworkdir}/prof/output.pstats"
69
    dot -Tsvg -o "{toxworkdir}/prof/output.svg" "{toxworkdir}/prof/output.dot"
70
    python -c 'import pathlib; print("profiler svg output under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "prof" / "output.svg"))'
71

72
[testenv:pre-commit]
73
description = run linters
74
skip_install = True
75
deps = pre-commit
76
commands = pre-commit run {posargs:--all}
77

78
[testenv:benchmark]
79
description = run the benchmark script against a local Tomli version
80
deps =
81
    -r benchmark/requirements.txt
82
commands =
83
    python -c 'import datetime; print(datetime.date.today())'
84
    python --version
85
    python benchmark/run.py
86

87
[testenv:benchmark-pypi]
88
description = run the benchmark script against the latest Tomli in PyPI
89
skip_install = True
90
deps =
91
    tomli
92
    -r benchmark/requirements.txt
93
commands =
94
    python -c 'import datetime; print(datetime.date.today())'
95
    python --version
96
    python benchmark/run.py
97

98
[testenv:fuzz]
99
description = run the fuzzer against a local Tomli version (needs "apt install clang")
100
deps =
101
    -r fuzzer/requirements.txt
102
allowlist_externals =
103
    mkdir
104
    cp
105
commands =
106
    # Create a folder for persistent corpus and use benchmark data as initial seed
107
    mkdir -p {toxworkdir}/fuzzer-corpus
108
    cp -n benchmark/data.toml {toxworkdir}/fuzzer-corpus/data.toml
109
    # Run fuzzer
110
    python fuzzer/fuzz.py {toxworkdir}/fuzzer-corpus {posargs:-len_control=10000}
111
'''
112

113

114
[tool.coverage.run]
115
branch = true
116
source = ['tomli']
117

118
[tool.coverage.report]
119
# Regexes for lines to exclude from consideration
120
exclude_lines = [
121
    # Re-enable the standard pragma (with extra strictness)
122
    '# pragma: no cover\b',
123
    # Code for static type checkers
124
    'if TYPE_CHECKING:',
125
    # Scripts
126
    'if __name__ == .__main__.:',
127
]
128

129

130
[tool.mypy]
131
show_error_codes = true
132
warn_unreachable = true
133
warn_unused_ignores = true
134
warn_redundant_casts = true
135
warn_unused_configs = true
136
# Disabling incremental mode is required for `warn_unused_configs = true` to work
137
incremental = false
138
disallow_untyped_defs = true
139
check_untyped_defs = true
140
strict_equality = true
141
implicit_reexport = false
142
no_implicit_optional = true
143

144
[[tool.mypy.overrides]]
145
module = "tests.*"
146
disallow_untyped_defs = false
147

148
[[tool.mypy.overrides]]
149
# This matches `benchmark/run.py`. Since benchmark/ is
150
# not a package, we use the module name here.
151
module = "run"
152
ignore_errors = true
153

154
[[tool.mypy.overrides]]
155
# This matches `fuzzer/fuzz.py`.
156
module = "fuzz"
157
ignore_errors = true
158

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.