Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,7 @@ Issues = "https://github.com/adcontextprotocol/adcp-client-python/issues"
where = ["src"]

[tool.setuptools.package-data]
adcp = ["py.typed"]

# Include ADCP_VERSION file in package
[tool.setuptools]
include-package-data = true

[tool.setuptools.data-files]
"." = ["ADCP_VERSION"]
adcp = ["py.typed", "ADCP_VERSION"]

[tool.black]
line-length = 100
Expand Down
File renamed without changes.
15 changes: 8 additions & 7 deletions src/adcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,16 @@ def get_adcp_version() -> str:
of the AdCP specification.

Returns:
AdCP specification version (e.g., "v1", "v2")
AdCP specification version (e.g., "2.5.0")

Raises:
FileNotFoundError: If ADCP_VERSION file is missing from package
"""
from pathlib import Path
from importlib.resources import files

# Read from ADCP_VERSION file at project root
version_file = Path(__file__).parent.parent.parent / "ADCP_VERSION"
if version_file.exists():
return version_file.read_text().strip()
return "v1" # Fallback
# Read from ADCP_VERSION file in package
version_file = files("adcp") / "ADCP_VERSION"
return version_file.read_text().strip()

__all__ = [
# Version functions
Expand Down