the-library-code / dspace-rest-python

DSpace REST API Client Library
BSD 3-Clause "New" or "Revised" License
24 stars 19 forks source link

Missing dependency on pysolr #16

Closed alanorth closed 3 weeks ago

alanorth commented 1 month ago

The requirements.txt file lists pysolr as a dependency, but the setup.py does not, so it is missing when installing from pypi.org via pip etc.

kshepherd commented 3 weeks ago

Thanks @alanorth! I've added this, and also removed some unnecessary packages in requirements.txt. I have pushed this change directly to main and released 0.1.11 immediately.

(as an aside, this package shouldn't be needed for normal operation, but it does come in useful when you want to communicate directly with solr, which, while our modelling and operations are incomplete compared to the REST contract, can be a nice easy way to "just get stuff" and even do some Solr magic not normally supported in DSpace)

alanorth commented 3 weeks ago

Thanks @kshepherd. I was just beginning to use the library a few days ago and immediately upon importing DSpaceClient I had an error about missing pysolr:

$ python -c 'from dspace_rest_client.client import DSpaceClient'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/aorth/.local/share/virtualenvs/test-Ruq2lU0B/lib/python3.12/site-packages/dspace_rest_client/client.py", line 22, in <module>
    import pysolr
ModuleNotFoundError: No module named 'pysolr'

Thanks for fixing that. It's working now with having to manually install pysolr into my virtualenv.


BTW you might want to look into managing this library with rye. It will manage the dependencies via a PEP 621-style pyproject.toml—no need for the separate setup.py, and it will manage requirements.txt for you. It will even help you publish to pypi.org. I have not used it much yet, but I'm slowly converting some small projects.