Skip to content

Code review

Very good stuff, I've got only minor comments. Shouldn't this package be called igwn-requests, btw ? (even if it lands for now in ligo namespace)

ligo/requests/__init__.py

  • docstring for class Session

ligo/requests/cert_reload.py

  • load_certificate -> _load_certificate. Otherwise, the name should make explicit the fact that it only loads pem x509 certificates.
  • docstrings for the classes
  • in CertReloadingHTTPSConnection and CertReloadingHTTPAdapter, the keyed argument cert_reload_timeout has not the same type. I suggest numeric for all.

ligo/requests/errors.py and ligo/requests/user_agent.py SessionErrorMixin.__init__, SessionUserAgentMixin.__init__: no need for *args

ligo/requests/auth.py

  • Some refactoring (unnecessary variable result):
def find_username_password(url):
    host = urlparse(url).hostname
    try:
        username, _, password = netrc().authenticators(host)
    except IOError:
        username = password = None
    return username, password
  • In SessionAuthMixin.__doc__: typo cert_cert_reload_timeout

  • In SessionAuthMixin.__init__::140 these calls:

    default_cert = find_x509_credentials()
    default_username, default_password = find_username_password(url)

should be deferred until they are actually needed, since they are doing some I/O operations.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information