postgresql-binaries 0.0.1__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.
- postgresql_binaries-0.0.1/PKG-INFO +33 -0
- postgresql_binaries-0.0.1/README.md +24 -0
- postgresql_binaries-0.0.1/pyproject.toml +14 -0
- postgresql_binaries-0.0.1/src/postgresql_binaries/__init__.py +18 -0
- postgresql_binaries-0.0.1/src/postgresql_binaries/postgresql-15.18.0-aarch64-apple-darwin.tar.gz +0 -0
- postgresql_binaries-0.0.1/src/postgresql_binaries/py.typed +0 -0
|
@@ -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,24 @@
|
|
|
1
|
+
# Postgresql Binaries
|
|
2
|
+
|
|
3
|
+
Uses releases from [theseus-rs/postgresql-binaries](https://github.com/theseus-rs/postgresql-binaries) and publishes them to pypy, so that you can do:
|
|
4
|
+
|
|
5
|
+
```shell
|
|
6
|
+
pip install postgresql-binaries@18.4.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Then eg.
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
import postgresql_binaries
|
|
13
|
+
import subprocess
|
|
14
|
+
|
|
15
|
+
cmd = [
|
|
16
|
+
str(postgresql_binaries.bin() / "initdb"),
|
|
17
|
+
*("-D", directory),
|
|
18
|
+
*("-U", "postgres"),
|
|
19
|
+
*("--auth-host", "trust"),
|
|
20
|
+
]
|
|
21
|
+
subprocess.check_call(cmd)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
On the first call to `bin()`, the archive baked into the wheel is unpacked.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "postgresql-binaries"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "PostgreSQL binaries for Linux, MacOS and Windows"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Oli Russell", email = "mrxoliver@gmail.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
dependencies = []
|
|
11
|
+
|
|
12
|
+
[build-system]
|
|
13
|
+
requires = ["uv_build>=0.11.7,<0.12.0"]
|
|
14
|
+
build-backend = "uv_build"
|
|
@@ -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
|
postgresql_binaries-0.0.1/src/postgresql_binaries/postgresql-15.18.0-aarch64-apple-darwin.tar.gz
ADDED
|
Binary file
|
|
File without changes
|