zclick 0.1.1a1__tar.gz

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.
Files changed (90) hide show
  1. zclick-0.1.1a1/Cargo.lock +147 -0
  2. zclick-0.1.1a1/Cargo.toml +15 -0
  3. zclick-0.1.1a1/LICENSE +21 -0
  4. zclick-0.1.1a1/PKG-INFO +206 -0
  5. zclick-0.1.1a1/README.md +145 -0
  6. zclick-0.1.1a1/THIRD_PARTY_LICENSES.md +69 -0
  7. zclick-0.1.1a1/compatibility/CLICK_LICENSE.txt +28 -0
  8. zclick-0.1.1a1/crates/zclick-core/Cargo.toml +11 -0
  9. zclick-0.1.1a1/crates/zclick-core/src/lib.rs +12 -0
  10. zclick-0.1.1a1/crates/zclick-core/src/parse.rs +640 -0
  11. zclick-0.1.1a1/crates/zclick-core/src/text.rs +436 -0
  12. zclick-0.1.1a1/crates/zclick-core/tests/semantics.rs +326 -0
  13. zclick-0.1.1a1/crates/zclick-python/Cargo.toml +23 -0
  14. zclick-0.1.1a1/crates/zclick-python/build.rs +3 -0
  15. zclick-0.1.1a1/crates/zclick-python/src/dispatch.rs +288 -0
  16. zclick-0.1.1a1/crates/zclick-python/src/interpreter.rs +32 -0
  17. zclick-0.1.1a1/crates/zclick-python/src/lib.rs +420 -0
  18. zclick-0.1.1a1/licenses/manifest.json +335 -0
  19. zclick-0.1.1a1/licenses/rust/heck-0.5.0/LICENSE-APACHE +201 -0
  20. zclick-0.1.1a1/licenses/rust/heck-0.5.0/LICENSE-MIT +25 -0
  21. zclick-0.1.1a1/licenses/rust/libc-0.2.191/LICENSE-APACHE +176 -0
  22. zclick-0.1.1a1/licenses/rust/libc-0.2.191/LICENSE-MIT +25 -0
  23. zclick-0.1.1a1/licenses/rust/once_cell-1.21.4/LICENSE-APACHE +201 -0
  24. zclick-0.1.1a1/licenses/rust/once_cell-1.21.4/LICENSE-MIT +23 -0
  25. zclick-0.1.1a1/licenses/rust/portable-atomic-1.15.0/LICENSE-APACHE +177 -0
  26. zclick-0.1.1a1/licenses/rust/portable-atomic-1.15.0/LICENSE-MIT +23 -0
  27. zclick-0.1.1a1/licenses/rust/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
  28. zclick-0.1.1a1/licenses/rust/proc-macro2-1.0.107/LICENSE-MIT +23 -0
  29. zclick-0.1.1a1/licenses/rust/pyo3-0.30.1/LICENSE-APACHE +178 -0
  30. zclick-0.1.1a1/licenses/rust/pyo3-0.30.1/LICENSE-MIT +25 -0
  31. zclick-0.1.1a1/licenses/rust/pyo3-0.30.1/pyo3-runtime/LICENSE-APACHE +178 -0
  32. zclick-0.1.1a1/licenses/rust/pyo3-0.30.1/pyo3-runtime/LICENSE-MIT +25 -0
  33. zclick-0.1.1a1/licenses/rust/pyo3-build-config-0.30.1/LICENSE-APACHE +178 -0
  34. zclick-0.1.1a1/licenses/rust/pyo3-build-config-0.30.1/LICENSE-MIT +25 -0
  35. zclick-0.1.1a1/licenses/rust/pyo3-ffi-0.30.1/LICENSE-APACHE +178 -0
  36. zclick-0.1.1a1/licenses/rust/pyo3-ffi-0.30.1/LICENSE-MIT +25 -0
  37. zclick-0.1.1a1/licenses/rust/pyo3-macros-0.30.1/LICENSE-APACHE +178 -0
  38. zclick-0.1.1a1/licenses/rust/pyo3-macros-0.30.1/LICENSE-MIT +25 -0
  39. zclick-0.1.1a1/licenses/rust/pyo3-macros-backend-0.30.1/LICENSE-APACHE +178 -0
  40. zclick-0.1.1a1/licenses/rust/pyo3-macros-backend-0.30.1/LICENSE-MIT +25 -0
  41. zclick-0.1.1a1/licenses/rust/quote-1.0.47/LICENSE-APACHE +176 -0
  42. zclick-0.1.1a1/licenses/rust/quote-1.0.47/LICENSE-MIT +23 -0
  43. zclick-0.1.1a1/licenses/rust/syn-3.0.10/LICENSE-APACHE +176 -0
  44. zclick-0.1.1a1/licenses/rust/syn-3.0.10/LICENSE-MIT +23 -0
  45. zclick-0.1.1a1/licenses/rust/target-lexicon-0.13.5/LICENSE +220 -0
  46. zclick-0.1.1a1/licenses/rust/unicode-ident-1.0.27/LICENSE-APACHE +176 -0
  47. zclick-0.1.1a1/licenses/rust/unicode-ident-1.0.27/LICENSE-MIT +23 -0
  48. zclick-0.1.1a1/licenses/rust/unicode-ident-1.0.27/LICENSE-UNICODE +39 -0
  49. zclick-0.1.1a1/licenses/rust/zclap-0.1.4/LICENSE +21 -0
  50. zclick-0.1.1a1/licenses/rust-standard-library/1.99.1/COPYRIGHT +34 -0
  51. zclick-0.1.1a1/licenses/rust-standard-library/1.99.1/COPYRIGHT-library.html +29357 -0
  52. zclick-0.1.1a1/licenses/rust-standard-library/1.99.1/LICENSE-APACHE +176 -0
  53. zclick-0.1.1a1/licenses/rust-standard-library/1.99.1/LICENSE-MIT +25 -0
  54. zclick-0.1.1a1/pyproject.toml +48 -0
  55. zclick-0.1.1a1/python/zclick/__init__.py +55 -0
  56. zclick-0.1.1a1/python/zclick/__init__.pyi +71 -0
  57. zclick-0.1.1a1/python/zclick/_compat.py +145 -0
  58. zclick-0.1.1a1/python/zclick/_compat.pyi +156 -0
  59. zclick-0.1.1a1/python/zclick/_native.pyi +28 -0
  60. zclick-0.1.1a1/python/zclick/_termui_impl.py +399 -0
  61. zclick-0.1.1a1/python/zclick/_termui_impl.pyi +171 -0
  62. zclick-0.1.1a1/python/zclick/_textwrap.py +30 -0
  63. zclick-0.1.1a1/python/zclick/_textwrap.pyi +27 -0
  64. zclick-0.1.1a1/python/zclick/_utils.py +16 -0
  65. zclick-0.1.1a1/python/zclick/_utils.pyi +25 -0
  66. zclick-0.1.1a1/python/zclick/_winconsole.py +172 -0
  67. zclick-0.1.1a1/python/zclick/_winconsole.pyi +115 -0
  68. zclick-0.1.1a1/python/zclick/core.py +1198 -0
  69. zclick-0.1.1a1/python/zclick/core.pyi +607 -0
  70. zclick-0.1.1a1/python/zclick/decorators.py +202 -0
  71. zclick-0.1.1a1/python/zclick/decorators.pyi +91 -0
  72. zclick-0.1.1a1/python/zclick/exceptions.py +160 -0
  73. zclick-0.1.1a1/python/zclick/exceptions.pyi +128 -0
  74. zclick-0.1.1a1/python/zclick/formatting.py +118 -0
  75. zclick-0.1.1a1/python/zclick/formatting.pyi +66 -0
  76. zclick-0.1.1a1/python/zclick/globals.py +36 -0
  77. zclick-0.1.1a1/python/zclick/globals.pyi +24 -0
  78. zclick-0.1.1a1/python/zclick/parser.py +159 -0
  79. zclick-0.1.1a1/python/zclick/parser.pyi +99 -0
  80. zclick-0.1.1a1/python/zclick/py.typed +0 -0
  81. zclick-0.1.1a1/python/zclick/shell_completion.py +337 -0
  82. zclick-0.1.1a1/python/zclick/shell_completion.pyi +161 -0
  83. zclick-0.1.1a1/python/zclick/termui.py +213 -0
  84. zclick-0.1.1a1/python/zclick/termui.pyi +111 -0
  85. zclick-0.1.1a1/python/zclick/testing.py +286 -0
  86. zclick-0.1.1a1/python/zclick/testing.pyi +171 -0
  87. zclick-0.1.1a1/python/zclick/types.py +485 -0
  88. zclick-0.1.1a1/python/zclick/types.pyi +384 -0
  89. zclick-0.1.1a1/python/zclick/utils.py +296 -0
  90. zclick-0.1.1a1/python/zclick/utils.pyi +133 -0
@@ -0,0 +1,147 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "heck"
7
+ version = "0.5.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
10
+
11
+ [[package]]
12
+ name = "libc"
13
+ version = "0.2.191"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
16
+
17
+ [[package]]
18
+ name = "once_cell"
19
+ version = "1.21.4"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
22
+
23
+ [[package]]
24
+ name = "portable-atomic"
25
+ version = "1.15.0"
26
+ source = "registry+https://github.com/rust-lang/crates.io-index"
27
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
28
+
29
+ [[package]]
30
+ name = "proc-macro2"
31
+ version = "1.0.107"
32
+ source = "registry+https://github.com/rust-lang/crates.io-index"
33
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
34
+ dependencies = [
35
+ "unicode-ident",
36
+ ]
37
+
38
+ [[package]]
39
+ name = "pyo3"
40
+ version = "0.30.1"
41
+ source = "registry+https://github.com/rust-lang/crates.io-index"
42
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
43
+ dependencies = [
44
+ "libc",
45
+ "once_cell",
46
+ "portable-atomic",
47
+ "pyo3-build-config",
48
+ "pyo3-ffi",
49
+ "pyo3-macros",
50
+ ]
51
+
52
+ [[package]]
53
+ name = "pyo3-build-config"
54
+ version = "0.30.1"
55
+ source = "registry+https://github.com/rust-lang/crates.io-index"
56
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
57
+ dependencies = [
58
+ "target-lexicon",
59
+ ]
60
+
61
+ [[package]]
62
+ name = "pyo3-ffi"
63
+ version = "0.30.1"
64
+ source = "registry+https://github.com/rust-lang/crates.io-index"
65
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
66
+ dependencies = [
67
+ "libc",
68
+ "pyo3-build-config",
69
+ ]
70
+
71
+ [[package]]
72
+ name = "pyo3-macros"
73
+ version = "0.30.1"
74
+ source = "registry+https://github.com/rust-lang/crates.io-index"
75
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
76
+ dependencies = [
77
+ "proc-macro2",
78
+ "pyo3-macros-backend",
79
+ "quote",
80
+ "syn",
81
+ ]
82
+
83
+ [[package]]
84
+ name = "pyo3-macros-backend"
85
+ version = "0.30.1"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
88
+ dependencies = [
89
+ "heck",
90
+ "proc-macro2",
91
+ "quote",
92
+ "syn",
93
+ ]
94
+
95
+ [[package]]
96
+ name = "quote"
97
+ version = "1.0.47"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
100
+ dependencies = [
101
+ "proc-macro2",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "syn"
106
+ version = "3.0.10"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
109
+ dependencies = [
110
+ "proc-macro2",
111
+ "quote",
112
+ "unicode-ident",
113
+ ]
114
+
115
+ [[package]]
116
+ name = "target-lexicon"
117
+ version = "0.13.5"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
120
+
121
+ [[package]]
122
+ name = "unicode-ident"
123
+ version = "1.0.27"
124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
125
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
126
+
127
+ [[package]]
128
+ name = "zclap"
129
+ version = "0.1.4"
130
+ source = "registry+https://github.com/rust-lang/crates.io-index"
131
+ checksum = "5efb5b25a7eb925fe9943888238d1e261224fa629456f4abe203b1deb34ac102"
132
+
133
+ [[package]]
134
+ name = "zclick-core"
135
+ version = "0.1.1-alpha.1"
136
+ dependencies = [
137
+ "zclap",
138
+ ]
139
+
140
+ [[package]]
141
+ name = "zclick-python"
142
+ version = "0.1.1-alpha.1"
143
+ dependencies = [
144
+ "pyo3",
145
+ "pyo3-build-config",
146
+ "zclick-core",
147
+ ]
@@ -0,0 +1,15 @@
1
+ [workspace]
2
+ resolver = "3"
3
+ members = ["crates/zclick-core", "crates/zclick-python"]
4
+
5
+ [workspace.package]
6
+ version = "0.1.1-alpha.1"
7
+ edition = "2024"
8
+ rust-version = "1.99.1"
9
+ license = "MIT"
10
+ repository = "https://github.com/LIghtJUNction/zclick"
11
+
12
+ [profile.release]
13
+ lto = "thin"
14
+ codegen-units = 1
15
+ strip = "debuginfo"
zclick-0.1.1a1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 LIghtJUNction
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.
@@ -0,0 +1,206 @@
1
+ Metadata-Version: 2.4
2
+ Name: zclick
3
+ Version: 0.1.1a1
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Programming Language :: Python :: 3
6
+ Classifier: Programming Language :: Rust
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Typing :: Typed
9
+ Requires-Dist: pytest==9.2.0 ; extra == 'test'
10
+ Requires-Dist: click==8.5.1 ; extra == 'test'
11
+ Requires-Dist: hypothesis==6.170.15 ; python_full_version >= '3.11' and extra == 'test'
12
+ Requires-Dist: hypothesis==6.168.5 ; python_full_version < '3.11' and extra == 'test'
13
+ Provides-Extra: test
14
+ License-File: LICENSE
15
+ License-File: THIRD_PARTY_LICENSES.md
16
+ License-File: compatibility/CLICK_LICENSE.txt
17
+ License-File: licenses/manifest.json
18
+ License-File: licenses/rust/heck-0.5.0/LICENSE-APACHE
19
+ License-File: licenses/rust/heck-0.5.0/LICENSE-MIT
20
+ License-File: licenses/rust/libc-0.2.191/LICENSE-APACHE
21
+ License-File: licenses/rust/libc-0.2.191/LICENSE-MIT
22
+ License-File: licenses/rust/once_cell-1.21.4/LICENSE-APACHE
23
+ License-File: licenses/rust/once_cell-1.21.4/LICENSE-MIT
24
+ License-File: licenses/rust/portable-atomic-1.15.0/LICENSE-APACHE
25
+ License-File: licenses/rust/portable-atomic-1.15.0/LICENSE-MIT
26
+ License-File: licenses/rust/proc-macro2-1.0.107/LICENSE-APACHE
27
+ License-File: licenses/rust/proc-macro2-1.0.107/LICENSE-MIT
28
+ License-File: licenses/rust/pyo3-0.30.1/LICENSE-APACHE
29
+ License-File: licenses/rust/pyo3-0.30.1/LICENSE-MIT
30
+ License-File: licenses/rust/pyo3-0.30.1/pyo3-runtime/LICENSE-APACHE
31
+ License-File: licenses/rust/pyo3-0.30.1/pyo3-runtime/LICENSE-MIT
32
+ License-File: licenses/rust/pyo3-build-config-0.30.1/LICENSE-APACHE
33
+ License-File: licenses/rust/pyo3-build-config-0.30.1/LICENSE-MIT
34
+ License-File: licenses/rust/pyo3-ffi-0.30.1/LICENSE-APACHE
35
+ License-File: licenses/rust/pyo3-ffi-0.30.1/LICENSE-MIT
36
+ License-File: licenses/rust/pyo3-macros-0.30.1/LICENSE-APACHE
37
+ License-File: licenses/rust/pyo3-macros-0.30.1/LICENSE-MIT
38
+ License-File: licenses/rust/pyo3-macros-backend-0.30.1/LICENSE-APACHE
39
+ License-File: licenses/rust/pyo3-macros-backend-0.30.1/LICENSE-MIT
40
+ License-File: licenses/rust/quote-1.0.47/LICENSE-APACHE
41
+ License-File: licenses/rust/quote-1.0.47/LICENSE-MIT
42
+ License-File: licenses/rust/syn-3.0.10/LICENSE-APACHE
43
+ License-File: licenses/rust/syn-3.0.10/LICENSE-MIT
44
+ License-File: licenses/rust/target-lexicon-0.13.5/LICENSE
45
+ License-File: licenses/rust/unicode-ident-1.0.27/LICENSE-APACHE
46
+ License-File: licenses/rust/unicode-ident-1.0.27/LICENSE-MIT
47
+ License-File: licenses/rust/unicode-ident-1.0.27/LICENSE-UNICODE
48
+ License-File: licenses/rust/zclap-0.1.4/LICENSE
49
+ License-File: licenses/rust-standard-library/1.99.1/COPYRIGHT
50
+ License-File: licenses/rust-standard-library/1.99.1/COPYRIGHT-library.html
51
+ License-File: licenses/rust-standard-library/1.99.1/LICENSE-APACHE
52
+ License-File: licenses/rust-standard-library/1.99.1/LICENSE-MIT
53
+ Summary: Rust and zclap based command line interfaces for Python
54
+ Author: LIghtJUNction
55
+ License-Expression: MIT
56
+ Requires-Python: >=3.10
57
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
58
+ Project-URL: Issues, https://github.com/LIghtJUNction/zclick/issues
59
+ Project-URL: Source, https://github.com/LIghtJUNction/zclick
60
+
61
+ # zclick
62
+
63
+ Python command-line interfaces backed by Rust and zclap. Import the public API
64
+ as `import zclick as click`, including the matching `zclick.core`, `zclick.types`,
65
+ `zclick.testing` and `zclick.shell_completion` submodules.
66
+
67
+ The fixed compatibility target is **Click 8.5.1**, source commit
68
+ [`cf19179`](https://github.com/pallets/click/tree/cf19179e8e2fd54c601378cec9e0d21bb12b6fb1).
69
+ The versioned documentation, API inventory and original tests are pinned in
70
+ [`compatibility/target.json`](compatibility/target.json). The implementation uses
71
+ registry **zclap 0.1.4**, **PyO3 0.30.1** and **Rust 1.99.1 / Edition 2024**.
72
+
73
+ **This is a preview release; the complete compatibility target is not yet met.**
74
+ CPython subinterpreters are currently unsupported and are explicitly rejected
75
+ at native module initialization. The locked PyO3 binding has Python object
76
+ caches that are not partitioned by interpreter. See the
77
+ [open compatibility record](compatibility/known-gaps.json). Stable publication
78
+ is blocked while an open compatibility gap remains.
79
+
80
+ [Compatibility evidence](COMPATIBILITY.md) · [Performance measurements](docs/performance.md) ·
81
+ [Architecture](docs/architecture.md) · [Build and release](docs/development.md)
82
+
83
+ ## Installation and a first command
84
+
85
+ After PyPI publication, install the preview with:
86
+
87
+ ```sh
88
+ pip install --pre zclick
89
+ ```
90
+
91
+ Published wheels and source archives are also available through
92
+ [GitHub Releases](https://github.com/LIghtJUNction/zclick/releases). Ordinary
93
+ CPython wheels support Python 3.10 and newer; PyPy and free-threaded CPython
94
+ require their corresponding wheels or an interpreter-specific source build.
95
+ The intended stable installation is `pip install zclick` once the outstanding
96
+ compatibility gate is satisfied.
97
+
98
+ ```python
99
+ import zclick as click
100
+
101
+ @click.command()
102
+ @click.option("--count", default=1, type=int, help="Number of greetings.")
103
+ @click.option("--name", prompt="Your name", help="The person to greet.")
104
+ def hello(count, name):
105
+ for _ in range(count):
106
+ click.echo(f"Hello, {name}!")
107
+
108
+ if __name__ == "__main__":
109
+ hello()
110
+ ```
111
+
112
+ ## Migration
113
+
114
+ Replace `import click` with `import zclick as click`. Replace submodule imports,
115
+ for example `from click.testing import CliRunner`, with
116
+ `from zclick.testing import CliRunner`.
117
+
118
+ The wheel installs the `zclick` namespace. It has **no third-party Python runtime
119
+ requirements**, does not install a top-level `click` package, and does not
120
+ redirect another package's imports. Original Click is only a development and
121
+ comparison dependency.
122
+
123
+ A third-party extension that imports Click internally continues to use Click.
124
+ Its classes and context stack require separate migration. The
125
+ [extension compatibility report](docs/extensions.md) reproduces this boundary
126
+ with locked releases of click-didyoumean, click-plugins and click-repl, including
127
+ their original-Click control runs. Changing an application's import alias does
128
+ not automatically migrate those extensions.
129
+
130
+ ## Compatibility and performance
131
+
132
+ The release gate requires the complete **33,459-case** official test collection,
133
+ including **31,000 stress cases**, with the same test IDs and original platform
134
+ skip/expected-failure conditions. It additionally checks **196 public objects**
135
+ and their members, the 12 upstream typing examples, native property and
136
+ differential tests, and real Bash, Zsh, Fish and PowerShell completion. Results
137
+ are tied to an immutable implementation commit; configured platforms are not
138
+ reported as passing until their jobs succeed. See
139
+ [COMPATIBILITY.md](COMPATIBILITY.md) and the
140
+ [CI runs](https://github.com/LIghtJUNction/zclick/actions/workflows/ci.yml).
141
+
142
+ Rust removes interpreter work from parsing, scheduling, dispatch and text
143
+ formatting. Python object creation and virtual method calls still have a cost.
144
+ The [benchmark report](docs/performance.md) includes construction, repeated
145
+ parser calls, full `Command.main` calls, nested commands, help, wrapping, imports
146
+ and memory measurements. Some workloads are faster and some are slower; the
147
+ report includes both. No universal speedup or zero-allocation claim is made.
148
+
149
+ ## Examples
150
+
151
+ | Example | Behavior |
152
+ | --- | --- |
153
+ | [`hello.py`](examples/hello.py) | Decorators, options, prompting and output |
154
+ | [`pipeline.py`](examples/pipeline.py) | Chained commands, context state and result callbacks |
155
+ | [`workspace.py`](examples/workspace.py) | A custom type, arbitrary-size integers, context resources, environment defaults and completion |
156
+
157
+ ```sh
158
+ python examples/hello.py --count 2 --name Ada
159
+ python examples/pipeline.py --text 'hello world' uppercase replace WORLD Rust
160
+ python examples/workspace.py --prefix demo convert 0x10000000000000000
161
+ ```
162
+
163
+ [Shell completion setup](docs/shell-completion.md) covers the source/complete
164
+ protocols and the scope of actual shell-engine validation.
165
+
166
+ ## Development
167
+
168
+ Use Python 3.10 or newer and the pinned Rust toolchain. Create a virtual
169
+ environment, install Maturin and the test dependencies, then build the extension:
170
+
171
+ ```sh
172
+ python -m venv .venv
173
+ . .venv/bin/activate
174
+ python -m pip install -r requirements-dev.txt
175
+ maturin develop --release --locked
176
+ python -m pytest tests
177
+ python scripts/run_compatibility.py
178
+ ```
179
+
180
+ Use the [development guide](docs/development.md) for complete stress verification,
181
+ cross-platform builds, dependency audits, reproducible benchmarks and version
182
+ bumps. The [release workflow](.github/workflows/release.yml) builds and installs
183
+ the actual wheels before publishing them.
184
+
185
+ ## Architecture
186
+
187
+ Python objects preserve decorators, custom subclasses, callbacks and ordinary
188
+ Python values. The native extension builds a fresh parsing plan for each call.
189
+ The Rust core performs token recognition through zclap, applies Click argument
190
+ consumption rules, schedules parameters and formats text. Rust also drives
191
+ command groups and parser actions through Python's current methods. The core uses
192
+ `no_std` with `alloc`; its only direct third-party dependency is zclap. The
193
+ extension uses PyO3 and the Rust standard library.
194
+
195
+ The Python interface accepts mutations between invocations. Plans are not cached,
196
+ and user callbacks run without a native lock or borrowed mutable parser state.
197
+ Python integer conversion uses Python integers rather than fixed-width Rust
198
+ integers. Input strings preserve surrogate code points at the binding boundary.
199
+
200
+ `CliRunner` changes interpreter streams, environment variables and sometimes the
201
+ working directory. Use separate processes for concurrent runner tests.
202
+
203
+ The project implementation is MIT licensed. Distribution notices for the
204
+ generated Click API declarations, Rust dependencies and standard library are
205
+ listed in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
206
+
@@ -0,0 +1,145 @@
1
+ # zclick
2
+
3
+ Python command-line interfaces backed by Rust and zclap. Import the public API
4
+ as `import zclick as click`, including the matching `zclick.core`, `zclick.types`,
5
+ `zclick.testing` and `zclick.shell_completion` submodules.
6
+
7
+ The fixed compatibility target is **Click 8.5.1**, source commit
8
+ [`cf19179`](https://github.com/pallets/click/tree/cf19179e8e2fd54c601378cec9e0d21bb12b6fb1).
9
+ The versioned documentation, API inventory and original tests are pinned in
10
+ [`compatibility/target.json`](compatibility/target.json). The implementation uses
11
+ registry **zclap 0.1.4**, **PyO3 0.30.1** and **Rust 1.99.1 / Edition 2024**.
12
+
13
+ **This is a preview release; the complete compatibility target is not yet met.**
14
+ CPython subinterpreters are currently unsupported and are explicitly rejected
15
+ at native module initialization. The locked PyO3 binding has Python object
16
+ caches that are not partitioned by interpreter. See the
17
+ [open compatibility record](compatibility/known-gaps.json). Stable publication
18
+ is blocked while an open compatibility gap remains.
19
+
20
+ [Compatibility evidence](COMPATIBILITY.md) · [Performance measurements](docs/performance.md) ·
21
+ [Architecture](docs/architecture.md) · [Build and release](docs/development.md)
22
+
23
+ ## Installation and a first command
24
+
25
+ After PyPI publication, install the preview with:
26
+
27
+ ```sh
28
+ pip install --pre zclick
29
+ ```
30
+
31
+ Published wheels and source archives are also available through
32
+ [GitHub Releases](https://github.com/LIghtJUNction/zclick/releases). Ordinary
33
+ CPython wheels support Python 3.10 and newer; PyPy and free-threaded CPython
34
+ require their corresponding wheels or an interpreter-specific source build.
35
+ The intended stable installation is `pip install zclick` once the outstanding
36
+ compatibility gate is satisfied.
37
+
38
+ ```python
39
+ import zclick as click
40
+
41
+ @click.command()
42
+ @click.option("--count", default=1, type=int, help="Number of greetings.")
43
+ @click.option("--name", prompt="Your name", help="The person to greet.")
44
+ def hello(count, name):
45
+ for _ in range(count):
46
+ click.echo(f"Hello, {name}!")
47
+
48
+ if __name__ == "__main__":
49
+ hello()
50
+ ```
51
+
52
+ ## Migration
53
+
54
+ Replace `import click` with `import zclick as click`. Replace submodule imports,
55
+ for example `from click.testing import CliRunner`, with
56
+ `from zclick.testing import CliRunner`.
57
+
58
+ The wheel installs the `zclick` namespace. It has **no third-party Python runtime
59
+ requirements**, does not install a top-level `click` package, and does not
60
+ redirect another package's imports. Original Click is only a development and
61
+ comparison dependency.
62
+
63
+ A third-party extension that imports Click internally continues to use Click.
64
+ Its classes and context stack require separate migration. The
65
+ [extension compatibility report](docs/extensions.md) reproduces this boundary
66
+ with locked releases of click-didyoumean, click-plugins and click-repl, including
67
+ their original-Click control runs. Changing an application's import alias does
68
+ not automatically migrate those extensions.
69
+
70
+ ## Compatibility and performance
71
+
72
+ The release gate requires the complete **33,459-case** official test collection,
73
+ including **31,000 stress cases**, with the same test IDs and original platform
74
+ skip/expected-failure conditions. It additionally checks **196 public objects**
75
+ and their members, the 12 upstream typing examples, native property and
76
+ differential tests, and real Bash, Zsh, Fish and PowerShell completion. Results
77
+ are tied to an immutable implementation commit; configured platforms are not
78
+ reported as passing until their jobs succeed. See
79
+ [COMPATIBILITY.md](COMPATIBILITY.md) and the
80
+ [CI runs](https://github.com/LIghtJUNction/zclick/actions/workflows/ci.yml).
81
+
82
+ Rust removes interpreter work from parsing, scheduling, dispatch and text
83
+ formatting. Python object creation and virtual method calls still have a cost.
84
+ The [benchmark report](docs/performance.md) includes construction, repeated
85
+ parser calls, full `Command.main` calls, nested commands, help, wrapping, imports
86
+ and memory measurements. Some workloads are faster and some are slower; the
87
+ report includes both. No universal speedup or zero-allocation claim is made.
88
+
89
+ ## Examples
90
+
91
+ | Example | Behavior |
92
+ | --- | --- |
93
+ | [`hello.py`](examples/hello.py) | Decorators, options, prompting and output |
94
+ | [`pipeline.py`](examples/pipeline.py) | Chained commands, context state and result callbacks |
95
+ | [`workspace.py`](examples/workspace.py) | A custom type, arbitrary-size integers, context resources, environment defaults and completion |
96
+
97
+ ```sh
98
+ python examples/hello.py --count 2 --name Ada
99
+ python examples/pipeline.py --text 'hello world' uppercase replace WORLD Rust
100
+ python examples/workspace.py --prefix demo convert 0x10000000000000000
101
+ ```
102
+
103
+ [Shell completion setup](docs/shell-completion.md) covers the source/complete
104
+ protocols and the scope of actual shell-engine validation.
105
+
106
+ ## Development
107
+
108
+ Use Python 3.10 or newer and the pinned Rust toolchain. Create a virtual
109
+ environment, install Maturin and the test dependencies, then build the extension:
110
+
111
+ ```sh
112
+ python -m venv .venv
113
+ . .venv/bin/activate
114
+ python -m pip install -r requirements-dev.txt
115
+ maturin develop --release --locked
116
+ python -m pytest tests
117
+ python scripts/run_compatibility.py
118
+ ```
119
+
120
+ Use the [development guide](docs/development.md) for complete stress verification,
121
+ cross-platform builds, dependency audits, reproducible benchmarks and version
122
+ bumps. The [release workflow](.github/workflows/release.yml) builds and installs
123
+ the actual wheels before publishing them.
124
+
125
+ ## Architecture
126
+
127
+ Python objects preserve decorators, custom subclasses, callbacks and ordinary
128
+ Python values. The native extension builds a fresh parsing plan for each call.
129
+ The Rust core performs token recognition through zclap, applies Click argument
130
+ consumption rules, schedules parameters and formats text. Rust also drives
131
+ command groups and parser actions through Python's current methods. The core uses
132
+ `no_std` with `alloc`; its only direct third-party dependency is zclap. The
133
+ extension uses PyO3 and the Rust standard library.
134
+
135
+ The Python interface accepts mutations between invocations. Plans are not cached,
136
+ and user callbacks run without a native lock or borrowed mutable parser state.
137
+ Python integer conversion uses Python integers rather than fixed-width Rust
138
+ integers. Input strings preserve surrogate code points at the binding boundary.
139
+
140
+ `CliRunner` changes interpreter streams, environment variables and sometimes the
141
+ working directory. Use separate processes for concurrent runner tests.
142
+
143
+ The project implementation is MIT licensed. Distribution notices for the
144
+ generated Click API declarations, Rust dependencies and standard library are
145
+ listed in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
@@ -0,0 +1,69 @@
1
+ # Third-party licenses and notices
2
+
3
+ zclick's own implementation is licensed under the MIT license in [LICENSE](LICENSE).
4
+ The native extension is built from Rust crates whose unmodified license and
5
+ copyright notices are included below. Both alternatives of dual-license notices
6
+ are retained. SPDX expressions, exact registry versions, archive checksums, and
7
+ copied-file checksums are recorded in [licenses/manifest.json](licenses/manifest.json).
8
+
9
+ ## Locked Rust crates
10
+
11
+ This inventory covers every registry crate resolved by `cargo metadata --locked`,
12
+ including host build dependencies and procedural macros. Inclusion of a notice
13
+ does not imply that every listed crate contributes executable code to every wheel.
14
+ The semantic core directly depends on zclap; the Python binding depends on PyO3.
15
+ These native/build dependencies are distinct from Python installation dependencies.
16
+
17
+ | Package | Upstream SPDX expression | Unmodified notices |
18
+ | --- | --- | --- |
19
+ | [heck 0.5.0](https://crates.io/crates/heck/0.5.0) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/heck-0.5.0/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/heck-0.5.0/LICENSE-MIT) |
20
+ | [libc 0.2.191](https://crates.io/crates/libc/0.2.191) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/libc-0.2.191/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/libc-0.2.191/LICENSE-MIT) |
21
+ | [once_cell 1.21.4](https://crates.io/crates/once_cell/1.21.4) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/once_cell-1.21.4/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/once_cell-1.21.4/LICENSE-MIT) |
22
+ | [portable-atomic 1.15.0](https://crates.io/crates/portable-atomic/1.15.0) | `Apache-2.0 OR MIT` | [LICENSE-APACHE](licenses/rust/portable-atomic-1.15.0/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/portable-atomic-1.15.0/LICENSE-MIT) |
23
+ | [proc-macro2 1.0.107](https://crates.io/crates/proc-macro2/1.0.107) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/proc-macro2-1.0.107/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/proc-macro2-1.0.107/LICENSE-MIT) |
24
+ | [pyo3 0.30.1](https://crates.io/crates/pyo3/0.30.1) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/pyo3-0.30.1/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/pyo3-0.30.1/LICENSE-MIT), [LICENSE-APACHE](licenses/rust/pyo3-0.30.1/pyo3-runtime/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/pyo3-0.30.1/pyo3-runtime/LICENSE-MIT) |
25
+ | [pyo3-build-config 0.30.1](https://crates.io/crates/pyo3-build-config/0.30.1) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/pyo3-build-config-0.30.1/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/pyo3-build-config-0.30.1/LICENSE-MIT) |
26
+ | [pyo3-ffi 0.30.1](https://crates.io/crates/pyo3-ffi/0.30.1) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/pyo3-ffi-0.30.1/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/pyo3-ffi-0.30.1/LICENSE-MIT) |
27
+ | [pyo3-macros 0.30.1](https://crates.io/crates/pyo3-macros/0.30.1) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/pyo3-macros-0.30.1/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/pyo3-macros-0.30.1/LICENSE-MIT) |
28
+ | [pyo3-macros-backend 0.30.1](https://crates.io/crates/pyo3-macros-backend/0.30.1) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/pyo3-macros-backend-0.30.1/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/pyo3-macros-backend-0.30.1/LICENSE-MIT) |
29
+ | [quote 1.0.47](https://crates.io/crates/quote/1.0.47) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/quote-1.0.47/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/quote-1.0.47/LICENSE-MIT) |
30
+ | [syn 3.0.10](https://crates.io/crates/syn/3.0.10) | `MIT OR Apache-2.0` | [LICENSE-APACHE](licenses/rust/syn-3.0.10/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/syn-3.0.10/LICENSE-MIT) |
31
+ | [target-lexicon 0.13.5](https://crates.io/crates/target-lexicon/0.13.5) | `Apache-2.0 WITH LLVM-exception` | [LICENSE](licenses/rust/target-lexicon-0.13.5/LICENSE) |
32
+ | [unicode-ident 1.0.27](https://crates.io/crates/unicode-ident/1.0.27) | `(MIT OR Apache-2.0) AND Unicode-3.0` | [LICENSE-APACHE](licenses/rust/unicode-ident-1.0.27/LICENSE-APACHE), [LICENSE-MIT](licenses/rust/unicode-ident-1.0.27/LICENSE-MIT), [LICENSE-UNICODE](licenses/rust/unicode-ident-1.0.27/LICENSE-UNICODE) |
33
+ | [zclap 0.1.4](https://crates.io/crates/zclap/0.1.4) | `MIT` | [LICENSE](licenses/rust/zclap-0.1.4/LICENSE) |
34
+
35
+ ## Rust standard library 1.99.1
36
+
37
+ Native wheels can contain statically linked parts of Rust's standard library.
38
+ The pinned compiler is built from commit `58cf8f9c35b355199727627d07ae34a4e2846d67`.
39
+ The complete [standard-library copyright inventory](licenses/rust-standard-library/1.99.1/COPYRIGHT-library.html)
40
+ is retained, including its in-tree and third-party notices. The upstream
41
+ [MIT license](licenses/rust-standard-library/1.99.1/LICENSE-MIT),
42
+ [Apache 2.0 license](licenses/rust-standard-library/1.99.1/LICENSE-APACHE), and
43
+ [copyright overview](licenses/rust-standard-library/1.99.1/COPYRIGHT) are also included.
44
+ The inventory is deliberately broader than one platform's linked symbol set.
45
+
46
+ ## Click interface declarations and comparison material
47
+
48
+ The `.pyi` interface declarations are extracted from the fixed Click 8.5.1 public
49
+ interface. Their source project's BSD-3-Clause notice is distributed at
50
+ [compatibility/CLICK_LICENSE.txt](compatibility/CLICK_LICENSE.txt).
51
+ The Python runtime implementation is independent; original Click is not a runtime
52
+ dependency and is not embedded as a fallback. Vendored comparison source used by
53
+ development tests is excluded from the wheel.
54
+
55
+ ## Python dependency boundary
56
+
57
+ The default distribution declares zero third-party Python runtime dependencies.
58
+ Click, pytest, Hypothesis, Maturin, type-checking tools, and optional extension-test
59
+ packages belong to development environments. Optional test extras remain explicitly
60
+ marked in distribution metadata and are not installed by `pip install zclick`.
61
+
62
+ ## Maintenance and verification
63
+
64
+ Run `python scripts/vendor_licenses.py --check` after fetching the pinned Cargo
65
+ dependencies. To refresh generated notices, run the script without `--check`.
66
+ It uses locked metadata and refuses changes to `Cargo.lock`; it adds no dependency.
67
+ When the Rust toolchain changes, fetch the three indicated upstream license files
68
+ for that release before regeneration. Wheel verification checks that every notice
69
+ recorded in the manifest is present with the same checksum.
@@ -0,0 +1,28 @@
1
+ Copyright 2014 Pallets
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are
5
+ met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ 3. Neither the name of the copyright holder nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,11 @@
1
+ [package]
2
+ name = "zclick-core"
3
+ version.workspace = true
4
+ edition.workspace = true
5
+ rust-version.workspace = true
6
+ license.workspace = true
7
+ repository.workspace = true
8
+ description = "Borrowed Click-compatible argument semantics over zclap"
9
+
10
+ [dependencies]
11
+ zclap = { version = "=0.1.4", default-features = false }
@@ -0,0 +1,12 @@
1
+ //! Click argument semantics and terminal formatting over a zclap recognition kernel.
2
+ //! All input and definition storage belongs to the invocation. No global cache exists.
3
+ #![no_std]
4
+ #![forbid(unsafe_code)]
5
+ extern crate alloc;
6
+ mod parse;
7
+ mod text;
8
+ pub use parse::{
9
+ Normalizer, ParseError, ParseResult, Spec, parse, parse_with_normalizer, processing_order,
10
+ select_parameter_value,
11
+ };
12
+ pub use text::{join_options, strip_ansi, text_width, truncate_visible, wrap_text};