Skip to content
Open
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
35 changes: 32 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# Matches the DSpace-ISstag-integration consumer CI matrix; the library
# itself declares support for >=3.8 (see setup.py).
# Matches the DSpace-ISstag-integration consumer CI matrix.
python-version: ["3.10", "3.12"]

steps:
Expand All @@ -27,7 +26,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
setup.py
pyproject.toml
requirements-test.txt

- name: Install package + test deps
Expand All @@ -38,3 +37,33 @@ jobs:

- name: Run tests
run: python -m pytest tests/ -v

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Ruff
run: uvx ruff@0.12.7 check dspace_rest_client tests

- name: Pylint
run: >-
uvx --with requests --with pysolr pylint@3.3.7
--rcfile=pyproject.toml dspace_rest_client

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Mypy
# Non-blocking: strict typing is being introduced incrementally, so a
# mypy failure is reported but does not fail the (green) job.
continue-on-error: true
run: uvx --with requests --with pysolr mypy dspace_rest_client
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Pre-commit hooks for local development. Mirrors the consumer repo
# (DSpace-ISstag-integration) so both repositories share one standard.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-json
- id: mixed-line-ending
args: ['--fix=lf']
- id: check-added-large-files
- repo: https://github.com/hhatto/autopep8
rev: v2.3.2
hooks:
- id: autopep8
args: ['-i', '--max-line-length=90', '--ignore=E402']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.7
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pylint-dev/pylint
rev: v3.3.7
hooks:
- id: pylint
exclude: ^tests/
args: ['-rn', '-sn', '--rcfile=pyproject.toml']
additional_dependencies: [requests, pysolr]
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Help with extending the scope and improving the code is always welcome!
PyPI homepage: https://pypi.org/project/dspace-rest-client/

## Requirements
* Python 3.x (developed using Python 3.8.5)
* Python Requests module (see `requirements.txt`)
* Python 3.10+
* Python Requests module (installed automatically; declared in `pyproject.toml`)
* Working DSpace 7 repository with an accessible REST API

## Installation
Expand All @@ -20,10 +20,11 @@ To install with pip:

(or `pip3` or `python -m pip` as appropriate to your environment)

To install manually, clone this repository and install the requirements:
To install manually, clone this repository and install the package:
```commandline
git clone https://github.com/the-library-code/dspace-rest-python.git
pip install -r requirements.txt
cd dspace-rest-python
pip install .
```


Expand Down
48 changes: 47 additions & 1 deletion dspace_rest_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
from . import *
"""DSpace 7 REST API client."""

from .client import DSpaceClient
from .models import (
HALResource,
AddressableHALResource,
ExternalDataObject,
DSpaceObject,
SimpleDSpaceObject,
Item,
Community,
Collection,
Bundle,
Bitstream,
Group,
User,
InProgressSubmission,
WorkspaceItem,
EntityType,
RelationshipType,
License,
Label,
ResourcePolicy,
)

__all__ = [
"DSpaceClient",
"HALResource",
"AddressableHALResource",
"ExternalDataObject",
"DSpaceObject",
"SimpleDSpaceObject",
"Item",
"Community",
"Collection",
"Bundle",
"Bitstream",
"Group",
"User",
"InProgressSubmission",
"WorkspaceItem",
"EntityType",
"RelationshipType",
"License",
"Label",
"ResourcePolicy",
]
Loading
Loading