minizign 0.0.1__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 (32) hide show
  1. minizign-0.0.1/LICENSE +22 -0
  2. minizign-0.0.1/PKG-INFO +179 -0
  3. minizign-0.0.1/build.zig +152 -0
  4. minizign-0.0.1/build.zig.zon +23 -0
  5. minizign-0.0.1/pkg-info.zon +15 -0
  6. minizign-0.0.1/setup.py +69 -0
  7. minizign-0.0.1/setup.zig.json +1 -0
  8. minizign-0.0.1/src/minizign.pyi +158 -0
  9. minizign-0.0.1/src/minizign_py.zig +1873 -0
  10. minizign-0.0.1/zig-pkg/minizign/LICENSE +18 -0
  11. minizign-0.0.1/zig-pkg/minizign/README.md +125 -0
  12. minizign-0.0.1/zig-pkg/minizign/build.zig +124 -0
  13. minizign-0.0.1/zig-pkg/minizign/build.zig.zon +20 -0
  14. minizign-0.0.1/zig-pkg/minizign/src/lib.zig +624 -0
  15. minizign-0.0.1/zig-pkg/minizign/src/main.zig +632 -0
  16. minizign-0.0.1/zig-pkg/minizign/src/wasm.zig +408 -0
  17. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/LICENSE +21 -0
  18. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/README.md +121 -0
  19. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/build.zig +202 -0
  20. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/build.zig.zon +14 -0
  21. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/pkg-info.zon +11 -0
  22. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/CPython.zig +128 -0
  23. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/Compression.zig +33 -0
  24. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/LowerDashString.zig +20 -0
  25. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/SDistStep.zig +144 -0
  26. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/VenvInstallTest.zig +138 -0
  27. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/extract_link_info.py +76 -0
  28. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/pkg_info.zig +32 -0
  29. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/python-translatec.h +6 -0
  30. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/python.zig +435 -0
  31. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/python_allocator.zig +201 -0
  32. minizign-0.0.1/zig-pkg/zig_python_sdist-0.0.4/src/build/setup_json.zig +28 -0
