As it stands now, 1.0 just has a few items left before it can ship.
I would love to have someone help getting 0.99 out the door. This release is as important as 1.0.
What is necessary for this release is for the following checklist to be applied to most of the breaking changes in 1.0:
Add back the definition for a method that has been removed
Add a deprecation warning
Ensure the definition, simply calls the method in 1.0
Add a unit test that checks for the calls.
Take for example, github3.iter_all_repos:
warnings.warn('iter_all_repos will be removed in v1.0. You can switch to using all_repositories now.',
A slightly more complex would be GitHub#iter_gists.
"Retrieving the a user's gists will be its own method in 1.0.""The new method is :func:`~GitHub.gists_by` and can be used immediately.",
"Retrieving the authenticated user's gists will be its own method in 1.0.""The new method is :func:`~GitHub.gists` and can be used immediately.",
"Retrieving the all public gists will be its own method in 1.0.""The new method is :func:`~GitHub.public_gists` and can be used immediately.",
Keep in mind these are just pseudo-examples. Because we will be using warnings.warn so much, a convenience/utility function such as issue_warning that might look like:
Finally, let's look at some example tests for this
"""Verify that iter_all_repos proxies to all_repositories."""withmock.patch('github3.api.all_repositories') asall_repositories:
"""Verify that iter_gists proxies to gists when authenticated."""self.gh.login(...)
withmock.patch.object(self.gh, 'gists') asgists:
"""Verify that iter_gists proxies to gists_by when given a username."""withmock.patch.object(self.gh, 'gists_by') asgists_by:
"""Verify that iter_gists proxies to public_gists without auth or username."""withmock.patch.object(self.gh, 'public_gists') aspublic_gists:
@sigmavirus24 you may be interested in stealing some code from Django: django/utils/deprecation.py contains a warn_about_renamed_method decorator that we've used in the past when we need to move methods around. It might make this sort of rearranging easier.