File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[project ]
2- name = " galileo "
3- version = " 2.3 .0"
4- description = " Client library for the Galileo platform ."
5- authors = [{ name = " Galileo Technologies Inc." , email = " team@galileo.ai " }]
2+ name = " splunk-ao "
3+ version = " 0.1 .0"
4+ description = " Splunk Agent Observability SDK for Python ."
5+ authors = [{ name = " Splunk Inc." }]
66readme = " README.md"
77requires-python = " >=3.10,<3.15"
88dynamic = [" dependencies" ]
99license = " Apache-2.0"
1010
1111[project .urls ]
12- Repository = " https://github.com/rungalileo/galileo -python"
12+ Repository = " https://github.com/signalfx/splunk-ao -python"
1313
1414[tool .poetry ]
1515packages = [
Original file line number Diff line number Diff line change 8080
8181vars (sys )["_splunk_ao_suppress_galileo_deprecation_warning" ] = False
8282
83- __version__ = "2.3 .0"
83+ __version__ = "0.1 .0"
8484
8585__all__ = [
8686 "APIError" ,
Original file line number Diff line number Diff line change 66def get_package_version () -> str :
77 """Get the installed SDK distribution version."""
88 try :
9- return version ("galileo " )
9+ return version ("splunk-ao " )
1010 except PackageNotFoundError :
1111 return "0.0.0" # Unknown version
1212
Original file line number Diff line number Diff line change 11"""Tests for X-Galileo-SDK header in API calls."""
22
3+ from importlib .metadata import PackageNotFoundError
34from unittest .mock import patch
45
56from galileo .resources .api .datasets .get_dataset_datasets_dataset_id_get import _get_kwargs as dataset_get_kwargs
1314class TestApiHeaders :
1415 """Test that X-Galileo-SDK headers are properly included in API calls."""
1516
17+ @patch ("splunk_ao.utils.headers_data.version" )
18+ def test_get_package_version_uses_splunk_ao_distribution (self , mock_version ) -> None :
19+ """Test package version lookup uses the rebranded distribution name."""
20+ mock_version .return_value = "0.1.0"
21+
22+ assert get_package_version () == "0.1.0"
23+ mock_version .assert_called_once_with ("splunk-ao" )
24+
25+ @patch ("splunk_ao.utils.headers_data.version" )
26+ def test_get_package_version_preserves_missing_package_fallback (self , mock_version ) -> None :
27+ """Test missing package metadata still returns the fallback version."""
28+ mock_version .side_effect = PackageNotFoundError
29+
30+ assert get_package_version () == "0.0.0"
31+ mock_version .assert_called_once_with ("splunk-ao" )
32+
1633 def test_generated_api_method_includes_sdk_header (self ) -> None :
1734 """Test that generated API methods include the X-Galileo-SDK header with method name."""
1835 # Test the _get_kwargs function which is responsible for setting headers
You can’t perform that action at this time.
0 commit comments