mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-15 05:26:37 +03:00
27 lines
677 B
Bash
Executable File
27 lines
677 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
set -x
|
|
|
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
prjdir="$( cd "${dir}/../.." && pwd )"
|
|
|
|
# Find psycopg version
|
|
version=$(grep -e ^PSYCOPG_VERSION setup.py | sed "s/.*'\(.*\)'/\1/")
|
|
# A gratuitous comment to fix broken vim syntax file: '")
|
|
distdir="${prjdir}/dist"
|
|
|
|
# Replace the package name
|
|
if [[ "${PACKAGE_NAME:-}" ]]; then
|
|
sed -i "s/^setup(name=\"psycopg2\"/setup(name=\"${PACKAGE_NAME}\"/" \
|
|
"${prjdir}/setup.py"
|
|
fi
|
|
|
|
# Build the source package
|
|
python setup.py sdist -d "$distdir"
|
|
|
|
# install and test
|
|
pip install "${distdir}"/*.tar.gz
|
|
|
|
python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')"
|