You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix git.objects.__all__ and make submodules explicit
The submodules being made explicit here are of course Python
submodules, not git submodules.
The git.objects.submodule Python submodule (which is *about* git
submodules) is made explicit here (as are the names imported from
that Python submodule's own Python submodules) along with the other
Python submodules of git.objects.
Unlike some other submodules, but like the top-level git module
until #1659, git.objects already defined __all__ but it was
dynamically constructed. As with git.__all__ previously (as noted
in #1859), I have used https://github.com/EliahKagan/deltall here
to check that it is safe, sufficient, and probably necessary to
replace this dynamically constructed __all__ with a literal list of
strings in which all of the original elements are included. See:
https://gist.github.com/EliahKagan/e627603717ca5f9cafaf8de9d9f27ad7
Running the modattrs.py script, and diffing against the output from
before the current import refactoring began, reveals two changes to
module contents as a result of the change here:
- git.objects no longer contains `inspect`, which it imported just
to build the dynamically constructed __all__. Because this was
not itself included in that __all__ or otherwise made public or
used out of git.objects, that is okay. This is exactly analogous
to the situation in 8197e90, which removed it from the top-level
git module after #1659.
- The top-level git module now has has new attributes blob, commit,
submodule, and tree, aliasing the corresponding modules. This
has happened as a result of them being put in git.objects.__all__
along with various names imported from them. (As noted in some
prior commits, there are tradeoffs associated with doing this,
and it may be that such elements of __all__ should be removed,
here and elsewhere.)
0 commit comments