jasonisnthappy 0.1.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.
Binary file
@@ -0,0 +1,63 @@
1
+ """
2
+ Loader for jasonisnthappy native library.
3
+ The library should be downloaded during pip install.
4
+ """
5
+
6
+ import os
7
+ import platform
8
+ from pathlib import Path
9
+ from typing import Optional
10
+
11
+ _lib_path: Optional[str] = None
12
+
13
+
14
+ def _get_platform_info():
15
+ """Detect platform and return library information."""
16
+ system = platform.system()
17
+ machine = platform.machine().lower()
18
+
19
+ if system == "Darwin": # macOS
20
+ if machine == "arm64":
21
+ return {"dir": "darwin-arm64", "dest": "libjasonisnthappy.dylib"}
22
+ elif machine in ("x86_64", "amd64"):
23
+ return {"dir": "darwin-amd64", "dest": "libjasonisnthappy.dylib"}
24
+ elif system == "Linux":
25
+ if machine in ("aarch64", "arm64"):
26
+ return {"dir": "linux-arm64", "dest": "libjasonisnthappy.so"}
27
+ elif machine in ("x86_64", "amd64"):
28
+ return {"dir": "linux-amd64", "dest": "libjasonisnthappy.so"}
29
+ elif system == "Windows":
30
+ if machine in ("x86_64", "amd64"):
31
+ return {"dir": "windows-amd64", "dest": "jasonisnthappy.dll"}
32
+
33
+ return None
34
+
35
+
36
+ def get_library_path() -> str:
37
+ """Get the path to the native library. Raises if not found."""
38
+ global _lib_path
39
+
40
+ if _lib_path is not None:
41
+ return _lib_path
42
+
43
+ platform_info = _get_platform_info()
44
+ if platform_info is None:
45
+ raise RuntimeError(
46
+ f"Unsupported platform: {platform.system()}/{platform.machine()}\n"
47
+ f"Supported platforms: macOS (x64, arm64), Linux (x64, arm64), Windows (x64)"
48
+ )
49
+
50
+ # Check in package lib directory
51
+ lib_path = Path(__file__).parent / "lib" / platform_info["dir"] / platform_info["dest"]
52
+
53
+ if not lib_path.exists():
54
+ raise RuntimeError(
55
+ f"Native library not found at {lib_path}\n\n"
56
+ f"The library should have been downloaded during 'pip install'.\n"
57
+ f"Try reinstalling: pip uninstall jasonisnthappy && pip install jasonisnthappy\n\n"
58
+ f"Or manually download from:\n"
59
+ f"https://github.com/sohzm/jasonisnthappy/releases/latest"
60
+ )
61
+
62
+ _lib_path = str(lib_path)
63
+ return _lib_path
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.1
2
+ Name: jasonisnthappy
3
+ Version: 0.1.0
4
+ Summary: UNKNOWN
5
+ Home-page: UNKNOWN
6
+ License: UNKNOWN
7
+ Platform: UNKNOWN
8
+
9
+ UNKNOWN
10
+
@@ -0,0 +1,8 @@
1
+ jasonisnthappy/__init__.py,sha256=EZqHrQ2NK5tb1mIAeCk8QSmFCYxLurQQU-I9uHPK_vQ,266
2
+ jasonisnthappy/database.py,sha256=g_aoa210ce6jaNb-FsXaARd5E0Fz4gCn6Yo6Vbe3EIE,65620
3
+ jasonisnthappy/jasonisnthappy.dll,sha256=cU4F22E9qgb1g1ot4gGl8KsnLK3jkR14v4OBcWde5QY,907264
4
+ jasonisnthappy/loader.py,sha256=SghCXKU9iuez9gwXl831sn0wFU1LfmLbKlIinLmm-Q0,2128
5
+ jasonisnthappy-0.1.0.dist-info/METADATA,sha256=QpFqyNZN6Sn0hyHdsj099OwQIxKld0b9ntYA9QhFmUo,139
6
+ jasonisnthappy-0.1.0.dist-info/WHEEL,sha256=WoE84lFhzpl5kFoOWeOKUr67l1o9c9Tie8ccxFQmzBU,98
7
+ jasonisnthappy-0.1.0.dist-info/top_level.txt,sha256=qcswwJiUzQCM8BF6LjZw2z11PeOYPEBq0JaZcYBbaWU,15
8
+ jasonisnthappy-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.37.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-win_amd64
5
+
@@ -0,0 +1 @@
1
+ jasonisnthappy