forked from rero/rero-ils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
installation: fix python packages dependencies
* Fixes strange behaviours during the resolution dependencies with pipenv. This will make the new python packages easy. * Adds the documentation in the python packages file (Pipefile). * Adds support of a new version of the python import order check tool (isort>=4.3.10). * Adds new bootstrap and server command for pipenv. * Replaces scripts commands by pipenv run: * bootstrap * console * server * setup * update * Adds virtualenv detection in scripts/* for python>3.6.4. Co-Authored-by: Johnny Mariéthoz <[email protected]> Co-Authored-by: Olivier DOSSMANN <[email protected]>
- Loading branch information
1 parent
2f96ab2
commit 5da590e
Showing
10 changed files
with
253 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,11 @@ do | |
shift | ||
done | ||
|
||
# PIPENV is a mandatory condition to launch this program! | ||
if [[ -z "${VIRTUAL_ENV}" ]]; then | ||
error_msg+exit "Error - Launch this script via pipenv command:\n\tpipenv run ${PROGRAM}" | ||
fi | ||
|
||
if ! $deploy || $ci ; then | ||
flags=("--dev") | ||
fi | ||
|
@@ -113,40 +118,40 @@ ${cmd} ${flags[@]} | |
# to avoid IPython dependency problem on Mac OS X | ||
if [ "$(uname -s)" == "Darwin" ]; then | ||
info_msg "Install 'appnope' for Mac OS X" | ||
pipenv run pip install appnope | ||
pip install appnope | ||
fi | ||
|
||
# install assets utils | ||
virtualenv_path=`pipenv --venv` | ||
info_msg "Install npm assets utils in: ${virtualenv_path}" | ||
pipenv run npm i npm@latest -g --prefix "${virtualenv_path}" && pipenv run npm install --prefix "${virtualenv_path}" --silent -g [email protected] [email protected] [email protected] [email protected] @angular/[email protected] yarn | ||
npm i npm@latest -g --prefix "${virtualenv_path}" && npm install --prefix "${virtualenv_path}" --silent -g [email protected] [email protected] [email protected] [email protected] @angular/[email protected] yarn | ||
|
||
# collect static files and compile html/css assets | ||
# ------------------------------------------------ | ||
# install the npm dependencies | ||
info_msg "Install npm dependencies" | ||
pipenv run invenio npm | ||
invenio npm | ||
info_msg "Search static folder location" | ||
static_folder=$(pipenv run invenio shell --no-term-title -c "print('static_folder:%s' % app.static_folder)"|grep static_folder| cut -d: -f2-) | ||
info_msg "Install static folder npm dependencies in: ${static_folder}" | ||
pipenv run npm install --prefix "${static_folder}" | ||
npm install --prefix "${static_folder}" | ||
if [ -f ${tgz_file} ] | ||
then | ||
info_msg "Install RERO-ILS-UI from tgz: ${tgz_file}" | ||
pipenv run npm install "${tgz_file}" --prefix "${static_folder}" | ||
npm install "${tgz_file}" --prefix "${static_folder}" | ||
fi | ||
|
||
# build the web assets | ||
info_msg "Build web assets: collect" | ||
pipenv run invenio collect -v | ||
invenio collect -v | ||
info_msg "Build web assets: check (build command)" | ||
pipenv run invenio assets build | ||
invenio assets build | ||
|
||
# compile json files (resolve $ref) | ||
info_msg "Compile JSON files to resolve \$ref" | ||
echo | ||
pipenv run invenio utils compile_json ./rero_ils/modules/documents/jsonschemas/documents/document-minimal-v0.0.1_src.json -o ./rero_ils/modules/documents/jsonschemas/documents/document-minimal-v0.0.1.json | ||
pipenv run invenio utils compile_json ./rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1_src.json -o ./rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1.json | ||
invenio utils compile_json ./rero_ils/modules/documents/jsonschemas/documents/document-minimal-v0.0.1_src.json -o ./rero_ils/modules/documents/jsonschemas/documents/document-minimal-v0.0.1.json | ||
invenio utils compile_json ./rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1_src.json -o ./rero_ils/modules/documents/jsonschemas/documents/document-v0.0.1.json | ||
|
||
success_msg "${PROGRAM} finished!" | ||
exit 0 |
Oops, something went wrong.