postgresql-binaries 0.0.1__py3-none-any.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,18 @@
1
+ from functools import cache
2
+ from pathlib import Path
3
+ import tarfile
4
+
5
+ LIB = Path(__file__).parent
6
+
7
+
8
+ @cache
9
+ def bin() -> Path:
10
+ archive = next(LIB.glob("postgresql-*.tar.gz"))
11
+ stem = archive.name[: -len(".tar.gz")]
12
+ if not (LIB / stem).exists():
13
+ with tarfile.open(archive, "r:gz") as tar:
14
+ tar.extractall(path=LIB, filter="data")
15
+
16
+ out = LIB / stem / "bin"
17
+ assert out.exists()
18
+ return out
File without changes
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.3
2
+ Name: postgresql-binaries
3
+ Version: 0.0.1
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
+ Then eg.
19
+
20
+ ```python
21
+ import postgresql_binaries
22
+ import subprocess
23
+
24
+ cmd = [
25
+ str(postgresql_binaries.bin() / "initdb"),
26
+ *("-D", directory),
27
+ *("-U", "postgres"),
28
+ *("--auth-host", "trust"),
29
+ ]
30
+ subprocess.check_call(cmd)
31
+ ```
32
+
33
+ On the first call to `bin()`, the archive baked into the wheel is unpacked.
@@ -0,0 +1,6 @@
1
+ postgresql_binaries/__init__.py,sha256=UDcRPIR4ADQUvYYyz9gUpewRBZkpPLDRVqcsWsje7ck,426
2
+ postgresql_binaries/postgresql-15.18.0-aarch64-apple-darwin.tar.gz,sha256=hm4n6kDQjdaOVmEcGgGUrVbG4cGFZpXEfKH_LDU0Xgc,11883104
3
+ postgresql_binaries/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ postgresql_binaries-0.0.1.dist-info/WHEEL,sha256=uOqnPWqgFlbov4NeTCercq7cBQ2UN7xh5fiW55lOnAg,81
5
+ postgresql_binaries-0.0.1.dist-info/METADATA,sha256=rAyQRqXjiX3WNTolBg9rgemhLz_y9p6n6GgQzYAUBwc,793
6
+ postgresql_binaries-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.11.26
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any