minizign-0.0.1/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tobias Simetsreiter
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.
22
+
@@ -0,0 +1,179 @@
1
+ Metadata-Version: 2.4
2
+ Name: minizign
3
+ Version: 0.0.1
4
+ Summary: a native cpython extension for minisign using zig
5
+ Author-email: Tobias Simetsreiter <dasimmet@gmail.com>
6
+ Maintainer-email: Tobias Simetsreiter <dasimmet@gmail.com>
7
+ License-Expression: MIT
8
+ Keywords: zig,ziglang,cpython,native,sdist,minisign,minisign-zig
9
+ Requires-Python: >=3.9
10
+ Project-URL: Homepage, https://codeberg.org/dasimmet/minizign
11
+ Project-URL: Issues, https://codeberg.org/dasimmet/minizign/issues
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Zig
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Description-Content-Type: text/markdown
18
+
19
+ # minizign
20
+
21
+ Fast, lightweight Python bindings for the Zig [minisign](https://jedisct1.github.io/minisign/) implementation.
22
+
23
+ `minizign` provides high-performance cryptographic signing and verification using Ed25519 and Blake2b-512 with full Minisign format compatibility.
24
+
25
+ ---
26
+
27
+ ## Features
28
+
29
+ - **Standard Minisign Compatibility**: Interoperable with official `minisign` files, keys, and signatures.
30
+ - **Multiple Input Types**: Sign and verify `str`, `bytes`, `bytearray`, `memoryview`, integer file descriptors (`int`), and file-like objects.
31
+ - **Streaming Hashing**: Fast chunked hashing (Blake2b-512) for large files and file descriptors without loading entire files into memory.
32
+ - **Direct Output Writing**: Write signatures and keys directly to integer file descriptors or file-like streams.
33
+ - **Full Comment Support**: Custom trusted comments and untrusted comments on signatures, public keys, and secret keys.
34
+ - **Type Annotations**: Fully typed with PEP 561 `.pyi` stubs.
35
+
36
+ ---
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install minizign
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Quickstart
47
+
48
+ ### Keypair Generation
49
+
50
+ ```python
51
+ import minizign
52
+
53
+ # Generate a new random secret key
54
+ sk = minizign.SecretKey(untrusted_comment="my secret key")
55
+
56
+ # Derive the corresponding public key
57
+ pk = sk.getPublicKey(untrusted_comment="my public key")
58
+
59
+ # Export keys as Minisign formatted strings
60
+ sk_str = sk.toString()
61
+ pk_str = pk.toString()
62
+
63
+ print("Public Key:")
64
+ print(pk_str)
65
+ ```
66
+
67
+ ### Signing and Verifying Data
68
+
69
+ ```python
70
+ import minizign
71
+
72
+ sk = minizign.SecretKey()
73
+ pk = sk.getPublicKey()
74
+
75
+ # Sign a string or bytes
76
+ message = "Hello, world!"
77
+ sig = sk.sign(
78
+ message,
79
+ trusted_comment="trusted timestamp",
80
+ untrusted_comment="signature from minizign"
81
+ )
82
+
83
+ # Verify with PublicKey or Signature object
84
+ is_valid = pk.verify(message, sig)
85
+ print("Valid:", is_valid) # True
86
+
87
+ # Verify using top-level helper
88
+ print("Valid:", minizign.verify(message, sig, pk)) # True
89
+ ```
90
+
91
+ ### Signing Files and File Descriptors (Streaming)
92
+
93
+ ```python
94
+ import os
95
+ import minizign
96
+
97
+ sk = minizign.SecretKey()
98
+ pk = sk.getPublicKey()
99
+
100
+ # Sign a file stream directly
101
+ with open("large_dataset.tar.gz", "rb") as f:
102
+ sig = sk.sign(f, trusted_comment="release archive")
103
+
104
+ # Verify with file object
105
+ with open("large_dataset.tar.gz", "rb") as f:
106
+ assert pk.verify(f, sig)
107
+
108
+ # Sign using an OS file descriptor and write signature directly to another fd
109
+ fd_in = os.open("document.pdf", os.O_RDONLY)
110
+ fd_out = os.open("document.pdf.minisig", os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
111
+
112
+ sig = sk.sign(fd_in, out=fd_out, trusted_comment="approved")
113
+
114
+ os.close(fd_in)
115
+ os.close(fd_out)
116
+ ```
117
+
118
+ ### Loading Keys and Signatures
119
+
120
+ ```python
121
+ import minizign
122
+
123
+ # Load from serialized strings
124
+ pk = minizign.PublicKey("untrusted comment: minisign public key\nRWR...\n")
125
+ sig = minizign.Signature("untrusted comment: ...\n...\ntrusted comment: ...\n...\n")
126
+
127
+ # Load from file or file descriptor
128
+ with open("minisign.pub", "r") as f:
129
+ pk_from_file = minizign.PublicKey(f)
130
+
131
+ # Inspect properties
132
+ print(sig.trusted_comment)
133
+ print(sig.untrusted_comment)
134
+ print(sig.signature) # 64 bytes
135
+ print(sig.global_signature) # 64 bytes
136
+ print(sig.key_id) # 8 bytes
137
+ ```
138
+
139
+ ---
140
+
141
+ ## API Reference
142
+
143
+ ### Module Functions
144
+
145
+ - **`minizign.sign(secret_key, message, trusted_comment=None, untrusted_comment=None, out=None, timestamp=None) -> Signature`**
146
+ Sign a message with a `SecretKey`. Output can optionally be written to a file descriptor or file object. A custom `timestamp` (`int`, `float`, or `str`) can be supplied.
147
+
148
+ - **`minizign.verify(message, signature, public_key) -> bool`**
149
+ Verify a signature against a message and a `PublicKey`.
150
+
151
+ ### `SecretKey`
152
+ - **`SecretKey(str=None, *, untrusted_comment=None, comment=None)`**: Generate a new random key or load from input (`str`, `bytes`, `int` fd, or file object).
153
+ - **`sk.getPublicKey(untrusted_comment=None, *, comment=None) -> PublicKey`**: Extract the corresponding public key.
154
+ - **`sk.sign(message, trusted_comment=None, untrusted_comment=None, out=None, timestamp=None) -> Signature`**: Sign `message` (`str`, `bytes`, `bytearray`, `memoryview`, `int` fd, or file).
155
+ - **`sk.signBytes(data, ...)`** / **`sk.signString(message, ...)`**: Aliases for `sign`.
156
+ - **`sk.toString(out=None, *, untrusted_comment=None, comment=None) -> Optional[str]`**: Format as serialized Minisign secret key string or write to `out`.
157
+ - **`sk.write(out, *, untrusted_comment=None, comment=None) -> None`**: Write secret key to an output destination.
158
+ - **Properties**: `untrusted_comment`, `comment`, `key_id`, `secret_key`.
159
+
160
+ ### `PublicKey`
161
+ - **`PublicKey(str=None, *, untrusted_comment=None, comment=None)`**: Load a public key from string, bytes, file descriptor, or file.
162
+ - **`pk.verify(message, signature) -> bool`**: Verify a signature against a message (`str`, `bytes`, `bytearray`, `memoryview`, `int` fd, or file).
163
+ - **`pk.verifyString(message, signature) -> bool`**: Alias for `verify`.
164
+ - **`pk.toString(out=None, *, untrusted_comment=None, comment=None) -> Optional[str]`**: Format as Minisign public key string or write to `out`.
165
+ - **`pk.write(out, *, untrusted_comment=None, comment=None) -> None`**: Write public key to an output destination.
166
+ - **Properties**: `untrusted_comment`, `comment`, `key_id`, `key`, `public_key`.
167
+
168
+ ### `Signature`
169
+ - **`Signature(str=None, *, untrusted_comment=None, comment=None)`**: Parse a signature from string, bytes, file descriptor, or file.
170
+ - **`sig.verify(message, public_key) -> bool`**: Verify this signature against a message and public key.
171
+ - **`sig.toString(out=None) -> Optional[str]`**: Format as Minisign signature string or write to `out`.
172
+ - **`sig.write(out) -> None`**: Write signature to an output destination.
173
+ - **Properties**: `trusted_comment`, `untrusted_comment`, `comment`, `signature`, `global_signature`, `key_id`.
174
+
175
+ ---
176
+
177
+ ## License
178
+
179
+ MIT / Apache-2.0
@@ -0,0 +1,152 @@
1
+ const std = @import("std");
2
+ const Build = std.Build;
3
+ const zig_python_sdist = @import("zig_python_sdist");
4
+ const zon = @import("build.zig.zon");
5
+
6
+ pub fn build(b: *Build) void {
7
+ const target = b.standardTargetOptions(.{});
8
+ const optimize = b.standardOptimizeOption(.{});
9
+ const minizign = b.dependency("minizign", .{
10
+ .@"no-cli" = true,
11
+ .target = target,
12
+ .optimize = optimize,
13
+ });
14
+
15
+ // this target and section of our build is used at pip install time
16
+ const ext_install_step = b.step("bdist-wheel", "build python extension module");
17
+
18
+ // TODO: generate the .pyi after wheel build with:
19
+ // stubgen -p minizign -o .
20
+ ext_install_step.dependOn(
21
+ &b.addInstallFile(b.path("src/minizign.pyi"), "lib/minizign.pyi").step,
22
+ );
23
+ // this generates a python sdist archive
24
+ const sdist = zig_python_sdist.createSdistStep(b, .{
25
+ .name = "minizign",
26
+ .version = zon.version,
27
+ .description = b.path("README.md"),
28
+ .build = .{
29
+ .args = &.{
30
+ ext_install_step.name,
31
+ b.fmt("-Doptimize={s}", .{@tagName(optimize)}),
32
+ "--fork=zig-pkg/minizign",
33
+ "--verbose",
34
+ },
35
+ },
36
+ .extra_pkg_info = @import("pkg-info.zon"),
37
+ .files = &.{
38
+ .{ .src = b.path("pkg-info.zon"), .dest = "pkg-info.zon" },
39
+ .{ .src = b.path("build.zig.zon"), .dest = "build.zig.zon" },
40
+ .{ .src = b.path("build.zig"), .dest = "build.zig" },
41
+ .{ .src = b.path("src/minizign_py.zig"), .dest = "src/minizign_py.zig" },
42
+ .{ .src = b.path("src/minizign.pyi"), .dest = "src/minizign.pyi" },
43
+ .{ .src = b.path("LICENSE"), .dest = "LICENSE" },
44
+ },
45
+ .directories = &.{
46
+ .{ .src = minizign.path(""), .dest = "zig-pkg/minizign" },
47
+ .{ .src = minizign.path("src"), .dest = "zig-pkg/minizign/src" },
48
+ },
49
+ .compression = .best,
50
+ });
51
+
52
+ const sdistfile = b.addInstallFileWithDir(
53
+ sdist.getEmittedArchive(),
54
+ .{ .custom = "src" },
55
+ sdist.basename,
56
+ );
57
+ b.getInstallStep().dependOn(&sdistfile.step);
58
+
59
+ // we can use a python virtual environment inside
60
+ // the zig cache to test pip installation
61
+ const test_pip_install = zig_python_sdist.createVenvInstallTest(
62
+ b,
63
+ .{
64
+ .sdist = sdist.getEmittedArchive(),
65
+ .unittest_py = &.{b.path("src/tests.py")},
66
+ .twine_check = true,
67
+ .no_clean = b.option(bool, "pip-no-clean", "dont cleanup pip temp dirs") orelse false,
68
+ },
69
+ );
70
+ b.step("test-pip-install", "test building and installing the source distributuin, then run tests").dependOn(test_pip_install.step);
71
+
72
+ const cpython = zig_python_sdist.createCPythonModule(b, .{
73
+ .target = target,
74
+ .version = zon.version,
75
+ .optimize = .Debug,
76
+ .macros = &.{
77
+ .{ "Py_LIMITED_API", "0x03090000" }, // use the limited api from 3.9.0
78
+ },
79
+ });
80
+ const lib = b.addLibrary(.{
81
+ .name = "minizign",
82
+ .root_module = b.addModule(@tagName(zon.name), .{
83
+ .root_source_file = b.path("src/minizign_py.zig"),
84
+ .target = target,
85
+ .optimize = optimize,
86
+ .imports = &.{
87
+ .{ .name = "cpython", .module = cpython },
88
+ .{
89
+ .name = "minizign",
90
+ .module = minizign.module("minizign"),
91
+ },
92
+ },
93
+ }),
94
+ .linkage = .dynamic,
95
+ });
96
+ const ext_path = zig_python_sdist.CPython.renameExtLib(b, lib);
97
+ const ext_install = zig_python_sdist.installExtLib(b, lib);
98
+ ext_install_step.dependOn(&ext_install.step);
99
+
100
+ {
101
+ const ext_tests = ext_path.wf.addCopyFile(b.path("src/tests.py"), "tests.py");
102
+ const test_run = Build.Step.Run.create(b, "unittest");
103
+ test_run.setCwd(ext_path.wf.getDirectory());
104
+ test_run.setEnvironmentVariable("PYTHONPATH", ".");
105
+ test_run.addFileArg(zig_python_sdist.CPython.find(b));
106
+ if (b.option(bool, "tracetest", "run unittest with tracing") orelse false) {
107
+ test_run.addArgs(&.{ "-m", "trace", "--trace" });
108
+ } else {
109
+ test_run.addArgs(&.{ "-m", "unittest" });
110
+ }
111
+ test_run.addDirectoryArg(ext_tests);
112
+ b.step("test-bdist", "run unittests against the extension").dependOn(&test_run.step);
113
+ }
114
+
115
+ const usf = b.addUpdateSourceFiles();
116
+ b.step("update-src", "updates the pyi file. needs 'mypy' installed").dependOn(&usf.step);
117
+
118
+ {
119
+ const stubgen_run = Build.Step.Run.create(b, "stubgen");
120
+ stubgen_run.setCwd(ext_path.wf.getDirectory());
121
+ stubgen_run.addArgs(&.{
122
+ "stubgen",
123
+ "-m",
124
+ lib.name,
125
+ "-o",
126
+ });
127
+ const stub_dir = stubgen_run.addOutputDirectoryArg("stubgen");
128
+ stubgen_run.addArg("--search-path");
129
+ stubgen_run.addDirectoryArg(ext_path.wf.getDirectory());
130
+ usf.addCopyFileToSource(
131
+ stub_dir.path(b, b.fmt("{s}.pyi", .{lib.name})),
132
+ b.fmt("src/{s}.pyi", .{lib.name}),
133
+ );
134
+ }
135
+
136
+ const opt_check_fmt = b.option(bool, "check-fmt", "Check formatting without modifying files") orelse false;
137
+ const opt_fmt_check = b.option(bool, "fmt-check", "Check formatting without modifying files") orelse false;
138
+ const check_fmt = opt_check_fmt or opt_fmt_check;
139
+ const fmt_step = b.step("fmt", "Run zig fmt");
140
+ const fmt = b.addFmt(.{
141
+ .paths = &.{
142
+ "src",
143
+ "build.zig",
144
+ "build.zig.zon",
145
+ },
146
+ .check = check_fmt,
147
+ });
148
+ fmt_step.dependOn(&fmt.step);
149
+ if (check_fmt) {
150
+ b.getInstallStep().dependOn(&fmt.step);
151
+ }
152
+ }
@@ -0,0 +1,23 @@
1
+ .{
2
+ .name = .minizign_py,
3
+ .version = "0.0.1",
4
+ .minimum_zig_version = "0.16.0",
5
+ .dependencies = .{
6
+ .minizign = .{
7
+ .url = "git+https://github.com/dasimmet/zig-minisign.git?ref=make-clap-optional#6afbab9dbe666f0dcd2f281d48fcea69a976e99d",
8
+ .hash = "minizign-0.1.13-gg18cU8iAQArW3UTkAHQh8nF0LlW5FawU3qTQ7Nxc2N6",
9
+ },
10
+ .zig_python_sdist = .{
11
+ .url = "git+https://codeberg.org/dasimmet/zig-python-sdist.git#40512e233eeb00482e58c2bae1a1c902e2a20c2d",
12
+ .hash = "zig_python_sdist-0.0.4-wjgdOvsbAQDeIlnTARjUVNTPzEUetowFy5W_Vue33_6r",
13
+ },
14
+ },
15
+ .paths = .{
16
+ "build.zig",
17
+ "build.zig.zon",
18
+ "README.md",
19
+ "pkg-info.zon",
20
+ "src",
21
+ },
22
+ .fingerprint = 0x703e87b667b760da,
23
+ }
@@ -0,0 +1,15 @@
1
+ .{
2
+ .{ .key = "Summary", .value = "a native cpython extension for minisign using zig" },
3
+ .{ .key = "Author-email", .value = "Tobias Simetsreiter <dasimmet@gmail.com>" },
4
+ .{ .key = "Maintainer-email", .value = "Tobias Simetsreiter <dasimmet@gmail.com>" },
5
+ .{ .key = "License-Expression", .value = "MIT" },
6
+ .{ .key = "Keywords", .value = "zig,ziglang,cpython,native,sdist,minisign,minisign-zig" },
7
+ .{ .key = "Requires-Python", .value = ">=3.9" },
8
+ .{ .key = "Project-URL", .value = "Homepage, https://codeberg.org/dasimmet/minizign" },
9
+ .{ .key = "Project-URL", .value = "Issues, https://codeberg.org/dasimmet/minizign/issues" },
10
+ .{ .key = "Classifier", .value = "Development Status :: 4 - Beta" },
11
+ .{ .key = "Classifier", .value = "Programming Language :: Python :: 3" },
12
+ .{ .key = "Classifier", .value = "Programming Language :: Zig" },
13
+ .{ .key = "Classifier", .value = "Intended Audience :: Developers" },
14
+ .{ .key = "Classifier", .value = "Topic :: Software Development :: Libraries" },
15
+ }
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env python
2
+
3
+ from setuptools import setup
4
+ from setuptools.command.bdist_wheel import bdist_wheel
5
+ import subprocess
6
+ import sys
7
+ import os
8
+ import json
9
+ import glob
10
+ import shutil
11
+
12
+ with open("setup.zig.json") as fd:
13
+ setup_json = json.load(fd)
14
+
15
+
16
+ def mkversion(v, need_release=False):
17
+ '''assembles a dict of semantic version to string'''
18
+ if need_release:
19
+ assert v['pre'] == None, "cannot use version with pre: " + str(v)
20
+ assert v['build'] == None, "cannot use version with build: " + str(v)
21
+ return str(v['major']) + '.' + str(
22
+ v['minor']) + '.' + str(v['patch'])
23
+
24
+
25
+ class ZigBuildWheel(bdist_wheel):
26
+ def run(self, *args, **kwargs):
27
+
28
+ import ziglang
29
+ zig_exe = os.path.join(
30
+ os.path.dirname(ziglang.__file__), "zig")
31
+
32
+ cwd = os.getcwd()
33
+ print("zig build dir:", cwd, file=sys.stderr)
34
+ print("using zig exe:", zig_exe, file=sys.stderr)
35
+
36
+ extra_build_args = setup_json['build']['args']
37
+ build_cmd = [zig_exe, 'build'] + extra_build_args
38
+
39
+ print("zig build:", build_cmd, file=sys.stderr)
40
+ subprocess.check_call(build_cmd)
41
+
42
+ os.makedirs(self.bdist_dir, exist_ok=True)
43
+ copy_pattern = setup_json['build']['copy_pattern']
44
+ for pattern in copy_pattern:
45
+ artifacts = glob.glob(pattern)
46
+ if len(artifacts) == 0:
47
+ raise Exception(
48
+ 'no zig artifacts found in {}/{}'.format(cwd, pattern))
49
+
50
+ for it in artifacts:
51
+ shutil.copyfile(it, os.path.join(
52
+ self.bdist_dir, os.path.basename(it)))
53
+
54
+ return super().run(*args, **kwargs)
55
+
56
+
57
+ setup(
58
+ name=setup_json['name'],
59
+ version=mkversion(setup_json['version']),
60
+ cmdclass={'bdist_wheel': ZigBuildWheel},
61
+ install_requires=setup_json['install_requires'],
62
+ entry_points=setup_json['entry_points'],
63
+ packages=setup_json['build']['packages'],
64
+ setup_requires=[
65
+ "setuptools",
66
+ "wheel",
67
+ "ziglang==" + mkversion(setup_json['zig_version'], need_release=True),
68
+ ] + setup_json['build']['requires'],
69
+ )
@@ -0,0 +1 @@
1
+ {"name":"minizign","version":{"major":0,"minor":0,"patch":1,"pre":null,"build":null},"zig_version":{"major":0,"minor":16,"patch":0,"pre":null,"build":null},"build":{"args":["--fork=zig-pkg/zig_python_sdist-0.0.4","bdist-wheel","-Doptimize=ReleaseSmall","--fork=zig-pkg/minizign","--verbose"],"requires":[],"packages":[],"copy_pattern":["zig-out/lib/*"]},"install_requires":[],"entry_points":{"console_scripts":[],"gui_scripts":[]}}
@@ -0,0 +1,158 @@
1
+ from typing import Union, Optional, Any, BinaryIO, TextIO
2
+
3
+ __version__: dict
4
+ __version_str__: str
5
+ __zig_builtin__: dict
6
+
7
+ MessageInput = Union[str, bytes, bytearray, memoryview, int, BinaryIO, TextIO]
8
+ OutputDestination = Union[int, BinaryIO, TextIO]
9
+ SignatureInput = Union['Signature', str, bytes, bytearray, memoryview, int, BinaryIO, TextIO]
10
+ PublicKeyInput = Union['PublicKey', str, bytes, bytearray, memoryview, int, BinaryIO, TextIO]
11
+ SecretKeyInput = Union['SecretKey', str, bytes, bytearray, memoryview, int, BinaryIO, TextIO]
12
+
13
+ def sign(
14
+ secret_key: 'SecretKey',
15
+ message: MessageInput,
16
+ trusted_comment: Optional[Union[str, bytes]] = None,
17
+ untrusted_comment: Optional[Union[str, bytes]] = None,
18
+ out: Optional[OutputDestination] = None,
19
+ timestamp: Optional[Union[int, float, str, bytes]] = None,
20
+ ) -> 'Signature': ...
21
+
22
+ def verify(
23
+ message: MessageInput,
24
+ signature: SignatureInput,
25
+ public_key: PublicKeyInput,
26
+ ) -> bool: ...
27
+
28
+ class Signature:
29
+ trusted_comment: str
30
+ untrusted_comment: str
31
+ comment: str
32
+ signature: bytes
33
+ global_signature: bytes
34
+ key_id: bytes
35
+
36
+ def __init__(
37
+ self,
38
+ str: Optional[Union[str, bytes, int, BinaryIO, TextIO]] = None,
39
+ *,
40
+ untrusted_comment: Optional[Union[str, bytes]] = None,
41
+ comment: Optional[Union[str, bytes]] = None,
42
+ ) -> None: ...
43
+
44
+ def toString(self, out: Optional[OutputDestination] = None) -> Optional[str]: ...
45
+ def write(self, out: OutputDestination) -> None: ...
46
+ def verify(
47
+ self,
48
+ message: MessageInput,
49
+ public_key: PublicKeyInput,
50
+ ) -> bool: ...
51
+
52
+ @classmethod
53
+ def __class_getitem__(cls, item: Any) -> Any: ...
54
+
55
+ class PublicKey:
56
+ untrusted_comment: str
57
+ comment: str
58
+ key_id: bytes
59
+ key: bytes
60
+ public_key: bytes
61
+
62
+ def __init__(
63
+ self,
64
+ str: Optional[Union[str, bytes, int, BinaryIO, TextIO]] = None,
65
+ *,
66
+ untrusted_comment: Optional[Union[str, bytes]] = None,
67
+ comment: Optional[Union[str, bytes]] = None,
68
+ ) -> None: ...
69
+
70
+ def toString(
71
+ self,
72
+ out: Optional[OutputDestination] = None,
73
+ *,
74
+ untrusted_comment: Optional[Union[str, bytes]] = None,
75
+ comment: Optional[Union[str, bytes]] = None,
76
+ ) -> Optional[str]: ...
77
+ def write(
78
+ self,
79
+ out: OutputDestination,
80
+ *,
81
+ untrusted_comment: Optional[Union[str, bytes]] = None,
82
+ comment: Optional[Union[str, bytes]] = None,
83
+ ) -> None: ...
84
+ def verify(
85
+ self,
86
+ message: MessageInput,
87
+ signature: SignatureInput,
88
+ ) -> bool: ...
89
+ def verifyString(
90
+ self,
91
+ message: MessageInput,
92
+ signature: SignatureInput,
93
+ ) -> bool: ...
94
+
95
+ @classmethod
96
+ def __class_getitem__(cls, item: Any) -> Any: ...
97
+
98
+ class SecretKey:
99
+ untrusted_comment: str
100
+ comment: str
101
+ key_id: bytes
102
+ secret_key: bytes
103
+
104
+ def __init__(
105
+ self,
106
+ str: Optional[Union[str, bytes, int, BinaryIO, TextIO]] = None,
107
+ *,
108
+ untrusted_comment: Optional[Union[str, bytes]] = None,
109
+ comment: Optional[Union[str, bytes]] = None,
110
+ ) -> None: ...
111
+
112
+ def getPublicKey(
113
+ self,
114
+ untrusted_comment: Optional[Union[str, bytes]] = None,
115
+ *,
116
+ comment: Optional[Union[str, bytes]] = None,
117
+ ) -> PublicKey: ...
118
+ def sign(
119
+ self,
120
+ message: MessageInput,
121
+ trusted_comment: Optional[Union[str, bytes]] = None,
122
+ untrusted_comment: Optional[Union[str, bytes]] = None,
123
+ out: Optional[OutputDestination] = None,
124
+ timestamp: Optional[Union[int, float, str, bytes]] = None,
125
+ ) -> Signature: ...
126
+ def signString(
127
+ self,
128
+ message: MessageInput,
129
+ trusted_comment: Optional[Union[str, bytes]] = None,
130
+ untrusted_comment: Optional[Union[str, bytes]] = None,
131
+ out: Optional[OutputDestination] = None,
132
+ timestamp: Optional[Union[int, float, str, bytes]] = None,
133
+ ) -> Signature: ...
134
+ def signBytes(
135
+ self,
136
+ data: MessageInput,
137
+ trusted_comment: Optional[Union[str, bytes]] = None,
138
+ untrusted_comment: Optional[Union[str, bytes]] = None,
139
+ out: Optional[OutputDestination] = None,
140
+ timestamp: Optional[Union[int, float, str, bytes]] = None,
141
+ ) -> Signature: ...
142
+ def toString(
143
+ self,
144
+ out: Optional[OutputDestination] = None,
145
+ *,
146
+ untrusted_comment: Optional[Union[str, bytes]] = None,
147
+ comment: Optional[Union[str, bytes]] = None,
148
+ ) -> Optional[str]: ...
149
+ def write(
150
+ self,
151
+ out: OutputDestination,
152
+ *,
153
+ untrusted_comment: Optional[Union[str, bytes]] = None,
154
+ comment: Optional[Union[str, bytes]] = None,
155
+ ) -> None: ...
156
+
157
+ @classmethod
158
+ def __class_getitem__(cls, item: Any) -> Any: ...