ome / scc

OME tools for managing the Git(Hub) workflow
https://pypi.org/project/scc/
GNU General Public License v2.0
0 stars 15 forks source link

Fix rate limiting calls following upstream API breakage #239

Closed sbesson closed 5 years ago

sbesson commented 5 years ago

PyGithub 1.43 introduces a breaking change in the RateLimit API modifying both the internal representation as well as the methods of the Rate objects - see https://github.com/PyGithub/PyGithub/commit/fd8a036 and https://github.com/PyGithub/PyGithub/pull/902. This causes scc to crash when the latest version of PyGithub (currently 1.43.1) is installed.

Rather than capping PyGithub or forcing an upgrade, this PR adds backwards-compatible support for the new rate limit API with the following changes:

To test this PR: 1- create a new virtualenv, install requirements.txt and check that e.g. scc rate fails with a KeyError 2- with the same virtualenv, run /path/to/venv/python/scc/main.py rate from this branch and check the command returns the core, search and graphql rates 3- check the backwards compatibility by downgrading PyGithub (or creating a new virtualenv) and check that /path/to/venv/python/scc/main.py rate returns the core rate only

Proposed tag: 0.10.1

sbesson commented 5 years ago

https://ci.openmicroscopy.org/job/SCC-merge/989/ is green with this included. Barring concerns, I would propose to include this as well as #235 in a patch release of scc to fix compatibility with the latest PyGithub release.

joshmoore commented 5 years ago

Tested this in a few starfish contexts (with and without submodules). :+1: