Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.git
*.gitignore
.env
.venv

*.mo
*.pyc
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/continuous-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ jobs:
- name: Run Test
run: uv run poe run_tests

- name: Coverage XML
if: ${{ matrix.dependencies == 'dev' }}
run: uv run coverage xml

- name: Coveralls
if: ${{ matrix.dependencies == 'development' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: |
coveralls
if: ${{ matrix.dependencies == 'dev' }}
uses: coverallsapp/github-action@v2
with:
format: cobertura
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ celerybeat-schedule
# Environment variables
.env

# uv virtual enviroment
.venv

# VSCodium
.vscode

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ RUN chown -R invenio:invenio ${WORKING_DIR}
USER 1000

ENV INVENIO_COLLECT_STORAGE='flask_collect.storage.file'
RUN uv run ./scripts/bootstrap --deploy
RUN uv run --no-sync ./scripts/bootstrap --deploy
2 changes: 1 addition & 1 deletion docker-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
- "INVENIO_SECRET_KEY=CHANGE_ME"
- "INVENIO_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://rero-mef:rero-mef@db/rero-mef"
- "INVENIO_WSGI_PROXIES=2"
- "INVENIO_RATELIMIT_STORAGE_URL=redis://cache:6379/3"
- "INVENIO_RATELIMIT_STORAGE_URI=redis://cache:6379/3"
lb:
build: ./docker/haproxy/
image: rero-mef-lb
Expand Down
87 changes: 45 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,70 @@
name = "rero-mef"
version = "0.16.2"
description = "Invenio digital library framework MEF."
authors = [{name = "RERO",email = "[email protected]"}]
authors = [{name = "RERO+", email = "[email protected]"}]
license = "AGPL-3.0"
requires-python = ">= 3.9.2,<3.13"

dependencies = [
## Third party invenio modules used by RERO MEF
"uwsgi (>=2.0)",
"uwsgi-tools (>=1.1.1)",
"uwsgitop (>=0.11)",
"invenio-oaiharvester @ git+https://github.com/inveniosoftware/[email protected]",
"invenio-search [elasticsearch7] (>=3.0.0,<4.0.0)",
"invenio-search [elasticsearch7] >=3.0.0,<4.0.0",
# Invenio core modules
"invenio-app (>=2.0.0,<3.0.0)",
"invenio-base (>=2.0.0,<3.0.0)",
"invenio-cache (>=2.0.0,<3.0.0)",
"invenio-celery (>=2.0.0,<3.0.0)",
"invenio-config (>=1.0.3,<2.0.0)",
"invenio-i18n (>=3.0.0,<4.0.0)",
"invenio-db [postgresql] (>=2.0.0,<3.0.0)",
"invenio-app>=2.0.0,<3.0.0",
"invenio-base>=2.0.0,<3.0.0",
"invenio-cache>=2.0.0,<3.0.0",
"invenio-celery>=2.0.0,<3.0.0",
"invenio-config>=1.0.3,<2.0.0",
"invenio-i18n>=3.0.0,<4.0.0",
"invenio-db [postgresql] >=2.0.0,<3.0.0",
# Invenio base bundle
"invenio-assets (>=4.0.0,<5.0.0)",
"invenio-formatter (>=3.0.0,<4.0.0)",
"invenio-logging [sentry] (>=4.0.0,<5.0.0)",
"invenio-mail (>=2.0.0,<3.0.0)",
"invenio-rest (>=2.0.0,<3.0.0)",
"invenio-theme (>=4.0.0,<5.0.0)",
"invenio-admin>=1.5.2,<2.0.0",
"invenio-assets>=4.0.0,<5.0.0",
"invenio-formatter>=3.0.0,<4.0.0",
"invenio-logging [sentry] >=4.0.0,<5.0.0",
"invenio-mail >=2.0.0,<3.0.0",
"invenio-rest >=2.0.0,<3.0.0",
"invenio-theme >=4.0.0,<5.0.0",
# Invenio auth bundle
"invenio-access (>=4.0.0,<6.0.0)",
"invenio-accounts (>=6.0.0,<7.0.0)",
"invenio-oauth2server (>=3.0.0,<4.0.0)",
"invenio-oauthclient (>=5.0.0,<6.0.0)",
"invenio-userprofiles (>=4.0.0,<5.0.0)",
"invenio-access >=4.0.0,<6.0.0",
"invenio-accounts >=6.0.0,<7.0.0",
"invenio-oauth2server >=3.0.0,<4.0.0",
"invenio-oauthclient >=5.0.0,<6.0.0",
"invenio-userprofiles >=4.0.0,<5.0.0",
# Invenio metadata bundle
"invenio-indexer (>=3.0.0,<4.0.0)",
"invenio-jsonschemas (>=2.0.0,<3.0.0)",
"invenio-oaiserver (>=3.0.0,<4.0.0)",
"invenio-pidstore (>=2.0.0,<3.0.0)",
"invenio-records-rest (>=3.0.0,<4.0.0)",
"invenio-records-ui (>=1.2.0,<2.0.0)",
"invenio-records (>=3.0.0,<4.0.0)",
#invenio-search-ui (>=4.0.0,<5.0.0)",
"python-dotenv (>=0.13.0)",
"invenio-indexer >=3.0.0,<4.0.0",
"invenio-jsonschemas >=2.0.0,<3.0.0",
# "invenio-oaiserver >=3.0.0,<4.0.0",
"invenio-pidstore >=2.0.0,<3.0.0",
"invenio-records-rest >=3.0.0,<4.0.0",
"invenio-records-ui >=1.2.0,<2.0.0",
"invenio-records >=3.0.0,<4.0.0",
# invenio-search-ui >=4.0.0,<5.0.0",
"python-dotenv >=0.13.0",
## MEF specific python modules
"PyYAML (>=5.3.1)",
"ijson (>=2.5.1)",
"PyYAML >=5.3.1",
"ijson >=2.5.1",
"poethepoet",
# problem with marcxml `leader`
"pymarc (<5.2.0)",

"sqlitedict (==2.1.0)",
"sentry-sdk",
"rero-invenio-base (>=0.3.1)",
"setuptools",
"pymarc<5.2.0",
"sqlitedict>=2.1.0",
"sentry-sdk<2.0.0",
"rero-invenio-base>=0.3.1",
"dojson>=1.7.0",
"setuptools>=80.9.0",
"flask-admin<2.0.0"
]

[dependency-groups]
dev = [
"pytest-invenio (>=3.0.0,<4.0.0)",
"pip-audit (>=2.8.0,<3.0.0)",
"mock>=2.0.0",
"ruff>=0.12.3",
"ruff>=0.12.5"
]
prod = [
"uwsgi>=2.0",
"uwsgi-tools>=1.1.1",
"uwsgitop>=0.11"
]

[project.entry-points."app.console_scripts"]
Expand Down
19 changes: 1 addition & 18 deletions scripts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,4 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Poetry script utils."""

import os
import sys

# def __getattr__(name): # python 3.7+, otherwise define each script manually
# name = name.replace('_', '-')
# subprocess.run(
# ['python', '-u', '-m', name] + sys.argv[1:]
# ) # run whatever you like based on 'name'


def run(prg_name, *args): # python 3.7+, otherwise define each script manually
def fn():
# Replace current Python program by prg_name (same PID)
os.execvp(prg_name, [prg_name, *list(args), *sys.argv[1:]])

return fn
"""Script utils."""
23 changes: 7 additions & 16 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ set -e
# Displays program name
msg "PROGRAM: ${PROGRAM}"

if ! options=$(getopt -o dsb -l -t deploy,ci -- "$@")
if ! options=$(getopt -o ds -l -t deploy,ci -- "$@")
then
# something went wrong, getopt will put out an error message for us
exit 1
Expand Down Expand Up @@ -86,34 +86,25 @@ done

# uv is a mandatory condition to launch this program!
if [[ -z "${VIRTUAL_ENV}" ]]; then
error_msg+exit "Error - Launch this script via uv command:\n\uv run ${PROGRAM}"
error_msg+exit "Error - Launch this script via uv command:\n\tuv run ${PROGRAM}"
fi

if $deploy ; then
if ! $ci ; then
flags=("--no-dev")
flags=( "--no-group dev --group prod" )
fi
fi

if ! $deploy ; then
else
if $ci ; then
cmd="uv sync --upgrade"
fi
fi

uv --version

# BOOTSTRAP START
# install the application and all the dependencies
info_msg "Install with command: ${cmd} ${flags[@]}"
flag="${flags[@]}"
info_msg "Install with command: ${cmd} ${flag}"
${cmd} ${flags[@]}

# # install the app itself
# if ! $deploy ; then
# if $ci ; then
# poetry install
# fi
# fi

# build the web assets
info_msg "Build web assets: collect"
invenio collect -v
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def es(appctx):
def app_config(app_config):
"""Create temporary instance dir for each test."""
app_config["CELERY_BROKER_URL"] = "memory://"
app_config["RATELIMIT_STORAGE_URL"] = "memory://"
app_config["RATELIMIT_STORAGE_URI"] = "memory://"
app_config["CACHE_TYPE"] = "simple"
app_config["ACCOUNTS_SESSION_REDIS_URL"] = "redis://localhost:6379/1"
app_config["SEARCH_ELASTIC_HOSTS"] = None
Expand Down
Loading