| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cdf3cff commit 75ceb38
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,8 +55,9 @@ API changes | |||
| 55 | 55 | restoring Kas's Git identity cleanup. Git performs each mutation and locks | |
| 56 | 56 | it independently; replacement is not one atomic transaction. Empty sections | |
| 57 | 57 | and ``add_section()`` remain unsupported, including Kas's SSH key setup. | |
| 58 | - * Explicit ``from git import Union`` imports remain available for Demisto SDK's | ||
| 59 | - validator registration, retaining the historical ``typing.Union`` alias. | ||
| 58 | + * Explicit ``from git import Union`` and ``Optional`` imports remain available | ||
| 59 | + for Demisto SDK's validator registration and MkDocs RSS Plugin imports, | ||
| 60 | + retaining the historical ``typing`` aliases. | ||
| 60 | 61 | * Editable/source imports expose the release version in ``git.__version__``, | |
| 61 | 62 | matching built distributions. Salt's GitPython provider checks can parse the | |
| 62 | 63 | version instead of rejecting the unstamped ``"git"`` build placeholder. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,7 +87,7 @@ | |||
| 87 | 87 | ||
| 88 | 88 | __version__ = (_Path(__file__).resolve().parents[1] / "VERSION").read_text(encoding="utf-8").strip() | |
| 89 | 89 | ||
| 90 | - from typing import Optional as _Optional | ||
| 90 | + from typing import Optional as Optional # Compatibility for downstream explicit imports. | ||
| 91 | 91 | from typing import Union as Union # Compatibility for downstream explicit imports. | |
| 92 | 92 | ||
| 93 | 93 | from git.util import to_hex_sha | |
@@ -182,7 +182,7 @@ | |||
| 182 | 182 | GIT_OK = None | |
| 183 | 183 | ||
| 184 | 184 | ||
| 185 | - def refresh(path: _Optional[PathLike] = None) -> None: | ||
| 185 | + def refresh(path: Optional[PathLike] = None) -> None: | ||
| 186 | 186 | """Convenience method for setting the git executable path. | |
| 187 | 187 | ||
| 188 | 188 | :param path: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | """Public GitPython queries used by released downstream projects.""" | |
| 2 | 2 | ||
| 3 | 3 | from pathlib import Path | |
| 4 | - from typing import Union | ||
| 4 | + from typing import Optional, Union | ||
| 5 | 5 | from importlib.metadata import version | |
| 6 | 6 | ||
| 7 | 7 | import pytest | |
@@ -22,6 +22,12 @@ def test_legacy_typing_union_import_supports_downstream_registration(): | |||
| 22 | 22 | assert GitUnion is Union | |
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | + def test_legacy_typing_optional_import_supports_downstream_plugin_import(): | ||
| 26 | + from git import Optional as GitOptional | ||
| 27 | + | ||
| 28 | + assert GitOptional is Optional | ||
| 29 | + | ||
| 30 | + | ||
| 25 | 31 | @pytest.mark.parametrize("object_format", ["sha1", "sha256"]) | |
| 26 | 32 | @pytest.mark.parametrize("ref_format", ["files", "reftable"]) | |
| 27 | 33 | def test_config_section_assignment_restores_downstream_git_identity(object_format, ref_format): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments