postgresql-binaries 14.22.0__py3-none-win_amd64.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.
- postgresql_binaries/__init__.py +25 -0
- postgresql_binaries/postgresql-14.22.0-x86_64-pc-windows-msvc.tar.gz +0 -0
- postgresql_binaries/py.typed +0 -0
- postgresql_binaries-14.22.0.dist-info/METADATA +38 -0
- postgresql_binaries-14.22.0.dist-info/RECORD +6 -0
- postgresql_binaries-14.22.0.dist-info/WHEEL +5 -0
|
@@ -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
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: postgresql-binaries
|
|
3
|
+
Version: 14.22.0
|
|
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
|
+
Project-URL: repository, https://github.com/leontrolski/postgresql-binaries
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
# Postgresql Binaries
|
|
12
|
+
|
|
13
|
+
Uses releases from [theseus-rs/postgresql-binaries](https://github.com/theseus-rs/postgresql-binaries) and publishes them to pypy, so that you can do:
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
pip install postgresql-binaries==18.3.0
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then to use, eg:
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
import postgresql_binaries
|
|
23
|
+
import subprocess
|
|
24
|
+
|
|
25
|
+
cmd = [
|
|
26
|
+
str(postgresql_binaries.bin() / "initdb"),
|
|
27
|
+
*("-D", directory),
|
|
28
|
+
*("-U", "postgres"),
|
|
29
|
+
*("--auth-host", "trust"),
|
|
30
|
+
]
|
|
31
|
+
subprocess.check_call(cmd)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Packages are around 10MB. On the first call to `bin()`, the archive baked into the wheel is unpacked in place.
|
|
35
|
+
|
|
36
|
+
<hr>
|
|
37
|
+
|
|
38
|
+
This library is intentionally really dumb, and intended to be built upon. There are [mixed opinions](https://discuss.python.org/t/use-of-pypi-as-a-generic-storage-platform-for-binaries/106044/58?page=3) on whether (ab)using PyPI to host binary files is a good idea. There are [similar](https://github.com/Ladybug-Memory/pgembed) packages around, but they don't handle versioning well and include too much other junk.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
postgresql_binaries/__init__.py,sha256=BAAVGsNcE7qV6wc3fvZfgsHI-SLNVPA-0HGK2R0A_S8,617
|
|
2
|
+
postgresql_binaries/postgresql-14.22.0-x86_64-pc-windows-msvc.tar.gz,sha256=tx5xA6YT8ApHmFn0FDBFquiBKUZUej7Wa5eFx-yvO5E,43207932
|
|
3
|
+
postgresql_binaries/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
postgresql_binaries-14.22.0.dist-info/WHEEL,sha256=st-Lolwqfop0FxKSSuZwG283dTB3imS3nxXcHyBqdko,88
|
|
5
|
+
postgresql_binaries-14.22.0.dist-info/METADATA,sha256=I5Cq1eFforyFBMKT4k1F9mph60X3_JWt_ALiRUbvvK8,1339
|
|
6
|
+
postgresql_binaries-14.22.0.dist-info/RECORD,,
|