ahqstore-cli 0.10.2__py3-none-any.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.
.gitignore ADDED
@@ -0,0 +1 @@
1
+ __pycache__
.vscode/settings.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "python-envs.defaultEnvManager": "ms-python.python:system",
3
+ "python-envs.pythonProjects": []
4
+ }
PKG-INFO ADDED
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.4
2
+ Name: ahqstore-cli
3
+ Version: 0.10.2
4
+ Summary: A modern Python wrapper for the ahqstore CLI
5
+ Author-email: AHQ Softwares <ahqsecret@gmail.com>
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python :: 3
9
+ Requires-Python: >=3.8
10
+ Requires-Dist: cffi>=1.17.0
11
+ Requires-Dist: requests>=2.25.1
12
+ Description-Content-Type: text/markdown
13
+
14
+ # AHQ Store CLI
15
+
16
+ Read more about it [here](https://ahqstore.github.io)
17
+
18
+ # Changelog
19
+
20
+ ## 0.6.0 **(m)** 05-Sep-2024 10:37PM IST
21
+
22
+ - Introduced ahqstore-types apps validation
23
+ - Now you can view schemas in [docs.rs](https://docs.rs/ahqstore_cli_rs)
24
+ - Update Dependencies
25
+
26
+ ## 0.5.5 03-Sep-2024 10:20PM IST
27
+
28
+ - update ahqstore-types
29
+
30
+ ## 0.5.4 01-Sep-2024 10:07PM IST
31
+
32
+ - **[CRITICAL]** Fixes invalid config files being generated
33
+
34
+ ## 0.5.1 23-Aug-2024 10:09PM IST
35
+
36
+ - Fix NPM Publish error
37
+
38
+ ## 0.5.0 **(I)** 23-Aug-2024 10:05PM IST
39
+
40
+ - Update to the new resources scheme (ahqstore-types v3.1.0)
41
+ - Update Dependencies
42
+
43
+ ## 0.4.x **(m)**
44
+
45
+ - Update to ahqstore-types 2.3.0
46
+
47
+ **NOTE:**
48
+
49
+ - **I** Internal Breaking Changes
50
+ - **m** Minor Breaking / Minor Addition Changes
51
+ - **B** Breaking Changes
52
+ - **P** Patch Changes
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.4
2
+ Name: ahqstore-cli
3
+ Version: 0.10.2
4
+ Summary: A modern Python wrapper for the ahqstore CLI
5
+ Author-email: AHQ Softwares <ahqsecret@gmail.com>
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python :: 3
9
+ Requires-Python: >=3.8
10
+ Requires-Dist: cffi>=1.17.0
11
+ Requires-Dist: requests>=2.25.1
12
+ Description-Content-Type: text/markdown
13
+
14
+ # AHQ Store CLI
15
+
16
+ Read more about it [here](https://ahqstore.github.io)
17
+
18
+ # Changelog
19
+
20
+ ## 0.6.0 **(m)** 05-Sep-2024 10:37PM IST
21
+
22
+ - Introduced ahqstore-types apps validation
23
+ - Now you can view schemas in [docs.rs](https://docs.rs/ahqstore_cli_rs)
24
+ - Update Dependencies
25
+
26
+ ## 0.5.5 03-Sep-2024 10:20PM IST
27
+
28
+ - update ahqstore-types
29
+
30
+ ## 0.5.4 01-Sep-2024 10:07PM IST
31
+
32
+ - **[CRITICAL]** Fixes invalid config files being generated
33
+
34
+ ## 0.5.1 23-Aug-2024 10:09PM IST
35
+
36
+ - Fix NPM Publish error
37
+
38
+ ## 0.5.0 **(I)** 23-Aug-2024 10:05PM IST
39
+
40
+ - Update to the new resources scheme (ahqstore-types v3.1.0)
41
+ - Update Dependencies
42
+
43
+ ## 0.4.x **(m)**
44
+
45
+ - Update to ahqstore-types 2.3.0
46
+
47
+ **NOTE:**
48
+
49
+ - **I** Internal Breaking Changes
50
+ - **m** Minor Breaking / Minor Addition Changes
51
+ - **B** Breaking Changes
52
+ - **P** Patch Changes
@@ -0,0 +1,10 @@
1
+ ./.gitignore,sha256=DNBkdlt0Cp15HxUmbuVdZEtLDPQClHVMIdWQHtnHgcM,11
2
+ ./PKG-INFO,sha256=QW4gOlL42bwCgLR8IZLdMYE7GAkp_nXTdJOJNIIv5hg,1229
3
+ ./cli.py,sha256=yik2vnIccc3K1JXadjQhpEO4u-ZZDHKVwP6YvqjDCow,2539
4
+ ./pyproject.toml,sha256=_8T-pSaBs3t8fgAUPpcT0k26Dr8K0X0wcbSg4AkrSxs,647
5
+ ./setup.py,sha256=8bMFSFEirC83P2E5gqWscOv456HhYeZRC2ocGtZLFEo,37
6
+ ./.vscode/settings.json,sha256=Nsps3MtDH6o4saSxNgu1zaKuPCjSfrE6w4sk8G7Txrg,101
7
+ ahqstore_cli-0.10.2.dist-info/METADATA,sha256=QW4gOlL42bwCgLR8IZLdMYE7GAkp_nXTdJOJNIIv5hg,1229
8
+ ahqstore_cli-0.10.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ ahqstore_cli-0.10.2.dist-info/entry_points.txt,sha256=2mQ7jRN1am_T50S-EVmZN7-jWDvhvWtJOA2Qx8NWnnc,38
10
+ ahqstore_cli-0.10.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ ahqstore = cli:main
cli.py ADDED
@@ -0,0 +1,124 @@
1
+ from cffi import FFI
2
+ from pathlib import Path
3
+ from requests import get
4
+
5
+ import importlib.metadata
6
+
7
+ import os
8
+ import platform
9
+ import sys
10
+
11
+ ffi = FFI()
12
+
13
+ ffi.cdef("""
14
+ char* get_ver();
15
+ void init_args();
16
+ void add_arg(char*);
17
+ void node_entrypoint(bool);
18
+ """)
19
+
20
+ ver = importlib.metadata.version("ahqstore-cli")
21
+
22
+ def rust_target():
23
+ os = platform.system().lower()
24
+ arch = platform.machine().lower()
25
+
26
+ if os == "windows":
27
+ if arch == "i686":
28
+ return "i686-pc-windows-msvc"
29
+ elif arch in ("x86_64", "amd64"):
30
+ return "x86_64-pc-windows-msvc"
31
+ elif arch == "aarch64":
32
+ return "aarch64-pc-windows-msvc"
33
+ elif os == "darwin":
34
+ if arch in ("x86_64", "amd64"):
35
+ return "x86_64-apple-darwin"
36
+ elif arch == "aarch64":
37
+ return "aarch64-apple-darwin"
38
+ elif os == "linux":
39
+ if arch == "i686":
40
+ return "i686-unknown-linux-gnu"
41
+ elif arch in ("x86_64", "amd64"):
42
+ return "x86_64-unknown-linux-gnu"
43
+ elif arch == "armv7l":
44
+ return "armv7-unknown-linux-gnueabihf"
45
+ elif arch == "aarch64":
46
+ return "aarch64-unknown-linux-gnu"
47
+
48
+ # Error out for unsupported systems
49
+ print(f"Error: Unsupported platform: {os} {arch}")
50
+ sys.exit(1)
51
+
52
+ def get_prefix_suffix():
53
+ os = platform.system().lower()
54
+ prefix = ""
55
+ suffix = ""
56
+
57
+ if os == "windows":
58
+ suffix = ".dll"
59
+ elif os == "darwin":
60
+ prefix = "lib"
61
+ suffix = ".dylib"
62
+ elif os == "linux":
63
+ prefix = "lib"
64
+ suffix = ".so"
65
+ else:
66
+ # Default to a generic UNIX-like system
67
+ prefix = "lib"
68
+ suffix = ".so"
69
+
70
+ return (prefix, suffix)
71
+
72
+ def dlib():
73
+ (prefix, suffix) = get_prefix_suffix()
74
+
75
+ return f"{prefix}ahqstore_cli_rs{suffix}"
76
+
77
+ dylib = Path.home().joinpath("ahqstore-py")
78
+
79
+ if not dylib.exists():
80
+ dylib.mkdir()
81
+
82
+ dylib = dylib.joinpath(dlib())
83
+
84
+ def dwnl():
85
+ (prefix, suffix) = get_prefix_suffix()
86
+
87
+ return f"https://github.com/ahqstore/cli/releases/download/{ver}/{prefix}ahqstore_cli_rs-{rust_target()}{suffix}"
88
+
89
+ def dwn():
90
+ url = dwnl()
91
+
92
+ resp = get(url)
93
+
94
+ resp.raise_for_status()
95
+
96
+ with open(dylib, "wb") as f:
97
+ f.write(resp.content)
98
+
99
+ def main():
100
+ C = None
101
+
102
+ try:
103
+ C = ffi.dlopen(str(dylib))
104
+
105
+ ver_ptr = C.get_ver()
106
+
107
+ version = ffi.string(ver_ptr)
108
+
109
+ if not version == bytes(ver, "utf-8"):
110
+ raise BufferError("This was an error comapring them")
111
+ except:
112
+ dwn()
113
+ C = ffi.dlopen(str(dylib))
114
+
115
+ C.init_args()
116
+
117
+ for item in sys.argv[1:]:
118
+ arg = ffi.new("char[]", bytes(item, "ascii"))
119
+
120
+ C.add_arg(arg)
121
+
122
+ C.node_entrypoint(
123
+ os.environ.get("CI") == "true"
124
+ )
pyproject.toml ADDED
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "ahqstore-cli"
7
+ version = "0.10.2"
8
+ authors = [{ name = "AHQ Softwares", email = "ahqsecret@gmail.com" }]
9
+ description = "A modern Python wrapper for the ahqstore CLI"
10
+ readme = "../README.md"
11
+ requires-python = ">=3.8"
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Operating System :: OS Independent",
16
+ ]
17
+ dependencies = [
18
+ # List your Python dependencies here, e.g.,
19
+ "requests>=2.25.1",
20
+ "cffi>=1.17.0",
21
+ ]
22
+
23
+ [tool.hatch.build.targets.wheel]
24
+ packages = ["."]
25
+
26
+ [project.scripts]
27
+ ahqstore = "cli:main"
setup.py ADDED
@@ -0,0 +1,3 @@
1
+ import setuptools
2
+
3
+ setuptools.setup()