-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-by: Johnny Mariéthoz <[email protected]>
- Loading branch information
0 parents
commit 8568ef8
Showing
54 changed files
with
7,690 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.git | ||
*.gitignore | ||
|
||
*.mo | ||
*.pyc | ||
*.swp | ||
*.swo | ||
*.~ | ||
|
||
.dockerignore | ||
Dockerfile | ||
docker-compose.yml | ||
docker-compose-dev.yml | ||
|
||
Procfile* |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# RERO-Invenio-Files | ||
# Copyright (C) 2024 RERO. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# 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/>. | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
# Python files | ||
[*.py] | ||
indent_size = 4 | ||
# isort plugin configuration | ||
known_first_party = rero_invenio_files | ||
multi_line_output = 2 | ||
default_section = THIRDPARTY | ||
skip = .eggs | ||
|
||
# RST files (used by sphinx) | ||
[*.rst] | ||
indent_size = 4 | ||
|
||
# CSS, HTML, JS, JSON, YML | ||
[*.{css,html,js,json,yml}] | ||
indent_size = 2 | ||
|
||
# Matches the exact files either package.json or .github/workflows/*.yml | ||
[{package.json,.github/workflows/*.yml}] | ||
indent_size = 2 | ||
|
||
# Dockerfile | ||
[Dockerfile] | ||
indent_size = 4 |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# RERO-Invenio-Files | ||
# Copyright (C) 2024 RERO. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# 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/>. | ||
|
||
|
||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build-n-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel babel | ||
- name: Build package | ||
run: | | ||
python setup.py compile_catalog sdist bdist_wheel | ||
- name: pypi-publish | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
|
||
password: ${{ secrets.pypi_token }} | ||
|
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# RERO-Invenio-Files | ||
# Copyright (C) 2024 RERO. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# 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/>. | ||
|
||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: main | ||
pull_request: | ||
branches: | ||
- main | ||
- "maint-**" | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: "0 3 * * 6" | ||
workflow_dispatch: | ||
inputs: | ||
reason: | ||
description: "Reason" | ||
required: false | ||
default: "Manual trigger" | ||
|
||
jobs: | ||
Tests: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
# TODO: You can add/remove combinations e.g. `dev` requirements or | ||
# `postgresql13` by adding a new item to the following lists. | ||
# You can see the complete list of services and versions that are available at: | ||
# https://docker-services-cli.readthedocs.io/en/latest/configuration.html | ||
python-version: ["3.9"] | ||
requirements-level: [pypi] | ||
db-service: [postgresql13] | ||
search-service: [opensearch1,opensearch2] | ||
include: | ||
- search-service: elasticsearch | ||
SEARCH_EXTRAS: "elasticsearch" | ||
|
||
# - search-service: opensearch2 | ||
# SEARCH_EXTRAS: "opensearch2" | ||
|
||
env: | ||
DB: ${{ matrix.db-service }} | ||
SEARCH: ${{ matrix.search-service }} | ||
# TODO: Adapt EXTRAS accordingly | ||
EXTRAS: tests,${{ matrix.search-service }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Generate dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools py wheel requirements-builder | ||
requirements-builder -e "$EXTRAS" --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt | ||
pip install ".[$EXTRAS]" | ||
pip freeze | ||
docker --version | ||
docker-compose --version | ||
- name: Run tests | ||
run: | | ||
./run-tests.sh |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# Idea software family | ||
.idea/ | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
Pipfile | ||
Pipfile.lock | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Vim swapfiles | ||
.*.sw? |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# RERO-Invenio-Files | ||
# Copyright (C) 2024 RERO. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# 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/>. | ||
|
||
# TODO: Transifex integration | ||
# | ||
# 1) Create message catalog: | ||
# $ python setup.py extract_messages | ||
# $ python setup.py init_catalog -l <lang> | ||
# $ python setup.py compile_catalog | ||
# 2) Ensure project has been created on Transifex under the inveniosoftware | ||
# organisation. | ||
# 3) Install the transifex-client | ||
# $ pip install transifex-client | ||
# 4) Push source (.pot) and translations (.po) to Transifex | ||
# $ tx push -s -t | ||
# 5) Pull translations for a single language from Transifex | ||
# $ tx pull -l <lang> | ||
# 6) Pull translations for all languages from Transifex | ||
# $ tx pull -a | ||
|
||
[main] | ||
host = https://www.transifex.com | ||
|
||
[invenio.rero-invenio-files-messages] | ||
file_filter = rero_invenio_files/translations/<lang>/LC_MESSAGES/messages.po | ||
source_file = rero_invenio_files/translations/messages.pot | ||
source_lang = en | ||
type = PO |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. | ||
RERO-Invenio-Files | ||
Copyright (C) 2024 RERO. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
|
||
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/>. | ||
|
||
Authors | ||
======= | ||
|
||
Files support for the RERO invenio instances. | ||
|
||
- RERO <[email protected]> |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.. | ||
RERO-Invenio-Files | ||
Copyright (C) 2024 RERO. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
|
||
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/>. | ||
|
||
Changes | ||
======= | ||
|
||
Version 0.1.0 (released TBD) | ||
|
||
- Initial public release. |
Oops, something went wrong.