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 11# 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
22
3- ffibuilder = FFI ()
3+ from plumbum import local
4+ import postgresql
45
5- ffibuilder . set_source ( "_postgresql" , " " )
6+ local . path . append ( Path ( postgresql . __file__ ). parent / "bin " )
67
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):
1111 return paths
1212
1313
14- extra_files = package_files ("postgresql/binary " )
14+ extra_files = package_files ("postgresql" )
1515
1616setup (
1717 name = "postgresql_wheel" ,
@@ -21,6 +21,7 @@ def package_files(directory):
2121 packages = ["postgresql" ],
2222 package_data = {"postgresql" : extra_files },
2323 setup_requires = ["cffi" ],
24- cffi_modules = ["postgresql/__init__.py:ffibuilder" ],
24+ install_requires = ["plumbum" ],
25+ cffi_modules = ["postgresql/build.py:ffibuilder" ],
2526 python_requires = ">=3.8,<3.9" ,
2627)
Original file line number Diff line number Diff line change 33 VERSION=${BASH_REMATCH[1]}
44 echo " Building ${VERSION} "
55else
6- exit -1
6+ VERSION=13.4
77fi
88
99yum install -y zlib-devel readline-devel
1010curl -L -O https://ftp.postgresql.org/pub/source/v13.4/postgresql-${VERSION} .tar.gz
1111
1212tar -xzf postgresql-${VERSION} .tar.gz
1313cd postgresql-${VERSION}
14- ./configure --prefix=` pwd` /../postgresql/binary
14+ ./configure --prefix=` pwd` /../postgresql
1515make -j 4
1616make install
1717cd ..
You can’t perform that action at this time.
0 commit comments