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: redirect.github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:7fbdf7e2-882e-0782-5eb7-ac2a5537a236 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BC58:3383CF:26AD300:3582929:69729CEB |
| html-safe-nonce | 86ef10a51c54937376b06dce3cea81f8a2ea71860adc9be3bca34c0da029eb72 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQzU4OjMzODNDRjoyNkFEMzAwOjM1ODI5Mjk6Njk3MjlDRUIiLCJ2aXNpdG9yX2lkIjoiNzYyNDQ1MTQzNjI1OTIyMDcxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1a03fc89e7dc0a149d0fa9d5572dee1e684b09e25e963652715c526527dbc17c |
| 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 | 72bb1c46bb1ebdc0dc83a0a57b64c3b4d668c125d1125d94898213a4c9db8da2 |
| 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 | e746f1a3ddb5c0a91290ff3d5889b5247e0e519e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width