Skip to content

Commit

Permalink
make compatible with InvenioRDM v12
Browse files Browse the repository at this point in the history
  • Loading branch information
fenekku committed Aug 12, 2024
1 parent c0a2374 commit 18aa267
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build-n-publish:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
Expand All @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install build dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ on:

jobs:
Tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.11", "3.12"]
requirements-level: [pypi]

steps:
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ Alternatively, or if you want to update your already loaded subjects to a new li
```bash
# In your instance's project
# Download up-to-date listings
pipenv run invenio galter_subjects lcsh download -d /path/to/downloads/storage/
# Generate file containg deltas to transition your instance to the downloaded listing
pipenv run invenio galter_subjects lcsh deltas -d /path/to/downloads/storage/ -o /path/to/deltas_lcsh.csv
invenio galter_subjects lcsh download -d /path/to/downloads/storage/
# Generate deprecated entries - metadata expert COULD look at them
invenio galter_subjects lcsh deprecated -d /path/to/downloads/storage/
# Generate replacement entries from those - metadata expert COULD look at them
invenio galter_subjects lcsh replacements /path/to/downloads/storage/replacements.csv
# Generate file containing deltas to transition your instance to the downloaded listing - metadata expert SHOULD look at them
invenio galter_subjects lcsh deltas -d /path/to/downloads/storage/ -o /path/to/deltas_lcsh.csv
# Update your instance - *this operation will modify your instance*
pipenv run invenio galter_subjects update /path/to/deltas_lcsh.csv
invenio galter_subjects update /path/to/deltas_lcsh.csv
```

Look at the help text for these commands to see additional options that can be passed.
Expand All @@ -59,20 +63,18 @@ When a new list of LCSH terms comes out, this package should be updated to provi

**Pre-requisite/Context**

Maintaining the vocabulary file doesn't apriori need any Inveniordm functionality, but updating an instance does and
as such this project depends on `invenio-app-rdm`. In turn, because of the plugin system of InvenioRDM, this dependency requires
`invenio-search[X]` (where X is `elasticsearch7` or `opensearch1` or `opensearch2`) to be installed. It has to be installed separately because this project makes no assumption about the document engine used by the instance. So, even for maintainers of this project, `invenio-search` with an appropriate extra (we choose `elasticsearch2` but it is inconsequential) needs to be installed separately to update the vocabulary file.
[Install the distribution package for development](#development) before you do anything.

**Commands**

Once you have that dependency installed, you can run the following commands:
Once you have that dependency installed, you can run the following commands (`(venv)` denotes the isolated environment):

```bash
# In this project
# Download up-to-date listings
pipenv run invenio galter_subjects lcsh download -d /path/to/downloads/storage/
(venv) invenio galter_subjects lcsh download -d /path/to/downloads/storage/
# Generate file containing initial listing
pipenv run invenio galter_subjects lcsh file -d /path/to/downloads/storage/ -o invenio_subjects_lcsh/vocabularies/subjects_lcsh.csv
(venv) invenio galter_subjects lcsh file -d /path/to/downloads/storage/ -o invenio_subjects_lcsh/vocabularies/subjects_lcsh.csv
```

When you are happy with the list, bump the version in `pyproject.toml` and release it.
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
dependencies = [
"galter-subjects-utils>=0.4.1,<2.0",
"galter-subjects-utils>=0.4.2,<2.0",
]
description = "LCSH subject terms for InvenioRDM"
keywords = ["invenio", "inveniordm", "subjects", "LCSH"]
license = {file = "LICENSE"}
name = "invenio-subjects-lcsh"
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
urls = {Repository = "https://github.com/galterlibrary/invenio-subjects-lcsh"}
version = "2024.1.0"

[project.optional-dependencies]
dev = [
"check-manifest>=0.49",
"invenio-search[opensearch2]>=2.1.0,<3.0", # Needs to be specified separately as it's normally up to the instance
"invoke>=2.2,<3.0",
"pyyaml>=5.4.1",
"pytest-invenio>=2.1.1,<3.0.0",
Expand All @@ -58,6 +59,7 @@ ignore = [

[tool.pytest.ini_options]
minversion = "6.0"
# ATTN: Remove the cov options when using breakpoint() since it interferes
addopts = '--isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_subjects_lcsh --cov-report=term-missing'
testpaths = ["tests", "invenio_subjects_lcsh"]

Expand Down

0 comments on commit 18aa267

Please sign in to comment.