tox-toml-fmt 1.1.0__cp39-abi3-musllinux_1_2_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tox-toml-fmt might be problematic. Click here for more details.

@@ -0,0 +1,9 @@
1
+ """Format pyproject.toml files."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .__main__ import runner as run
6
+
7
+ __all__ = [
8
+ "run",
9
+ ]
@@ -0,0 +1,83 @@
1
+ """Main entry point for the formatter."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ from toml_fmt_common import ArgumentGroup, FmtNamespace, TOMLFormatter, _build_cli, run # noqa: PLC2701
8
+
9
+ from ._lib import Settings, format_toml
10
+
11
+ if TYPE_CHECKING:
12
+ from argparse import ArgumentParser
13
+ from collections.abc import Sequence
14
+
15
+
16
+ class PyProjectFmtNamespace(FmtNamespace):
17
+ """Formatting arguments."""
18
+
19
+
20
+ class ToxTOMLFormatter(TOMLFormatter[PyProjectFmtNamespace]):
21
+ """Format pyproject.toml."""
22
+
23
+ def __init__(self) -> None:
24
+ """Create a formatter."""
25
+ super().__init__(PyProjectFmtNamespace())
26
+
27
+ @property
28
+ def prog(self) -> str:
29
+ """:return: program name"""
30
+ return "tox-toml-fmt"
31
+
32
+ @property
33
+ def filename(self) -> str:
34
+ """:return: filename operating on"""
35
+ return "pyproject.toml"
36
+
37
+ def add_format_flags(self, parser: ArgumentGroup) -> None:
38
+ """
39
+ Additional formatter config.
40
+
41
+ :param parser: parser to operate on.
42
+ """
43
+
44
+ @property
45
+ def override_cli_from_section(self) -> tuple[str, ...]:
46
+ """:return: path where config overrides live"""
47
+ return ("tox-toml-fmt",)
48
+
49
+ def format(self, text: str, opt: PyProjectFmtNamespace) -> str: # noqa: PLR6301
50
+ """
51
+ Perform the formatting.
52
+
53
+ :param text: content to operate on
54
+ :param opt: formatter config
55
+ :return: formatted text
56
+ """
57
+ settings = Settings(
58
+ column_width=opt.column_width,
59
+ indent=opt.indent,
60
+ )
61
+ return format_toml(text, settings)
62
+
63
+
64
+ def runner(args: Sequence[str] | None = None) -> int:
65
+ """
66
+ Run the formatter.
67
+
68
+ :param args: CLI arguments
69
+ :return: exit code
70
+ """
71
+ return run(ToxTOMLFormatter(), args)
72
+
73
+
74
+ def _build_our_cli() -> ArgumentParser:
75
+ return _build_cli(ToxTOMLFormatter())[0] # pragma: no cover
76
+
77
+
78
+ __all__ = [
79
+ "runner",
80
+ ]
81
+
82
+ if __name__ == "__main__":
83
+ raise SystemExit(runner())
Binary file
tox_toml_fmt/_lib.pyi ADDED
@@ -0,0 +1,13 @@
1
+ class Settings:
2
+ def __init__(
3
+ self,
4
+ *,
5
+ column_width: int,
6
+ indent: int,
7
+ ) -> None: ...
8
+ @property
9
+ def column_width(self) -> int: ...
10
+ @property
11
+ def indent(self) -> int: ...
12
+
13
+ def format_toml(content: str, settings: Settings) -> str: ...
tox_toml_fmt/py.typed ADDED
File without changes
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.4
2
+ Name: tox-toml-fmt
3
+ Version: 1.1.0
4
+ Classifier: License :: OSI Approved :: MIT License
5
+ Classifier: Operating System :: OS Independent
6
+ Classifier: Programming Language :: Python
7
+ Classifier: Programming Language :: Python :: 3 :: Only
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: toml-fmt-common==1.0.1
14
+ License-File: LICENSE.txt
15
+ Summary: Format your pyproject.toml file
16
+ Keywords: format,pyproject
17
+ Author-email: Bernat Gabor <gaborjbernat@gmail.com>
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
20
+ Project-URL: Bug Tracker, https://github.com/tox-dev/toml-fmt/issues
21
+ Project-URL: Changelog, https://github.com/tox-dev/toml-fmt/blob/main/tox-toml-fmt/CHANGELOG.md
22
+ Project-URL: Documentation, https://github.com/tox-dev/toml-fmt/
23
+ Project-URL: Source Code, https://github.com/tox-dev/toml-fmt
24
+
25
+ # tox-toml-fmt
26
+
27
+ [![PyPI](https://img.shields.io/pypi/v/tox-toml-fmt?style=flat-square)](https://pypi.org/project/tox-toml-fmt)
28
+ [![PyPI - Implementation](https://img.shields.io/pypi/implementation/tox-toml-fmt?style=flat-square)](https://pypi.org/project/tox-toml-fmt)
29
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tox-toml-fmt?style=flat-square)](https://pypi.org/project/tox-toml-fmt)
30
+ [![Downloads](https://static.pepy.tech/badge/tox-toml-fmt/month)](https://pepy.tech/project/tox-toml-fmt)
31
+ [![PyPI - License](https://img.shields.io/pypi/l/tox-toml-fmt?style=flat-square)](https://opensource.org/licenses/MIT)
32
+ [![Build tox-toml-fmt](https://github.com/tox-dev/toml-fmt/actions/workflows/tox_toml_fmt_build.yaml/badge.svg)](https://github.com/tox-dev/toml-fmt/actions/workflows/tox_toml_fmt_build.yaml)
33
+ [![Test tox-toml-fmt](https://github.com/tox-dev/toml-fmt/actions/workflows/tox_toml_fmt_test.yaml/badge.svg)](https://github.com/tox-dev/toml-fmt/actions/workflows/tox_toml_fmt_test.yaml)
34
+
@@ -0,0 +1,11 @@
1
+ tox_toml_fmt-1.1.0.dist-info/METADATA,sha256=p5hKJ-blXY3TWHYhkjOEw0i__QrHJ8U0W4y814ptLiI,2087
2
+ tox_toml_fmt-1.1.0.dist-info/WHEEL,sha256=1WW8nt7uujtCBvm8iT_NUVanM5yCKbRX8auIfo05YWU,105
3
+ tox_toml_fmt-1.1.0.dist-info/entry_points.txt,sha256=Q7OSuY8ukD6r9YC-NIY4ItMvFP3wO9JfnbBPpBIAYKQ,60
4
+ tox_toml_fmt-1.1.0.dist-info/licenses/LICENSE.txt,sha256=kOJeH68qSq6o2V7o5_VziwUqGswMnFgGgQH5Mahr1Yg,1023
5
+ tox_toml_fmt.libs/libgcc_s-98a1ef30.so.1,sha256=XOVRhHznCIpbSdhFoozhla-OfRqBtXftKPQ4cSMKjrs,433441
6
+ tox_toml_fmt/__init__.py,sha256=uN5AcmM1UbDzHeAGg8ME3pj5pcsGlv5hMBHfp7kIEnw,134
7
+ tox_toml_fmt/__main__.py,sha256=JfcfZrh3TLLRAL7ud-8Rj9kdaBJsTtFudd8o9klkORs,2015
8
+ tox_toml_fmt/_lib.abi3.so,sha256=XSoAf4Hn2ZoFghQs_fNgPjlEX6uDClq-aCMeCghVeN4,936553
9
+ tox_toml_fmt/_lib.pyi,sha256=tAxhDxzq_0GshQupB-q8XrtmE3_d0iz4qUiVOrdNGo4,289
10
+ tox_toml_fmt/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ tox_toml_fmt-1.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.9.4)
3
+ Root-Is-Purelib: false
4
+ Tag: cp39-abi3-musllinux_1_2_x86_64
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ tox-toml-fmt=tox_toml_fmt.__main__:runner
@@ -0,0 +1,18 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a
2
+ copy of this software and associated documentation files (the
3
+ "Software"), to deal in the Software without restriction, including
4
+ without limitation the rights to use, copy, modify, merge, publish,
5
+ distribute, sublicense, and/or sell copies of the Software, and to
6
+ permit persons to whom the Software is furnished to do so, subject to
7
+ the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included
10
+ in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
13
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
16
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file