Closed rshk closed 2 years ago
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
@jph00 please merge this ASAP. It's unusable for most cases without this simple fix.
If this fix is unacceptable, please consider moving os.getenv("GH_HOST")
out of global scope and into the body of the class so that callers can change the ENV VAR prior to instantiating GhApi
and connect to different servers. As it stands, the env var gets checked when the module is imported and can't be changed later (without a bunch of dynamic unloading and reimporting business.
Many thanks @rshk !
This allows users to create multiple instances of GhApi, eg to communicate to both github.com and a private GitHub Enterprise instance.
It also allows scripts to define a custom GitHub Enterprise host to be used, without requiring the user to remember to pass it explicitly in the environment.