Skip to content

Finish initial typing of Index and Submodule #1285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 73 commits into from
Jul 11, 2021
Merged
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
16f0607
Improve typing of config_levels, add assert_never()
Yobmod Jul 5, 2021
9400246
Fix IndexFile forwardref
Yobmod Jul 5, 2021
e4caa80
put typing_extensions.get_types() behind python version guard
Yobmod Jul 5, 2021
0939e38
fix is_config_level for < 3.8
Yobmod Jul 5, 2021
0fc93b5
Rmv is_config_level() and get_args(), not worth the trouble
Yobmod Jul 5, 2021
53f1195
Add Literal_config_levels.__args__
Yobmod Jul 5, 2021
41e9781
Improve BlameEntry.commit typing
Yobmod Jul 5, 2021
23b5d6b
Add types to submodule.util.py
Yobmod Jul 5, 2021
c2317a7
Make bytesIO forwardref
Yobmod Jul 5, 2021
a935134
Add types to submodule.root.py
Yobmod Jul 5, 2021
3ce319f
Add types to submodule.update()
Yobmod Jul 6, 2021
6471018
Improve types of @unbare_repo and @git_working_dir decorators
Yobmod Jul 6, 2021
fb09bfa
Improve types of diff.py
Yobmod Jul 6, 2021
2a6a2e2
Improve types of diff.py
Yobmod Jul 6, 2021
3578355
Add cast(Repo, mrepo) in try block
Yobmod Jul 6, 2021
1bcccd5
Fix Literal Typeguards
Yobmod Jul 6, 2021
278a371
Fix for mrepo
Yobmod Jul 6, 2021
deafa6a
Fix for mrepo2
Yobmod Jul 6, 2021
e6f340c
Rmv runtime_checkable < py3.8
Yobmod Jul 6, 2021
ed58e2f
Rmv runtime_checkable < py3.8 pt2
Yobmod Jul 6, 2021
eecf148
Rmv root.py types
Yobmod Jul 6, 2021
a857b97
Merge branch 'gitpython-developers:main' into main
Yobmod Jul 6, 2021
b78cca1
Rmv base.py types
Yobmod Jul 6, 2021
8ef1adb
Merge branch 'main' of https://github.com/Yobmod/gitpython
Yobmod Jul 6, 2021
6aebb73
Rmv submodule types
Yobmod Jul 6, 2021
c0ab23e
Rmv submodule types2
Yobmod Jul 6, 2021
8d2a770
Rmv diff typeguard
Yobmod Jul 6, 2021
1fd9e8c
Re-add submodule.util.py types
Yobmod Jul 6, 2021
1eceb89
Fix submodule.util.py types
Yobmod Jul 6, 2021
215abfd
Readd typeguard to Diff.py
Yobmod Jul 6, 2021
94c2ae4
Readd submodule.base.py types
Yobmod Jul 6, 2021
06eca0b
Make subodule a forward ref in Index.base
Yobmod Jul 6, 2021
33ffd0b
Make subodule a forward ref in Index.base2
Yobmod Jul 6, 2021
af7cee5
Make Repo a forward ref in Submodule.base
Yobmod Jul 6, 2021
f372187
Make subodule a forward ref in Index.base3
Yobmod Jul 6, 2021
de36cb6
UnMake subodule a forward ref in Index.base
Yobmod Jul 6, 2021
3cc0edc
UnMake subodule a forward ref in Index.base2
Yobmod Jul 6, 2021
28bde39
Type index _items_to_rela_paths()
Yobmod Jul 6, 2021
1d0e666
Check change_levels (should fail)
Yobmod Jul 6, 2021
e985851
Add 'U' to change_levels (should pass)
Yobmod Jul 6, 2021
873ebe6
Make diff.DiffIndex generic List['Diff']
Yobmod Jul 6, 2021
2e2fe18
Increase mypy strictness (no_implicit_optional & warn_redundant_casts…
Yobmod Jul 8, 2021
5d3818e
Finish initial typing of index folder
Yobmod Jul 8, 2021
9f88796
Mak GitCmdObjectDB a froward ref
Yobmod Jul 8, 2021
1533596
Mak EntryTup a froward ref
Yobmod Jul 8, 2021
4333dcb
Mmmmm
Yobmod Jul 8, 2021
fe5fef9
Mmmmmm
Yobmod Jul 8, 2021
d344abf
Fix traverse_trees_recursive()
Yobmod Jul 8, 2021
dfbc0f4
Fix traverse_trees_recursive() again
Yobmod Jul 8, 2021
c27d2b0
Use Tuple not tuple
Yobmod Jul 8, 2021
4f13b4e
fix base,ours,theirs typing
Yobmod Jul 8, 2021
627deff
Change List to MutableSequence in fun.py _find_by_name()
Yobmod Jul 8, 2021
f271c58
tests TraversableIterableObj typeguard
Yobmod Jul 8, 2021
4802a36
improve TraversableIterableObj typeguard
Yobmod Jul 8, 2021
1faa25f
Rmv typeguard from list_traverse(), was wrong
Yobmod Jul 8, 2021
f4cb7db
Change type of list_traverse() again.
Yobmod Jul 9, 2021
030b1fd
Add list_traverse() to Tree and TraversableIterableObj.
Yobmod Jul 9, 2021
3710e24
Rmv circular import, create Has_id_attribute Protocol instead
Yobmod Jul 9, 2021
5eea891
Fix list_traverse() docstring for Autodoc
Yobmod Jul 9, 2021
9377462
Make has_repo protocol runtime checkable and use in Diffable
Yobmod Jul 9, 2021
3c6deb0
Flatten list_traverse()
Yobmod Jul 9, 2021
a024bdd
Move TraverseNT to global, cos mypy complained on testing
Yobmod Jul 9, 2021
6271660
Rmv submodule.base Repo assert
Yobmod Jul 9, 2021
7c6ae2b
Try to distinguation git.diff module from diff.Diff.diff and diff.Daf…
Yobmod Jul 9, 2021
f916c14
Improve Diffable method typing
Yobmod Jul 9, 2021
e7b685d
Rmv Diffable assert, add Remoote.url property
Yobmod Jul 9, 2021
9bb630f
Add remote.url type
Yobmod Jul 9, 2021
b03af05
Remove defsult_index decorator from diff() and do check within functi…
Yobmod Jul 9, 2021
797e962
Make IndexFile and Diffable .diff() types agree
Yobmod Jul 9, 2021
09053c5
Improve IndexFile_process_diff_args() to get checks to rerun
Yobmod Jul 9, 2021
2ea528e
Fix typing of index.fun.write_tree_from_cache()
Yobmod Jul 9, 2021
e6a27ad
Use TreeCacheTup type alias throughout
Yobmod Jul 9, 2021
94c6652
Make TreeCacheTup forward ref
Yobmod Jul 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Tuple not tuple
  • Loading branch information
Yobmod committed Jul 8, 2021
commit c27d2b078b515a8321b3f7f7abdcea363d8049df
5 changes: 3 additions & 2 deletions git/objects/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _to_full_path(item: EntryTupOrNone, path_prefix: str) -> EntryTupOrNone:


def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[bytes, None]],
path_prefix: str) -> List[tuple[EntryTupOrNone, ...]]:
path_prefix: str) -> List[Tuple[EntryTupOrNone, ...]]:
"""
:return: list of list with entries according to the given binary tree-shas.
The result is encoded in a list
Expand All @@ -165,7 +165,8 @@ def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[by
if tree_sha is None:
data: List[EntryTupOrNone] = []
else:
data = list(tree_entries_from_data(odb.stream(tree_sha).read())) # make new list for typing as invariant
# make new list for typing as list invariant
data = [x for x in tree_entries_from_data(odb.stream(tree_sha).read())]
# END handle muted trees
trees_data.append(data)
# END for each sha to get data for
Expand Down