postgresql-binaries 14.22.0.dev0__py3-none-macosx_11_0_arm64.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.
@@ -0,0 +1,25 @@
1
+ from functools import cache
2
+ from pathlib import Path
3
+ import shutil
4
+ import tarfile
5
+
6
+ LIB = Path(__file__).parent
7
+
8
+
9
+ @cache
10
+ def bin() -> Path:
11
+ archive = next(LIB.glob("postgresql-*.tar.gz"))
12
+ stem = archive.name[: -len(".tar.gz")]
13
+
14
+ # Clean up any previous versions
15
+ for existing in LIB.glob("postgresql-*"):
16
+ if existing.is_dir() and existing.name != stem:
17
+ shutil.rmtree(existing)
18
+
19
+ if not (LIB / stem).exists():
20
+ with tarfile.open(archive, "r:gz") as tar:
21
+ tar.extractall(path=LIB, filter="data")
22
+
23
+ out = LIB / stem / "bin"
24
+ assert out.exists()
25
+ return out
File without changes
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.3
2
+ Name: postgresql-binaries
3
+ Version: 14.22.0.dev0
4
+ Summary: PostgreSQL binaries for Linux, MacOS and Windows
5
+ Author: Oli Russell
6
+ Author-email: Oli Russell <mrxoliver@gmail.com>
7
+ Requires-Python: >=3.12
8
+ Description-Content-Type: text/markdown
9
+
10
+ # Postgresql Binaries
11
+
12
+ Uses releases from [theseus-rs/postgresql-binaries](https://github.com/theseus-rs/postgresql-binaries) and publishes them to pypy, so that you can do:
13
+
14
+ ```shell
15
+ pip install postgresql-binaries==18.4.0
16
+ ```
17
+
18
+ The package is around 11MB.
19
+
20
+ Then to use, eg:
21
+
22
+ ```python
23
+ import postgresql_binaries
24
+ import subprocess
25
+
26
+ cmd = [
27
+ str(postgresql_binaries.bin() / "initdb"),
28
+ *("-D", directory),
29
+ *("-U", "postgres"),
30
+ *("--auth-host", "trust"),
31
+ ]
32
+ subprocess.check_call(cmd)
33
+ ```
34
+
35
+ On the first call to `bin()`, the archive baked into the wheel is unpacked in place.
@@ -0,0 +1,6 @@
1
+ postgresql_binaries/__init__.py,sha256=BAAVGsNcE7qV6wc3fvZfgsHI-SLNVPA-0HGK2R0A_S8,617
2
+ postgresql_binaries/postgresql-14.22.0-aarch64-apple-darwin.tar.gz,sha256=z35h9O3HAcd-SO0gkkDxxlIzC2GnPONdWbQlMmgCpEQ,8970507
3
+ postgresql_binaries/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ postgresql_binaries-14.22.0.dev0.dist-info/WHEEL,sha256=XzvROHhFBhe0JUH9N6MNZ1OmSxoL5cfTtPCpfoD3zOM,96
5
+ postgresql_binaries-14.22.0.dev0.dist-info/METADATA,sha256=BD_wOFpvKAmtTxfKWufN0DvsnRu6TW5zgU5412BtNJw,847
6
+ postgresql_binaries-14.22.0.dev0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.11.26
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-macosx_11_0_arm64
5
+