prismadata 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prismadata
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Python client for the PrismaData location intelligence API
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -43,7 +43,18 @@ from .exceptions import (
43
43
  ValidationError,
44
44
  )
45
45
 
46
- __version__ = "0.1.0"
46
+ from importlib.metadata import version as _pkg_version, PackageNotFoundError
47
+
48
+ try:
49
+ __version__ = _pkg_version("prismadata")
50
+ except PackageNotFoundError:
51
+ # Fallback for editable installs or running from source
52
+ from pathlib import Path as _Path
53
+ import re as _re
54
+
55
+ _pyproject = _Path(__file__).resolve().parent.parent / "pyproject.toml"
56
+ _match = _re.search(r'^version\s*=\s*"([^"]+)"', _pyproject.read_text(), _re.MULTILINE)
57
+ __version__ = _match.group(1) if _match else "0.0.0"
47
58
 
48
59
  __all__ = [
49
60
  "AsyncClient",
@@ -111,7 +111,9 @@ class AsyncClient:
111
111
  UserWarning,
112
112
  stacklevel=2,
113
113
  )
114
- http = AsyncHttpClient(auth, timeout=timeout, app_name=app_name)
114
+ from . import __version__
115
+
116
+ http = AsyncHttpClient(auth, timeout=timeout, version=__version__, app_name=app_name)
115
117
  auth.set_http_client(http._client)
116
118
  cache_mgr = CacheManager(enabled=cache, ttl=cache_ttl)
117
119
  return cls(auth, http, cache_mgr, clean_columns, show_progress)
@@ -128,7 +128,9 @@ class Client:
128
128
  UserWarning,
129
129
  stacklevel=2,
130
130
  )
131
- self._http = HttpClient(self._auth, timeout=timeout, app_name=app_name)
131
+ from . import __version__
132
+
133
+ self._http = HttpClient(self._auth, timeout=timeout, version=__version__, app_name=app_name)
132
134
  self._cache = CacheManager(enabled=cache, ttl=cache_ttl)
133
135
 
134
136
  def close(self) -> None:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "prismadata"
3
- version = "0.3.0"
3
+ version = "0.3.2"
4
4
  description = "Python client for the PrismaData location intelligence API"
5
5
  authors = ["PrismaData <contato@prismadata.io>"]
6
6
  license = "MIT"
File without changes
File without changes