polylint 0.23.0__py3-none-win_amd64.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.
- polylint/__init__.py +10 -0
- polylint/__main__.py +93 -0
- polylint/bin/poly.exe +0 -0
- polylint-0.23.0.dist-info/METADATA +74 -0
- polylint-0.23.0.dist-info/RECORD +8 -0
- polylint-0.23.0.dist-info/WHEEL +4 -0
- polylint-0.23.0.dist-info/entry_points.txt +3 -0
- polylint-0.23.0.dist-info/licenses/LICENSE +21 -0
polylint/__init__.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Prebuilt distribution of the `poly` universal linter and formatter.
|
|
2
|
+
|
|
3
|
+
The importable package exists only to carry the binary and its console-script
|
|
4
|
+
shims; the tool itself is the `poly` executable, documented at
|
|
5
|
+
https://github.com/Goldziher/poly.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "0.23.0"
|
|
9
|
+
|
|
10
|
+
__all__ = ["__version__"]
|
polylint/__main__.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Console-script shim that hands off to the prebuilt ``poly`` binary.
|
|
2
|
+
|
|
3
|
+
Both the ``poly`` and ``polylint`` entry points call :func:`main`; ``poly`` is
|
|
4
|
+
the canonical command and ``polylint`` is an alias for it, matching the name the
|
|
5
|
+
distribution is published under.
|
|
6
|
+
|
|
7
|
+
Distribution model: this project ships **platform-specific wheels**, each
|
|
8
|
+
carrying exactly one prebuilt binary under ``polylint/bin/``. Nothing is
|
|
9
|
+
downloaded at install time, so installs work offline and the binary is covered
|
|
10
|
+
by the wheel hash pip already verifies.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
# poly: allow-file[T201] this shim is a CLI entry point; stderr is its only output channel.
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import os
|
|
18
|
+
import subprocess
|
|
19
|
+
import sys
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
|
|
22
|
+
#: Directory the platform wheel unpacks the binary into.
|
|
23
|
+
_BIN_DIR = Path(__file__).resolve().parent / "bin"
|
|
24
|
+
|
|
25
|
+
#: Executable name inside that directory.
|
|
26
|
+
_BINARY_NAME = "poly.exe" if os.name == "nt" else "poly"
|
|
27
|
+
|
|
28
|
+
#: Where to point a user whose platform has no wheel.
|
|
29
|
+
_INSTALL_DOCS = "https://github.com/Goldziher/poly#installation"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def binary_path() -> Path | None:
|
|
33
|
+
"""Return the bundled ``poly`` executable, or ``None`` if this wheel has none.
|
|
34
|
+
|
|
35
|
+
A ``None`` here means the *pure-Python fallback wheel* was installed: it is
|
|
36
|
+
published as ``py3-none-any`` so that an unsupported platform gets an
|
|
37
|
+
explanatory command rather than pip's bare "could not find a version that
|
|
38
|
+
satisfies the requirement". pip ranks platform-specific wheels above
|
|
39
|
+
``any``, so a supported platform never resolves to it.
|
|
40
|
+
"""
|
|
41
|
+
candidate = _BIN_DIR / _BINARY_NAME
|
|
42
|
+
return candidate if candidate.is_file() else None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _unsupported_platform_message() -> str:
|
|
46
|
+
return (
|
|
47
|
+
f"poly: this install of polylint {_version()} carries no binary for "
|
|
48
|
+
f"{sys.platform}/{os.uname().machine if hasattr(os, 'uname') else 'unknown'}.\n\n"
|
|
49
|
+
"Prebuilt wheels are published for macOS (x86_64, arm64), Linux x86_64 "
|
|
50
|
+
"(glibc and musl), Linux aarch64 (glibc), and Windows x86_64. If you are "
|
|
51
|
+
"on one of those, your glibc may be older than the wheels require.\n\n"
|
|
52
|
+
f"Install poly directly instead: {_INSTALL_DOCS}"
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _version() -> str:
|
|
57
|
+
from polylint import __version__
|
|
58
|
+
|
|
59
|
+
return __version__
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def main() -> None:
|
|
63
|
+
"""Run the bundled binary with this process's arguments and exit with its status."""
|
|
64
|
+
binary = binary_path()
|
|
65
|
+
if binary is None:
|
|
66
|
+
print(_unsupported_platform_message(), file=sys.stderr)
|
|
67
|
+
raise SystemExit(1)
|
|
68
|
+
|
|
69
|
+
argv = [str(binary), *sys.argv[1:]]
|
|
70
|
+
|
|
71
|
+
if os.name == "nt":
|
|
72
|
+
# Windows has no exec that replaces the process in a way Ctrl-C and job
|
|
73
|
+
# control survive, so spawn and forward the status instead.
|
|
74
|
+
try:
|
|
75
|
+
completed = subprocess.run(argv, check=False) # noqa: S603 - argv is fully controlled
|
|
76
|
+
except OSError as exc:
|
|
77
|
+
print(f"poly: failed to run {binary}: {exc}", file=sys.stderr)
|
|
78
|
+
raise SystemExit(1) from exc
|
|
79
|
+
raise SystemExit(completed.returncode)
|
|
80
|
+
|
|
81
|
+
# execv replaces this process, so poly's exit codes (0 clean, 1 findings,
|
|
82
|
+
# 2 the run verified less than it claims) and any signal that kills it reach
|
|
83
|
+
# the caller exactly as they would from the standalone binary. A wrapper that
|
|
84
|
+
# spawned and re-raised would be one more layer to get wrong.
|
|
85
|
+
try:
|
|
86
|
+
os.execv(str(binary), argv)
|
|
87
|
+
except OSError as exc:
|
|
88
|
+
print(f"poly: failed to exec {binary}: {exc}", file=sys.stderr)
|
|
89
|
+
raise SystemExit(1) from exc
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
if __name__ == "__main__":
|
|
93
|
+
main()
|
polylint/bin/poly.exe
ADDED
|
Binary file
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: polylint
|
|
3
|
+
Version: 0.23.0
|
|
4
|
+
Summary: Universal zero-dependency linter & formatter. Installs the prebuilt poly binary and puts `poly` on PATH.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Goldziher/poly
|
|
6
|
+
Project-URL: Repository, https://github.com/Goldziher/poly
|
|
7
|
+
Project-URL: Changelog, https://github.com/Goldziher/poly/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Issues, https://github.com/Goldziher/poly/issues
|
|
9
|
+
Author-email: Na'aman Hirschfeld <nhirschfeld@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: format,formatter,lint,linter,poly,polyglot
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Rust
|
|
20
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# polylint
|
|
25
|
+
|
|
26
|
+
[poly](https://github.com/Goldziher/poly) is a universal, zero-dependency linter and
|
|
27
|
+
formatter: one pure-Rust binary that wraps best-in-class tools as in-process backends,
|
|
28
|
+
with a tree-sitter generic tier for everything else.
|
|
29
|
+
|
|
30
|
+
> **The command is `poly`.** The distribution is named `polylint` because the `poly` name
|
|
31
|
+
> on PyPI is not ours; `polylint` also works as an alias for the same executable, so
|
|
32
|
+
> either name gets you the tool.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
pip install polylint
|
|
38
|
+
# or
|
|
39
|
+
uv tool install polylint
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
poly lint .
|
|
46
|
+
poly fmt --check .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## How the binary gets here
|
|
50
|
+
|
|
51
|
+
Nothing is downloaded at install time and there is no build step. Each release publishes
|
|
52
|
+
platform-specific wheels carrying one prebuilt binary:
|
|
53
|
+
|
|
54
|
+
| Wheel platform tag | Binary |
|
|
55
|
+
| ------------------------------ | ------------------------------- |
|
|
56
|
+
| `macosx_11_0_arm64` | `aarch64-apple-darwin` |
|
|
57
|
+
| `macosx_10_12_x86_64` | `x86_64-apple-darwin` |
|
|
58
|
+
| `manylinux_2_*_aarch64` | `aarch64-unknown-linux-gnu` |
|
|
59
|
+
| `manylinux_2_*_x86_64` | `x86_64-unknown-linux-gnu` |
|
|
60
|
+
| `musllinux_1_2_x86_64` | `x86_64-unknown-linux-musl` |
|
|
61
|
+
| `win_amd64` | `x86_64-pc-windows-msvc` |
|
|
62
|
+
|
|
63
|
+
A `py3-none-any` wheel is published alongside them. pip ranks platform wheels above it, so
|
|
64
|
+
it is only ever installed where none of the above match — and then `poly` prints which
|
|
65
|
+
platforms are published and where to get a binary, instead of failing with pip's bare
|
|
66
|
+
"could not find a version that satisfies the requirement".
|
|
67
|
+
|
|
68
|
+
## Links
|
|
69
|
+
|
|
70
|
+
- [Documentation](https://github.com/Goldziher/poly#readme)
|
|
71
|
+
- [Changelog](https://github.com/Goldziher/poly/blob/main/CHANGELOG.md)
|
|
72
|
+
- [Issues](https://github.com/Goldziher/poly/issues)
|
|
73
|
+
|
|
74
|
+
MIT licensed.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
polylint/__init__.py,sha256=nU0rWEPeGJ5jUeuDvZ45zY5W9ZWE5kiBYUOtO610fA0,303
|
|
2
|
+
polylint/__main__.py,sha256=H5YmsJGwnnQl-3_u1aR_Mn1U44xQtdaafwKiukZkZgA,3569
|
|
3
|
+
polylint/bin/poly.exe,sha256=sbNHbKz7_YglGL480PWiUfmMGhmXdPYhwmSXKT5qfdE,97366016
|
|
4
|
+
polylint-0.23.0.dist-info/METADATA,sha256=NW_Ttw9G5sU2ACxVkyjg59-fPDgPIZ-MhhAC36DYD1E,2843
|
|
5
|
+
polylint-0.23.0.dist-info/WHEEL,sha256=OA-gEgWbLnh0Tf6JrLOMFR4vOWY4QbBMSZuN6osy-Q0,94
|
|
6
|
+
polylint-0.23.0.dist-info/entry_points.txt,sha256=sJ-s5j7I-GYVcWhrqCLC9VEPgdobVN1GVG5mLuB5h3U,82
|
|
7
|
+
polylint-0.23.0.dist-info/licenses/LICENSE,sha256=5GEcOiom6KIFzWRWpZUTER-YmP8yBlsGt1gsc00Ft-o,1075
|
|
8
|
+
polylint-0.23.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Na'aman Hirschfeld
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|