slint-compiler 1.12.1b1__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.
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.4
2
+ Name: slint-compiler
3
+ Version: 1.12.1b1
4
+ Summary: Python wrapper around the Slint compiler for Python
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: cached-path>=1.7.3
8
+
9
+ <!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 -->
10
+
11
+ # Python Slint Compiler
12
+
13
+ This package is a wrapper around [Slint's](https://slint.dev) compiler for Python, to generate a typed `.py` file from a `.slint` file, for use with [Slint for Python](https://pypi.org/project/slint/).
14
+
15
+ When run, the slint compiler binary is downloaded, cached, and run.
16
+
17
+ By default, the Slint compiler matching the version of this package is downloaded. To select a specific version, set the `SLINT_COMPILER_VERSION` environment variable. Set it to `nightly` to select the latest nightly release.
18
+
19
+ ## Example
20
+
21
+ ```bash
22
+ uxv run slint-compiler -f python -o app_window.py app-window.slint
23
+ ```
@@ -0,0 +1,15 @@
1
+ <!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 -->
2
+
3
+ # Python Slint Compiler
4
+
5
+ This package is a wrapper around [Slint's](https://slint.dev) compiler for Python, to generate a typed `.py` file from a `.slint` file, for use with [Slint for Python](https://pypi.org/project/slint/).
6
+
7
+ When run, the slint compiler binary is downloaded, cached, and run.
8
+
9
+ By default, the Slint compiler matching the version of this package is downloaded. To select a specific version, set the `SLINT_COMPILER_VERSION` environment variable. Set it to `nightly` to select the latest nightly release.
10
+
11
+ ## Example
12
+
13
+ ```bash
14
+ uxv run slint-compiler -f python -o app_window.py app-window.slint
15
+ ```
@@ -0,0 +1,13 @@
1
+ # Copyright © SixtyFPS GmbH <info@slint.dev>
2
+ # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
+
4
+ [project]
5
+ name = "slint-compiler"
6
+ version = "1.12.1b1"
7
+ description = "Python wrapper around the Slint compiler for Python"
8
+ readme = "README.md"
9
+ requires-python = ">=3.10"
10
+ dependencies = ["cached-path>=1.7.3"]
11
+
12
+ [project.scripts]
13
+ slint-compiler = "slint_compiler:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,67 @@
1
+ # Copyright © SixtyFPS GmbH <info@slint.dev>
2
+ # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
+
4
+ import cached_path
5
+ import platform
6
+ import sys
7
+ import subprocess
8
+ import re
9
+ import os
10
+ from importlib.metadata import version, PackageNotFoundError
11
+
12
+
13
+ def main():
14
+ try:
15
+ package_version = version("slint-compiler")
16
+ # Strip alpha/beta from for example "1.13.0b1"
17
+ version_regex = re.search("([0-9]*)\\.([0-9]*)\\.([0-9]*).*", package_version)
18
+ assert version_regex is not None
19
+ major = version_regex.group(1)
20
+ minor = version_regex.group(2)
21
+ patch = version_regex.group(3)
22
+ github_release = f"v{major}.{minor}.{patch}"
23
+ except PackageNotFoundError:
24
+ github_release = "nightly"
25
+
26
+ # Permit override by environment variable
27
+ github_release = os.environ.get("SLINT_COMPILER_VERSION") or github_release
28
+
29
+ operating_system = {
30
+ "darwin": "Darwin",
31
+ "linux": "Linux",
32
+ "win32": "Windows",
33
+ "msys": "Windows",
34
+ }[sys.platform]
35
+ arch = {
36
+ "aarch64": "aarch64",
37
+ "amd64": "x86_64",
38
+ "arm64": "aarch64",
39
+ "x86_64": "x86_64",
40
+ }[platform.machine().lower()]
41
+ exe_suffix = ""
42
+
43
+ if operating_system == "Windows":
44
+ arch = {"aarch64": "ARM64", "x86_64": "AMD64"}[arch]
45
+ exe_suffix = ".exe"
46
+ elif operating_system == "Linux":
47
+ pass
48
+ elif operating_system == "Darwin":
49
+ arch = {"aarch64": "arm64", "x86_64": "x86_64"}[arch]
50
+ else:
51
+ raise Exception(f"Unsupported operarating system: {operating_system}")
52
+
53
+ platform_suffix = f"{operating_system}-{arch}"
54
+ prebuilt_archive_filename = f"slint-compiler-{platform_suffix}.tar.gz"
55
+ download_url = f"https://github.com/slint-ui/slint/releases/download/{github_release}/{prebuilt_archive_filename}"
56
+ url_and_path_within_archive = f"{download_url}!slint-compiler{exe_suffix}"
57
+
58
+ local_path = cached_path.cached_path(
59
+ url_and_path_within_archive, extract_archive=True
60
+ )
61
+ args = [local_path]
62
+ args.extend(sys.argv[1:])
63
+ subprocess.run(args)
64
+
65
+
66
+ if __name__ == "__main__":
67
+ main()
@@ -0,0 +1,23 @@
1
+ Metadata-Version: 2.4
2
+ Name: slint-compiler
3
+ Version: 1.12.1b1
4
+ Summary: Python wrapper around the Slint compiler for Python
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: cached-path>=1.7.3
8
+
9
+ <!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 -->
10
+
11
+ # Python Slint Compiler
12
+
13
+ This package is a wrapper around [Slint's](https://slint.dev) compiler for Python, to generate a typed `.py` file from a `.slint` file, for use with [Slint for Python](https://pypi.org/project/slint/).
14
+
15
+ When run, the slint compiler binary is downloaded, cached, and run.
16
+
17
+ By default, the Slint compiler matching the version of this package is downloaded. To select a specific version, set the `SLINT_COMPILER_VERSION` environment variable. Set it to `nightly` to select the latest nightly release.
18
+
19
+ ## Example
20
+
21
+ ```bash
22
+ uxv run slint-compiler -f python -o app_window.py app-window.slint
23
+ ```
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ slint_compiler/__init__.py
4
+ slint_compiler.egg-info/PKG-INFO
5
+ slint_compiler.egg-info/SOURCES.txt
6
+ slint_compiler.egg-info/dependency_links.txt
7
+ slint_compiler.egg-info/entry_points.txt
8
+ slint_compiler.egg-info/requires.txt
9
+ slint_compiler.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ slint-compiler = slint_compiler:main
@@ -0,0 +1 @@
1
+ cached-path>=1.7.3
@@ -0,0 +1 @@
1
+ slint_compiler