Support distro-specific configs, and include docs in the PIP wheel.
A distro can now install a config_distro.py file alongside config.py in which distro-specific configuration settings can be set, overriding those in config.py. User settings in config_local.py will override all other settings. This is useful to allow packagers to config settings like the doc path, that may be specific to RPMs or Wheels etc.pull/3/head
parent
29fbbb581f
commit
17b6053f45
|
|
@ -46,6 +46,7 @@ if [ -d pip-build/pgadmin4 ]; then
|
|||
fi
|
||||
|
||||
mkdir pip-build/pgadmin4
|
||||
mkdir pip-build/pgadmin4/docs
|
||||
|
||||
# Build the clean tree
|
||||
cd web
|
||||
|
|
@ -56,6 +57,22 @@ do
|
|||
tar cf - $FILE | (cd ../pip-build/pgadmin4; tar xf -)
|
||||
done
|
||||
|
||||
cd ../docs
|
||||
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/docs; tar xf -)
|
||||
done
|
||||
|
||||
for DIR in `ls -d ??_??/`
|
||||
do
|
||||
if [ -d $DIR/_build/html ]; then
|
||||
mkdir -p ../pip-build/pgadmin4/docs/$DIR/_build
|
||||
cp -R $DIR/_build/html ../pip-build/pgadmin4/docs/$DIR/_build
|
||||
fi
|
||||
done
|
||||
|
||||
cd ../
|
||||
for FILE in LICENSE README libraries.txt
|
||||
do
|
||||
|
|
@ -64,6 +81,11 @@ do
|
|||
tar cf - $FILE | (cd pip-build/pgadmin4; tar xf -)
|
||||
done
|
||||
|
||||
# Create the distro config
|
||||
echo Creating distro config...
|
||||
echo HELP_PATH = \'../../docs/en_US/_build/html/\' > pip-build/pgadmin4/config_distro.py
|
||||
echo MINIFY_HTML = False >> pip-build/pgadmin4/config_distro.py
|
||||
|
||||
# Create the manifest
|
||||
echo Creating manifest...
|
||||
echo recursive-include pgadmin4 \* > pip-build/MANIFEST.in
|
||||
|
|
|
|||
|
|
@ -250,6 +250,12 @@ THREADED_MODE = True
|
|||
# Local config settings
|
||||
##########################################################################
|
||||
|
||||
# Load distribution-specific config overrides
|
||||
try:
|
||||
from config_distro import *
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Load local config overrides
|
||||
try:
|
||||
from config_local import *
|
||||
|
|
|
|||
Loading…
Reference in New Issue