Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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]
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.md
include dspace_rest_client/py.typed
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