File tree Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Expand file tree Collapse file tree 4 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 1
1
# postgresql-wheel
2
- A Python wheel containing PostgreSQL
2
+
3
+ A Python wheel for Linux containing the PostgreSQL database server.
4
+
5
+ The wheel can be installed with pip:
6
+
7
+ ```
8
+ $ pip install postgresql-wheel
9
+ Collecting postgresql-wheel
10
+ Using cached postgresql_wheel-13.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (13.8 MB)
11
+ Installing collected packages: postgresql-wheel
12
+ Successfully installed postgresql-wheel-13.4
13
+ $ ipython
14
+ ```
15
+
Original file line number Diff line number Diff line change 1
- from cffi import FFI
1
+ from pathlib import Path
2
2
3
- ffibuilder = FFI ()
3
+ from plumbum import local
4
+ import postgresql
4
5
5
- ffibuilder . set_source ( "_postgresql" , " " )
6
+ local . path . append ( Path ( postgresql . __file__ ). parent / "bin " )
6
7
7
- ffibuilder .cdef ("" )
8
-
9
- if __name__ == "__main__" :
10
- ffibuilder .compile (verbose = True )
8
+ initdb = local .cmd .initdb
9
+ pg_ctl = local .cmd .pg_ctl
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def package_files(directory):
11
11
return paths
12
12
13
13
14
- extra_files = package_files ("postgresql/binary " )
14
+ extra_files = package_files ("postgresql" )
15
15
16
16
setup (
17
17
name = "postgresql_wheel" ,
@@ -21,6 +21,7 @@ def package_files(directory):
21
21
packages = ["postgresql" ],
22
22
package_data = {"postgresql" : extra_files },
23
23
setup_requires = ["cffi" ],
24
- cffi_modules = ["postgresql/__init__.py:ffibuilder" ],
24
+ install_requires = ["plumbum" ],
25
+ cffi_modules = ["postgresql/build.py:ffibuilder" ],
25
26
python_requires = ">=3.8,<3.9" ,
26
27
)
Original file line number Diff line number Diff line change 3
3
VERSION=${BASH_REMATCH[1]}
4
4
echo " Building ${VERSION} "
5
5
else
6
- exit -1
6
+ VERSION=13.4
7
7
fi
8
8
9
9
yum install -y zlib-devel readline-devel
10
10
curl -L -O https://ftp.postgresql.org/pub/source/v13.4/postgresql-${VERSION} .tar.gz
11
11
12
12
tar -xzf postgresql-${VERSION} .tar.gz
13
13
cd postgresql-${VERSION}
14
- ./configure --prefix=` pwd` /../postgresql/binary
14
+ ./configure --prefix=` pwd` /../postgresql
15
15
make -j 4
16
16
make install
17
17
cd ..
You can’t perform that action at this time.
0 commit comments