Title: Deprecate compat.is_
Open Graph Title: Deprecate compat.is_
X Title: Deprecate compat.is_
Description: Fixes #1731
Major changes:
Remove all uses of is_win and is_posix in git/ and test/, replacing them with os.name == "nt" and os.name == "posix", respectively.
Fix is_darwin by changing it to use sys.platform instead of os.name which is never "darwin".
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).
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 (#1295).
This doesn't emit a DeprecationWarning when those attributes are accessed from 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. See discussion in #1731.)
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_
Open Graph Description: Fixes #1731 Major changes: Remove all uses of is_win and is_posix in git/ and test/, replacing them with os.name == "nt" and os.name == "posix", respectively. Fix is_darwin by ...
X Description: Fixes #1731 Major changes: Remove all uses of is_win and is_posix in git/ and test/, replacing them with os.name == "nt" and os.name == "posix", respectively. F...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1732
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:22f656f1-b37e-cb7b-4f8b-ce0e5bf36c1c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9696:29543D:36F3AD7:379762B:69685010 |
| html-safe-nonce | b9dec1638cea9c6c3adf62e7e78822dffeed9ae9f2ce3437f5863c4bb6fb0f60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Njk2OjI5NTQzRDozNkYzQUQ3OjM3OTc2MkI6Njk2ODUwMTAiLCJ2aXNpdG9yX2lkIjoiODA3NDc5NjQyMjQ0NDYzNDEyOCIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 264f52621fea42f173bdb9a974289eb3dd35bc71950e8c6661ea3327eb01a3a5 |
| hovercard-subject-tag | pull_request:1587206693 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/1732/files |
| twitter:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| og:image:alt | Fixes #1731 Major changes: Remove all uses of is_win and is_posix in git/ and test/, replacing them with os.name == "nt" and os.name == "posix", respectively. Fix is_darwin by ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f16c57f41ed243e5b4dfe9b9bcd6828bd83080b1b6dbb4ff239bbe9745f12e0c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cfa7062cc6d4fe8fcb156bd33f4c97bd3b2470af |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width