Conversation
awilfox
left a comment
There was a problem hiding this comment.
Few small nits, but overall good so far.
|
|
||
| ### Changed | ||
| - N/A | ||
| - updates to workflow actions and pyproject.toml |
There was a problem hiding this comment.
Is this truly a change if there hasn't been a release yet?
There was a problem hiding this comment.
Yeah, good point. I'll move any changes up to the added category before marking ready for review.
|
I've updated the TODO list at the top of the PR. Only remaining tasks for this ticket are:
|
awilfox
left a comment
There was a problem hiding this comment.
Looking much nicer and cleaner now, I like where this is heading. 👍🏻
| api_key: str = os.environ.get("TIND_API_KEY", ""), | ||
| api_url: str = os.environ.get("TIND_API_URL", ""), |
There was a problem hiding this comment.
It's not a good idea to specify the value like this here, because that means any changes to the environment after the code is loaded won't be reflected. For instance, if code loads environment variables from Docker Secrets or an .env file.
>>> import os
>>> def test(foo: str = os.environ.get("LANG", "")):
... print(foo)
...
>>> test()
en_US.UTF-8
>>> os.environ['LANG']
'en_US.UTF-8'
>>> os.environ['LANG'] = 'en_GB.UTF-8'
>>> os.environ['LANG']
'en_GB.UTF-8'
>>> test()
en_US.UTF-8Better to do:
api_key: str = ''
and then in the method body:
self.api_key = api_key or os.environ.get(...)
| - `api_key` (optional): Your TIND API token. Falls back to the `TIND_API_KEY` environment variable. | ||
| - `api_url` (optional): Base URL of the TIND instance (e.g. `https://tind.example.edu`). Falls back to the `TIND_API_URL` environment variable. |
There was a problem hiding this comment.
This is good, but just to be really clear, it might be nice to have an environment variables subsection like we do in the Willa readme for easy reference.
I'll use this PR to address comments and suggestions from the Jira ticket.
comments & suggestions to address:
uvfor actions and readme? (Yes! ✅ )., not justtind_client..is a bit too broad because of hidden files/dirstind_client&tests? ( implemented ❓ )TIND s/ILS/DA/g (TODO)Done! ✅TODO: make direct functions private and DRYer (remove repetitive auth params)DONE! ✅TODO: investigate/removeThis is a python keyword separator. basically, anything after the*must include the key and not rely on position. I removed all but one of these. as it makes sense to use it in the_search_requestfor pagination.