omnisql 0.1.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.
omnisql-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: omnisql
3
+ Version: 0.1.0
4
+ Summary: Blazing-fast, next-generation SQL linter
5
+ Author-email: OmniSQL Contributors <hello@omnisql.dev>
6
+ License: MIT
7
+ Keywords: sql,linter,ast
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.7
12
+ Description-Content-Type: text/markdown
13
+
14
+ # OmniSQL Python Wrapper
15
+
16
+ This is the Python wrapper for OmniSQL, a blazing-fast SQL linter built in Rust.
17
+
18
+ For full documentation, visit the [main repository](https://github.com/Shivam-Jha96/omnisql).
@@ -0,0 +1,5 @@
1
+ # OmniSQL Python Wrapper
2
+
3
+ This is the Python wrapper for OmniSQL, a blazing-fast SQL linter built in Rust.
4
+
5
+ For full documentation, visit the [main repository](https://github.com/Shivam-Jha96/omnisql).
@@ -0,0 +1,27 @@
1
+ import os
2
+ import sys
3
+ import subprocess
4
+ import platform
5
+
6
+ def main():
7
+ plat = platform.system().lower()
8
+ bin_name = "omnisql.exe" if plat == "windows" else "omnisql"
9
+ bin_path = os.path.join(os.path.dirname(__file__), "bin", bin_name)
10
+
11
+ if not os.path.exists(bin_path):
12
+ print(f"OmniSQL binary not found at {bin_path}.")
13
+ print("Please ensure the package was installed correctly.")
14
+ sys.exit(1)
15
+
16
+ args = sys.argv[1:]
17
+
18
+ # Run the binary
19
+ try:
20
+ result = subprocess.run([bin_path] + args)
21
+ sys.exit(result.returncode)
22
+ except Exception as e:
23
+ print(f"Failed to execute OmniSQL: {e}")
24
+ sys.exit(1)
25
+
26
+ if __name__ == "__main__":
27
+ main()
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env python
2
+ print('OmniSQL Mock Binary Execution')
@@ -0,0 +1,75 @@
1
+ import os
2
+ import sys
3
+ import platform
4
+ import stat
5
+ import urllib.request
6
+ import tarfile
7
+ import zipfile
8
+ import shutil
9
+
10
+ VERSION = os.environ.get("OMNISQL_VERSION", "v0.1.0")
11
+ REPO = "Shivam-Jha96/omnisql"
12
+
13
+ def get_platform():
14
+ system = platform.system().lower()
15
+ if system == "windows":
16
+ return "windows"
17
+ elif system == "darwin":
18
+ return "macos"
19
+ elif system == "linux":
20
+ return "linux"
21
+ else:
22
+ raise RuntimeError(f"Unsupported platform: {system}")
23
+
24
+ def get_arch():
25
+ machine = platform.machine().lower()
26
+ if machine in ["x86_64", "amd64"]:
27
+ return "x86_64"
28
+ elif machine in ["arm64", "aarch64"]:
29
+ return "aarch64"
30
+ else:
31
+ raise RuntimeError(f"Unsupported architecture: {machine}")
32
+
33
+ def main():
34
+ plat = get_platform()
35
+ arch = get_arch()
36
+ suffix = "zip" if plat == "windows" else "tar.gz"
37
+ asset_name = f"omnisql-{VERSION}-{arch}-{plat}.{suffix}"
38
+ url = f"https://github.com/{REPO}/releases/download/{VERSION}/{asset_name}"
39
+
40
+ bin_name = "omnisql.exe" if plat == "windows" else "omnisql"
41
+ bin_dir = os.path.join(os.path.dirname(__file__), "bin")
42
+
43
+ if not os.path.exists(bin_dir):
44
+ os.makedirs(bin_dir)
45
+
46
+ bin_path = os.path.join(bin_dir, bin_name)
47
+
48
+ print(f"Downloading OmniSQL for {plat}-{arch} from {url}...")
49
+
50
+ tmp_path = os.path.join(bin_dir, f"temp_archive.{suffix}")
51
+ try:
52
+ req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
53
+ with urllib.request.urlopen(req) as response, open(tmp_path, 'wb') as out_file:
54
+ shutil.copyfileobj(response, out_file)
55
+
56
+ if suffix == "zip":
57
+ with zipfile.ZipFile(tmp_path, 'r') as zip_ref:
58
+ zip_ref.extract(bin_name, path=bin_dir)
59
+ else:
60
+ with tarfile.open(tmp_path, 'r:gz') as tar_ref:
61
+ tar_ref.extract(bin_name, path=bin_dir)
62
+
63
+ os.remove(tmp_path)
64
+
65
+ # Make executable
66
+ os.chmod(bin_path, 0o755)
67
+ print(f"Successfully installed OmniSQL to {bin_path}")
68
+ except Exception as e:
69
+ if os.path.exists(tmp_path):
70
+ os.remove(tmp_path)
71
+ print(f"Failed to install OmniSQL: {e}")
72
+ sys.exit(1)
73
+
74
+ if __name__ == "__main__":
75
+ main()
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: omnisql
3
+ Version: 0.1.0
4
+ Summary: Blazing-fast, next-generation SQL linter
5
+ Author-email: OmniSQL Contributors <hello@omnisql.dev>
6
+ License: MIT
7
+ Keywords: sql,linter,ast
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.7
12
+ Description-Content-Type: text/markdown
13
+
14
+ # OmniSQL Python Wrapper
15
+
16
+ This is the Python wrapper for OmniSQL, a blazing-fast SQL linter built in Rust.
17
+
18
+ For full documentation, visit the [main repository](https://github.com/Shivam-Jha96/omnisql).
@@ -0,0 +1,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ omnisql/__init__.py
5
+ omnisql/install.py
6
+ omnisql.egg-info/PKG-INFO
7
+ omnisql.egg-info/SOURCES.txt
8
+ omnisql.egg-info/dependency_links.txt
9
+ omnisql.egg-info/entry_points.txt
10
+ omnisql.egg-info/top_level.txt
11
+ omnisql/bin/omnisql.exe
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ omnisql = omnisql:main
@@ -0,0 +1 @@
1
+ omnisql
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "omnisql"
7
+ version = "0.1.0"
8
+ description = "Blazing-fast, next-generation SQL linter"
9
+ authors = [
10
+ { name = "OmniSQL Contributors", email = "hello@omnisql.dev" }
11
+ ]
12
+ readme = "README.md"
13
+ requires-python = ">=3.7"
14
+ keywords = ["sql", "linter", "ast"]
15
+ license = { text = "MIT" }
16
+ classifiers = [
17
+ "Programming Language :: Python :: 3",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: OS Independent",
20
+ ]
21
+
22
+ [project.scripts]
23
+ omnisql = "omnisql:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
omnisql-0.1.0/setup.py ADDED
@@ -0,0 +1,26 @@
1
+ import os
2
+ import sys
3
+ import platform
4
+ import subprocess
5
+ from setuptools import setup, find_packages
6
+ from setuptools.command.build_py import build_py
7
+
8
+ class CustomBuildCommand(build_py):
9
+ def run(self):
10
+ # We will execute the install.py script first so the binary is included
11
+ install_script = os.path.join(os.path.dirname(__file__), 'omnisql', 'install.py')
12
+ subprocess.check_call([sys.executable, install_script])
13
+
14
+ # Run the standard build process
15
+ build_py.run(self)
16
+
17
+ setup(
18
+ name="omnisql",
19
+ version="0.1.0",
20
+ packages=find_packages(),
21
+ cmdclass={
22
+ 'build_py': CustomBuildCommand,
23
+ },
24
+ include_package_data=True,
25
+ package_data={'omnisql': ['bin/*']},
26
+ )