GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add types to refs by Yobmod · Pull Request #1295 · gitpython-developers/GitPython

Conversation

@Yobmod

@Yobmod Yobmod commented Jul 19, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Adding types to refs module, and backtracking to make sure they agree with previous types.

I also changed the hard-coding of Traversable.list_traverse(on_edge= True) that I put in last time to be a check for it in kwargs. At the moment all it does is raise an additional deprecation warning if anyone tried to use on_edge= True - I don't think anyone would be, but better than breaking it without warning.
Also made Traversable, Serilizable and IterableObj into Protocols (typings version of abstract base classes) - shouldnt have any effect on users unless they are doing something wierd.

Added flake8-bugbear and flake8-comprehensions and fixed the (minor) complaints they had.

Removed some checks for python 3.5 in tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Yobmod added 22 commits July 19, 2021 16:50
@Yobmod
update types in types.py
2fa9fb1
@Yobmod
Add types to refs/tag.py
cc63210
@Yobmod
Add types to refs/symbolic.py
8dd3d0d
@Yobmod
Add types to refs/remote.py
4b9ca92
@Yobmod
Add types to refs/reference.py
1dd4596
@Yobmod
Add types to refs/log.py
ae13c6d
@Yobmod
Add types to refs/head.py
8fc25c6
@Yobmod
Make types in refs compatible with previous
ac39679
@Yobmod
Make types in refs compatible with repo
44f0578
@Yobmod
Make traversable and serilizable into protocols
29e12e9
@Yobmod
Make types in refs compatible with objects
6609ef7
@Yobmod
rmv python 3.5 checks from tests
4545762
@Yobmod
rmv redundant IOerror except
795d2b1
@Yobmod
Add flake8-bugbear and -comprehensions to test-requirements.txt
9a587e1
@Yobmod
Update README.md
f0bc672
tidy up testing section
@Yobmod
Update README.md
23066f6
Add paragraph space
@Yobmod
Change remaining type comments to py3.6+ types
9e5e969
@Yobmod
Merge branch 'main' of https://github.com/Yobmod/GitPython
e666e3b
@Yobmod
update types in types.py
dcfedb2
@Yobmod
Make pathlike a forward ref
8900f2a
@Yobmod
Add a cast to git.cmd _version_info
017b0d4
@Yobmod
Rmv old py2.7 __future__ imports
600df04
@Byron
Byron merged commit cfd653a into gitpython-developers:main Jul 19, 2021
@Byron

Byron commented Jul 19, 2021

Copy link
Copy Markdown
Member

Tremendous work, thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Byron Byron added this to the v3.1.19 - Bugfixes milestone Jul 23, 2021
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull request Nov 4, 2023
@EliahKagan
Deprecate compat.is_<platform>, rewriting all uses
c01fe76
Major changes:

- Add a comment in the git.compat module above the definitions of
  is_win, is_posix, and is_darwin stating that they are deprecated
  and recommending that os.name (or, where applicable,
  sys.platform) be used directly instead for clarity (and sometimes
  accuracy).

- Remove all uses of is_win and is_posix in git/ and test/,
  replacing them with `os.name == "nt"` and `os.name == "posix"`,
  respectively.

There were no uses of is_darwin to be replaced. Although it had
been used at one time, the last reference to it appears to have
been removed in 4545762 (gitpython-developers#1295).

This doesn't emit a DeprecationWarning when those attributes are
accessed in the git.compat module. (That might be valuable thing to
do in the future, if the git.compat module is to remain
non-deprecated overall.)

Two related less consequential changes are also included:

- Improve ordering and grouping of imports, in modules where they
  were already being changed as a result of no longer needing to
  import is_<platform> (usually is_win) from git.compat.

- Make minor revisions to a few comments, for readability. (This is
  in addition to somewhat more substantial revisions of comments
  where rewording was related to replacing uses of is_<platform>.)
This was referenced Nov 4, 2023
is_darwin is always False (os.name is never "darwin") #1731
Closed
Deprecate compat.is_<platform>, rewriting all uses #1732
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

v3.1.19 - Bugfixes

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Yobmod @Byron
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.