api icon indicating copy to clipboard operation
api copied to clipboard

`MPRester` lazily get `endpoint` and `api_key`

Open DanielYang59 opened this issue 1 year ago • 1 comments

Summary

  • Lazily get endpoint and api_key, to close #935
  • [x] Add more unit tests

DanielYang59 avatar Sep 28 '24 02:09 DanielYang59

@tschaume This one is ready for review, thanks!

Also try to ping @janosh if you are interested in commenting :)

DanielYang59 avatar Sep 29 '24 07:09 DanielYang59

The test failure is owing to restricted access to repo secret from a fork:

With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.

And is passing locally:

=================================================== test session starts ====================================================
platform darwin -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/yang/developer/api
configfile: pyproject.toml
plugins: typeguard-4.3.0
collected 31 items                                                                                                         

tests/test_client.py ...............................                                                                 [100%]

DanielYang59 avatar Oct 02 '24 02:10 DanielYang59

@DanielYang59 release candidate is out for this 🎉 See https://pypi.org/project/mp-api/0.43.0rc0/

tschaume avatar Oct 03 '24 21:10 tschaume

Great! Thanks a lot for reviewing!

DanielYang59 avatar Oct 04 '24 02:10 DanielYang59