Skip to content

Commit dc344c2

Browse files
Merge pull request #2 from the-library-code/main
merge 0.1.13
2 parents c888f2d + 7e1d7d1 commit dc344c2

File tree

12 files changed

+758
-425
lines changed

12 files changed

+758
-425
lines changed

.github/workflows/pylint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Pylint
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install -r requirements.txt
21+
pip install pylint
22+
- name: Analysing the code with pylint
23+
run: |
24+
pylint $(git ls-files '*.py') --ignore-paths=^tests/.*$ --output=lint_${{ matrix.python-version }}.txt || true
25+
- name: Upload Artifact
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: lint_${{ matrix.python-version }}.txt
29+
path: lint_${{ matrix.python-version }}.txt

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[MAIN]

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
### 0.1.13
4+
5+
Date: 2024-12-11
6+
7+
PyPI release page: https://pypi.org/project/dspace-rest-client/0.1.13/
8+
9+
**Changes**
10+
11+
1. Update requests and pysolr dependencies and improve setup.py (thanks @alanorth) https://github.com/the-library-code/dspace-rest-python/pull/24
12+
2. Add auto-paginating `get_*_iter` methods for most `get_*` methods (thanks @dpk) https://github.com/the-library-code/dspace-rest-python/pull/27
13+
3. Improve version number maintenance https://github.com/the-library-code/dspace-rest-python/pull/30
14+
4. New `create_item_version` method (thanks @soaringjupiter) https://github.com/the-library-code/dspace-rest-python/pull/31
15+
5. Allow `embed=['...', '...']` parameter in most methods that return objects, to allow embedded HAL resources https://github.com/the-library-code/dspace-rest-python/pull/20
16+
6. Extend `search_objects[_iter]` to accept a configuration parameter https://github.com/the-library-code/dspace-rest-python/pull/32
17+
7. Integrate pylint scaffolding (thanks @sszepe and @mdwRepository) https://github.com/the-library-code/dspace-rest-python/pull/37
18+
8. New `resolve_identifier_to_dso` method https://github.com/the-library-code/dspace-rest-python/pull/39
19+
9. Small pydoc improvements
20+
10. Added new example usage to `example.py`
21+
322
### 0.1.12
423

524
Date: 2024-08-06
@@ -10,6 +29,7 @@ PyPI release page: https://pypi.org/project/dspace-rest-client/0.1.12/
1029

1130
1. Initialise search result objects as `SimpleDSpaceObject` rather than base `DSpaceObject` class (thanks to @JemmaPilcher)
1231
2. Introduce / tidy new `SearchResult` model as work towards https://github.com/the-library-code/dspace-rest-python/issues/17
32+
3. Fix `get_items` method parameters (thanks @ckubgi) https://github.com/the-library-code/dspace-rest-python/pull/21
1333

1434
### 0.1.11
1535

console.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1+
import code
2+
import os
3+
import sys
4+
15
from dspace_rest_client.client import DSpaceClient
26
# Import models as needed
37
#from dspace_rest_client.models import Community, Collection, Item, Bundle, Bitstream
4-
import code
5-
import os
68

7-
# The DSpace client will look for the same environment variables, but we can also look for them here explicitly
8-
# and as an example
9-
url = 'http://localhost:8080/server/api'
10-
if 'DSPACE_API_ENDPOINT' in os.environ:
11-
url = os.environ['DSPACE_API_ENDPOINT']
12-
username = 'username@test.system.edu'
13-
if 'DSPACE_API_USERNAME' in os.environ:
14-
username = os.environ['DSPACE_API_USERNAME']
15-
password = 'password'
16-
if 'DSPACE_API_PASSWORD' in os.environ:
17-
password = os.environ['DSPACE_API_PASSWORD']
9+
DEFAULT_URL = 'http://localhost:8080/server/api'
10+
DEFAULT_USERNAME = 'username@test.system.edu'
11+
DEFAULT_PASSWORD = 'password'
12+
13+
# Configuration from environment variables
14+
URL = os.environ.get('DSPACE_API_ENDPOINT', DEFAULT_URL)
15+
USERNAME = os.environ.get('DSPACE_API_USERNAME', DEFAULT_USERNAME)
16+
PASSWORD = os.environ.get('DSPACE_API_PASSWORD', DEFAULT_PASSWORD)
1817

1918
# Instantiate DSpace client
20-
d = DSpaceClient(api_endpoint=url, username=username, password=password)
19+
d = DSpaceClient(api_endpoint=URL, username=USERNAME, password=PASSWORD)
2120

2221
# Authenticate against the DSpace client
2322
authenticated = d.authenticate()
2423
if not authenticated:
25-
print(f'Error logging in! Giving up.')
26-
exit(1)
24+
print('Error logging in! Giving up.')
25+
sys.exit(1)
2726

2827
code.interact(local=locals())

dspace_rest_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from . import *
2-
__version__ = '0.1.12'
2+
__version__ = '0.1.13'

0 commit comments

Comments
 (0)