mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-11-02 08:10:03 -06:00
Overhaul the PIP build system so it's less messy on disk during builds, and avoids packaging unnecessary files.
This commit is contained in:
1 parent
d4e5d9c4f4
commit
29fbbb581f
4 files changed
+101
-92
No files matched your search
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# pgAdmin 4 - PostgreSQL Tools
|
||||
#
|
||||
# Copyright (C) 2013 - 2016, The pgAdmin Development Team
|
||||
# This software is released under the PostgreSQL Licence
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# Runtime checks
|
||||
if [ ! -d runtime -a ! -d web ]; then
|
||||
echo This script must be run from the top-level directory of the source tree.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d .git -a ! -f .git/config ]; then
|
||||
echo This script must be run from a git checkout of the source tree.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the required package info
|
||||
APP_RELEASE=`grep "^APP_RELEASE" web/config.py | cut -d"=" -f2 | sed 's/ //g'`
|
||||
APP_REVISION=`grep "^APP_REVISION" web/config.py | cut -d"=" -f2 | sed 's/ //g'`
|
||||
APP_NAME=`grep "^APP_NAME" web/config.py | cut -d"=" -f2 | sed "s/'//g" | sed 's/^ //'`
|
||||
APP_LONG_VERSION=$APP_RELEASE.$APP_REVISION
|
||||
APP_SHORT_VERSION=`echo $APP_LONG_VERSION | cut -d . -f1,2`
|
||||
APP_SUFFIX=`grep "^APP_SUFFIX" web/config.py | cut -d"=" -f2 | sed 's/ //g' | sed "s/'//g"`
|
||||
if [ ! -z $APP_SUFFIX ]; then
|
||||
export APP_LONG_VERSION=$APP_LONG_VERSION-$APP_SUFFIX
|
||||
fi
|
||||
TARBALL_NAME=`echo $APP_NAME-$APP_LONG_VERSION | sed 's/ //g' | awk '{print tolower($0)}'`
|
||||
|
||||
# Output basic details to show we're working
|
||||
echo Building tarballs for $APP_NAME version $APP_LONG_VERSION...
|
||||
|
||||
# Create/clearout the build directory
|
||||
echo Creating/cleaning required directories...
|
||||
if [ ! -d pip-build ]; then
|
||||
mkdir pip-build
|
||||
fi
|
||||
|
||||
if [ -d pip-build/pgadmin4 ]; then
|
||||
rm -rf pip-build/pgadmin4
|
||||
fi
|
||||
|
||||
mkdir pip-build/pgadmin4
|
||||
|
||||
# Build the clean tree
|
||||
cd web
|
||||
for FILE in `git ls-files`
|
||||
do
|
||||
echo Adding $FILE
|
||||
# We use tar here to preserve the path, as Mac (for example) doesn't support cp --parents
|
||||
tar cf - $FILE | (cd ../pip-build/pgadmin4; tar xf -)
|
||||
done
|
||||
|
||||
cd ../
|
||||
for FILE in LICENSE README libraries.txt
|
||||
do
|
||||
echo Adding $FILE
|
||||
# We use tar here to preserve the path, as Mac (for example) doesn't support cp --parents
|
||||
tar cf - $FILE | (cd pip-build/pgadmin4; tar xf -)
|
||||
done
|
||||
|
||||
# Create the manifest
|
||||
echo Creating manifest...
|
||||
echo recursive-include pgadmin4 \* > pip-build/MANIFEST.in
|
||||
|
||||
# Run the build
|
||||
echo Building wheel...
|
||||
cd pip-build
|
||||
python ../pkg/pip/setup_pip.py bdist_wheel
|
||||
cd ../
|
||||
|
||||
# Get the build
|
||||
if [ ! -d dist ]; then
|
||||
mkdir dist
|
||||
fi
|
||||
cp pip-build/dist/*.whl dist/
|
||||
@@ -18,13 +18,13 @@ from os import path
|
||||
"""This script is used to help generate PIP packages"""
|
||||
|
||||
# Get the requirements list for the current version of Python
|
||||
req_file='requirements_py' + str(sys.version_info[0]) + '.txt'
|
||||
req_file='../requirements_py' + str(sys.version_info[0]) + '.txt'
|
||||
|
||||
with open(req_file) as reqf:
|
||||
required = reqf.read().decode("utf-8").splitlines()
|
||||
|
||||
# Get the app version
|
||||
modl = imp.load_source('APP_VERSION', 'web/config.py')
|
||||
modl = imp.load_source('APP_VERSION', '../web/config.py')
|
||||
|
||||
setup(
|
||||
name='pgadmin4',
|
||||
|
||||
Reference in new issue
Block a user