| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 15f7696 commit 1074925
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,6 +51,9 @@ Git executable and safety | |||
| 51 | 51 | API changes | |
| 52 | 52 | ----------- | |
| 53 | 53 | ||
| 54 | + * Editable/source imports expose the release version in ``git.__version__``, | ||
| 55 | + matching built distributions. Salt's GitPython provider checks can parse the | ||
| 56 | + version instead of rejecting the unstamped ``"git"`` build placeholder. | ||
| 54 | 57 | * ``Repo`` construction validates repository configuration through Git/Gix. | |
| 55 | 58 | A subclass override of ``config_reader()`` no longer controls discovery or | |
| 56 | 59 | suppresses its include graph. Malformed configuration and invalid repository | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,6 +81,11 @@ | |||
| 81 | 81 | ] | |
| 82 | 82 | ||
| 83 | 83 | __version__ = "git" | |
| 84 | + if __version__ == "git": | ||
| 85 | + # Wheels and source distributions stamp this value; editable imports do not. | ||
| 86 | + from pathlib import Path as _Path | ||
| 87 | + | ||
| 88 | + __version__ = (_Path(__file__).resolve().parents[1] / "VERSION").read_text(encoding="utf-8").strip() | ||
| 84 | 89 | ||
| 85 | 90 | from typing import Optional as _Optional | |
| 86 | 91 | ||
| 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 importlib.metadata import version | ||
| 4 | 5 | ||
| 5 | 6 | import pytest | |
| 6 | 7 | ||
@@ -10,6 +11,10 @@ | |||
| 10 | 11 | from test.lib.fixtures import fixture_repo, read_only_fixture | |
| 11 | 12 | ||
| 12 | 13 | ||
| 14 | + def test_public_version_supports_downstream_provider_checks(): | ||
| 15 | + assert git.__version__ == version("GitPython") | ||
| 16 | + | ||
| 17 | + | ||
| 13 | 18 | @pytest.mark.parametrize("object_format", ["sha1", "sha256"]) | |
| 14 | 19 | @pytest.mark.parametrize("ref_format", ["files", "reftable"]) | |
| 15 | 20 | def test_repo_accepts_explicit_literal_path_selection(object_format, ref_format, monkeypatch): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments