sqlite-predict 0.0.1a1__tar.gz → 0.0.1a4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite-predict
3
- Version: 0.0.1a1
3
+ Version: 0.0.1a4
4
4
  Summary: Prediction as a SQL primitive for SQLite: forecast, detect_anomalies, predict, with replayable receipts.
5
5
  License: MIT OR Apache-2.0
6
6
  Project-URL: Homepage, https://github.com/PureStorage-OpenConnect/sqlite-predict
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sqlite-predict"
7
- version = "0.0.1a1"
7
+ version = "0.0.1a4"
8
8
  description = "Prediction as a SQL primitive for SQLite: forecast, detect_anomalies, predict, with replayable receipts."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -0,0 +1,61 @@
1
+ """Compile the bundled amalgamation into a loadable SQLite extension and ship it
2
+ inside the wheel. `src/` (the amalgamation + SQLite ext headers) is populated by
3
+ `make python-src` from the repo root, and is present in the sdist."""
4
+ import os
5
+ import subprocess
6
+ import sys
7
+
8
+ from setuptools import Distribution, setup
9
+ from setuptools.command.build_py import build_py
10
+
11
+ try: # setuptools >= 70.1 vendors bdist_wheel; older builds use the wheel package
12
+ from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
13
+ except ImportError:
14
+ from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
15
+
16
+ HERE = os.path.dirname(os.path.abspath(__file__))
17
+ EXT = {"darwin": "dylib", "win32": "dll"}.get(sys.platform, "so")
18
+
19
+
20
+ class Build(build_py):
21
+ def run(self):
22
+ src = os.path.join(HERE, "src", "sqlite-predict.c")
23
+ if not os.path.exists(src):
24
+ raise SystemExit(
25
+ "src/sqlite-predict.c is missing; run `make python-src` from the"
26
+ " repo root to generate the amalgamation into this package")
27
+ out = os.path.join(HERE, "sqlite_predict", "predict0." + EXT)
28
+ cc = os.environ.get("CC", "cc")
29
+ flags = ["-O2", "-shared"] if sys.platform == "win32" \
30
+ else ["-O3", "-fPIC", "-shared"]
31
+ subprocess.check_call([cc, *flags, "-I", os.path.join(HERE, "src"),
32
+ src, "-o", out])
33
+ super().run()
34
+
35
+
36
+ class BinaryDistribution(Distribution):
37
+ """The package ships a prebuilt loadable. Declaring ext modules makes
38
+ setuptools install it to platlib (not purelib, which auditwheel rejects)
39
+ and marks the wheel platform-specific."""
40
+
41
+ def has_ext_modules(self):
42
+ return True
43
+
44
+
45
+ class BDistWheel(_bdist_wheel):
46
+ """The loadable is not a CPython extension, so the wheel is platform-specific
47
+ but ABI-agnostic. Tag it py3-none-<platform> rather than cp3x-cp3x-<platform>
48
+ (any Python on that platform can load it), and not py3-none-any (which would
49
+ claim it is pure Python and makes cibuildwheel reject it)."""
50
+
51
+ def finalize_options(self):
52
+ super().finalize_options()
53
+ self.root_is_pure = False
54
+
55
+ def get_tag(self):
56
+ _python, _abi, plat = super().get_tag()
57
+ return "py3", "none", plat
58
+
59
+
60
+ setup(distclass=BinaryDistribution,
61
+ cmdclass={"build_py": Build, "bdist_wheel": BDistWheel})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlite-predict
3
- Version: 0.0.1a1
3
+ Version: 0.0.1a4
4
4
  Summary: Prediction as a SQL primitive for SQLite: forecast, detect_anomalies, predict, with replayable receipts.
5
5
  License: MIT OR Apache-2.0
6
6
  Project-URL: Homepage, https://github.com/PureStorage-OpenConnect/sqlite-predict
@@ -3,7 +3,6 @@ README.md
3
3
  pyproject.toml
4
4
  setup.py
5
5
  sqlite_predict/__init__.py
6
- sqlite_predict/predict0.dylib
7
6
  sqlite_predict.egg-info/PKG-INFO
8
7
  sqlite_predict.egg-info/SOURCES.txt
9
8
  sqlite_predict.egg-info/dependency_links.txt