| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1074925 commit 1d10bdc
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,6 +51,8 @@ Git executable and safety | |||
| 51 | 51 | API changes | |
| 52 | 52 | ----------- | |
| 53 | 53 | ||
| 54 | + * Explicit ``from git import Union`` imports remain available for Demisto SDK's | ||
| 55 | + validator registration, retaining the historical ``typing.Union`` alias. | ||
| 54 | 56 | * Editable/source imports expose the release version in ``git.__version__``, | |
| 55 | 57 | matching built distributions. Salt's GitPython provider checks can parse the | |
| 56 | 58 | version instead of rejecting the unstamped ``"git"`` build placeholder. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,6 +88,7 @@ | |||
| 88 | 88 | __version__ = (_Path(__file__).resolve().parents[1] / "VERSION").read_text(encoding="utf-8").strip() | |
| 89 | 89 | ||
| 90 | 90 | from typing import Optional as _Optional | |
| 91 | + from typing import Union as Union # Compatibility for downstream explicit imports. | ||
| 91 | 92 | ||
| 92 | 93 | from git.util import to_hex_sha | |
| 93 | 94 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +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 | 5 | from importlib.metadata import version | |
| 5 | 6 | ||
| 6 | 7 | import pytest | |
@@ -15,6 +16,12 @@ def test_public_version_supports_downstream_provider_checks(): | |||
| 15 | 16 | assert git.__version__ == version("GitPython") | |
| 16 | 17 | ||
| 17 | 18 | ||
| 19 | + def test_legacy_typing_union_import_supports_downstream_registration(): | ||
| 20 | + from git import Union as GitUnion | ||
| 21 | + | ||
| 22 | + assert GitUnion is Union | ||
| 23 | + | ||
| 24 | + | ||
| 18 | 25 | @pytest.mark.parametrize("object_format", ["sha1", "sha256"]) | |
| 19 | 26 | @pytest.mark.parametrize("ref_format", ["files", "reftable"]) | |
| 20 | 27 | def test_repo_accepts_explicit_literal_path_selection(object_format, ref_format, monkeypatch): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments