-
Notifications
You must be signed in to change notification settings - Fork 37
feat: update cookiecutter template to support new package managers and asset bundlers #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0e9d456
63d3b41
c15952f
b070916
48bd415
c4961c3
9b2c4c3
832f566
2500a3c
8a3997b
742f78a
cd1ae07
fa60c80
f97203a
b0f7c0d
860252f
55ab743
a3bf064
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,12 +6,6 @@ | |
| "author_name": "CERN", | ||
| "author_email": "info@{{ cookiecutter.project_site }}", | ||
| "year": "{% now 'local', '%Y' %}", | ||
| "database": [ | ||
| "postgresql" | ||
| ], | ||
| "search": [ | ||
| "opensearch2" | ||
| ], | ||
| "file_storage": [ | ||
| "local", | ||
| "S3" | ||
|
|
@@ -24,8 +18,11 @@ | |
| "yes", | ||
| "no" | ||
| ], | ||
| "base_image": [ | ||
| "debian" | ||
| ], | ||
| "use_reduced_vocabs": [ | ||
| "no", | ||
| "yes" | ||
| "yes", | ||
| "no" | ||
|
Comment on lines
+25
to
+26
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would change defaults. I don't have a strong opinion, but worth making it clear to other reviewers.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, for other reviewers, this intentionally changes the old default. This cookiecutter is mostly used for development and demos, where you typically want a running instance fast without long time indexing. I found myself selecting
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✔️ |
||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,26 @@ | ||
| #!/usr/bin/env bash | ||
| # SPDX-FileCopyrightText: 2019 CERN. | ||
| # SPDX-FileCopyrightText: 2019 Northwestern University. | ||
| # Copyright (C) 2025 KTH Royal Institute of Technology. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| set -e | ||
|
|
||
| cd ${PROJECTDIR} | ||
| pipfile_lock_path="./Pipfile.lock" | ||
| cd "${PROJECTDIR}" | ||
| uv_lock_path="./uv.lock" | ||
|
|
||
| if [ ! -f $pipfile_lock_path ]; then | ||
| echo "'Pipfile.lock' not found. Generating via 'pipenv lock'..." | ||
| pipenv lock | ||
| if [ ! -f "${uv_lock_path}" ]; then | ||
| echo "'uv.lock' not found. Generating via 'uv lock'..." | ||
| uv lock | ||
| fi | ||
|
|
||
| # Installs all packages specified in Pipfile.lock | ||
| pipenv sync | ||
| # Install the project with its test extra declared in pyproject.toml. | ||
| uv sync --extra tests | ||
| export INVENIO_WEBPACKEXT_NPM_PKG_CLS=pynpm:PNPMPackage | ||
|
Samk13 marked this conversation as resolved.
|
||
| # Build assets | ||
| INVENIO_LOCAL_INSTANCE_PATH=$(pipenv run invenio shell --no-term-title -c "print(app.instance_path)") | ||
| cp -r ./static/. ${INVENIO_LOCAL_INSTANCE_PATH}/static/ | ||
| cp -r ./assets/. ${INVENIO_LOCAL_INSTANCE_PATH}/assets/ | ||
| INVENIO_LOCAL_INSTANCE_PATH="$(uv run invenio shell --no-term-title -c "print(app.instance_path)")" | ||
| cp -r ./static/. "${INVENIO_LOCAL_INSTANCE_PATH}/static/" | ||
| cp -r ./assets/. "${INVENIO_LOCAL_INSTANCE_PATH}/assets/" | ||
|
|
||
| pipenv run invenio collect -v | ||
| pipenv run invenio webpack buildall | ||
| uv run invenio collect -v | ||
| uv run invenio webpack buildall | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,23 @@ | ||
| #!/usr/bin/env bash | ||
| # SPDX-FileCopyrightText: 2019 CERN. | ||
| # SPDX-FileCopyrightText: 2019 Northwestern University. | ||
| # Copyright (C) 2025 KTH Royal Institute of Technology. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| set -e | ||
|
|
||
| cd ${PROJECTDIR} | ||
| cd "${PROJECTDIR}" | ||
|
|
||
| export FLASK_ENV=development | ||
| export INVENIO_SQLALCHEMY_DATABASE_URI="postgresql+psycopg2://{{cookiecutter.project_shortname}}:{{cookiecutter.project_shortname}}@localhost/{{cookiecutter.project_shortname}}" | ||
|
|
||
| # Start Worker and Server | ||
| pipenv run celery -A invenio_app.celery worker -l INFO & pid_celery=$! | ||
| uv run celery -A invenio_app.celery worker -l INFO & pid_celery=$! | ||
|
|
||
| pipenv run invenio run \ | ||
| --cert "$script_path"/../docker/nginx/test.crt \ | ||
| --key "$script_path"/../docker/nginx/test.key & pid_server=$! | ||
| uv run invenio run \ | ||
| --cert "${script_path}/../docker/nginx/test.crt" \ | ||
| --key "${script_path}/../docker/nginx/test.key" & pid_server=$! | ||
|
|
||
| trap 'kill $pid_celery $pid_server &>/dev/null' EXIT | ||
| trap 'kill "${pid_celery}" "${pid_server}" &>/dev/null' EXIT | ||
|
|
||
| wait $pid_celery $pid_server | ||
| wait "${pid_celery}" "${pid_server}" |
Uh oh!
There was an error while loading. Please reload this page.