Skip to content

Commit 596934d

Browse files
committed
parameterize pg version based on release tag
1 parent 7015810 commit 596934d

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

.github/workflows/wheels.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ jobs:
2222
- name: Build wheels
2323
run: python -m cibuildwheel --output-dir wheelhouse
2424
env:
25-
CIBW_BEFORE_ALL_LINUX: "bash tools/install_pg.sh"
25+
CIBW_ENVIRONMENT:
26+
CIBW_BEFORE_ALL_LINUX: ${{ format('sh tools/install_pg.sh {0}', github.ref) }}
2627

2728
- name: Run tests
2829
run: pytest tests/
File renamed without changes.

setup.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ def package_files(directory):
1111
return paths
1212

1313

14-
extra_files = package_files("postgresql_wheel/binary")
14+
extra_files = package_files("postgresql/binary")
1515

1616
setup(
17-
name="postgresql-wheel",
17+
name="postgresql_wheel",
1818
version="13.4",
19-
description="PostgreSQL in a Python Wheel.",
19+
description="PostgreSQL Server compiled into a Python Wheel.",
2020
author="Michel Pelletier",
21-
packages=["postgresql_wheel"],
22-
package_data={"postgresql_wheel": extra_files},
23-
setup_requires=["cffi>=1.0.0"],
24-
install_requires=["psycopg2-binary"],
25-
cffi_modules=["postgresql_wheel/__init__.py:ffibuilder"],
26-
python_requires=">=3.7,<3.10",
21+
packages=["postgresql"],
22+
package_data={"postgresql": extra_files},
23+
setup_requires=["cffi"],
24+
cffi_modules=["postgresql/__init__.py:ffibuilder"],
25+
python_requires=">=3.8,<3.9",
2726
)

tools/install_pg.sh

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
if [[ $1 =~ refs/tags/([0-9]+\.[0-9]+).*$ ]];
2+
then
3+
VERSION=${BASH_REMATCH[1]}
4+
echo "Building ${VERSION}"
5+
else
6+
exit -1
7+
fi
18

29
yum install -y zlib-devel readline-devel
3-
curl -L -O https://ftp.postgresql.org/pub/source/v13.4/postgresql-13.4.tar.gz
10+
curl -L -O https://ftp.postgresql.org/pub/source/v13.4/postgresql-${VERSION}.tar.gz
411

5-
tar -xzf postgresql-13.4.tar.gz
6-
cd postgresql-13.4
12+
tar -xzf postgresql-${VERSION}.tar.gz
13+
cd postgresql-${VERSION}
714
./configure --prefix=`pwd`/../postgresql/binary
815
make -j 4
916
make install

0 commit comments

Comments
 (0)