lange-python 0.3.24__tar.gz → 0.3.26__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.
Files changed (32) hide show
  1. {lange_python-0.3.24 → lange_python-0.3.26}/PKG-INFO +1 -1
  2. {lange_python-0.3.24 → lange_python-0.3.26}/lange/distribution/_client.py +4 -4
  3. lange_python-0.3.26/lange/tunnel/_util.py +29 -0
  4. {lange_python-0.3.24 → lange_python-0.3.26}/pyproject.toml +1 -1
  5. lange_python-0.3.24/lange/tunnel/_util.py +0 -18
  6. {lange_python-0.3.24 → lange_python-0.3.26}/README.md +0 -0
  7. {lange_python-0.3.24 → lange_python-0.3.26}/lange/__init__.py +0 -0
  8. {lange_python-0.3.24 → lange_python-0.3.26}/lange/__main__.py +0 -0
  9. {lange_python-0.3.24 → lange_python-0.3.26}/lange/_util/__init__.py +0 -0
  10. {lange_python-0.3.24 → lange_python-0.3.26}/lange/_util/_base_client.py +0 -0
  11. {lange_python-0.3.24 → lange_python-0.3.26}/lange/_util/_key_handling.py +0 -0
  12. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/__init__.py +0 -0
  13. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/build/__init__.py +0 -0
  14. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/build/_command.py +0 -0
  15. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/build/_discovery.py +0 -0
  16. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/build/_docker.py +0 -0
  17. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/build/_poetry.py +0 -0
  18. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/build/_types.py +0 -0
  19. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/code/__init__.py +0 -0
  20. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/code/_stats.py +0 -0
  21. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/code/audit/__init__.py +0 -0
  22. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/code/audit/_command.py +0 -0
  23. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/code/audit/_discovery.py +0 -0
  24. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/code/audit/_runner.py +0 -0
  25. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/code/audit/_types.py +0 -0
  26. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/distribution/__init__.py +0 -0
  27. {lange_python-0.3.24 → lange_python-0.3.26}/lange/cli/distribution/_command.py +0 -0
  28. {lange_python-0.3.24 → lange_python-0.3.26}/lange/distribution/__init__.py +0 -0
  29. {lange_python-0.3.24 → lange_python-0.3.26}/lange/distribution/_update_macos.py +0 -0
  30. {lange_python-0.3.24 → lange_python-0.3.26}/lange/distribution/_util.py +0 -0
  31. {lange_python-0.3.24 → lange_python-0.3.26}/lange/tunnel/__init__.py +0 -0
  32. {lange_python-0.3.24 → lange_python-0.3.26}/lange/tunnel/_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lange-python
3
- Version: 0.3.24
3
+ Version: 0.3.26
4
4
  Summary: A bundeld set of tools, clients for the lange-suite of tools and more.
5
5
  Author: contact@robertlange.me
6
6
  Requires-Python: >=3.10
@@ -28,7 +28,7 @@ class DistributionClient(BaseLangeLabsClient):
28
28
  """
29
29
  Client for querying public distribution metadata and update availability.
30
30
 
31
- :param host: Base app-service URL, e.g. ``https://lange-labs.com``.
31
+ :param host: Base API-service URL, e.g. ``https://api.lange-labs.com``.
32
32
  :param api_key: Optional API key supplied directly or resolved from the environment.
33
33
  :param timeout: HTTP timeout in seconds for metadata requests.
34
34
  :raises ValueError: If ``api_key`` is provided but empty.
@@ -36,13 +36,13 @@ class DistributionClient(BaseLangeLabsClient):
36
36
 
37
37
  def __init__(self,
38
38
  distribution_name: str,
39
- host: str = "https://lange-labs.com",
39
+ host: str = "https://api.lange-labs.com",
40
40
  api_key: str | None = None,
41
41
  timeout: float = 10.0) -> None:
42
42
  """
43
- Initialize a distribution metadata client for the Lange app service.
43
+ Initialize a distribution metadata client for the Lange API service.
44
44
 
45
- :param host: Base app-service URL, e.g. ``https://lange-labs.com``.
45
+ :param host: Base API-service URL, e.g. ``https://api.lange-labs.com``.
46
46
  :param api_key: Optional API key supplied directly or resolved from the environment.
47
47
  :param timeout: HTTP timeout in seconds for metadata requests.
48
48
  :param distribution_name: Distribution name as stored by the app service.
@@ -0,0 +1,29 @@
1
+ from typing import Any, Final
2
+
3
+ HOP_BY_HOP_HEADERS: Final[frozenset[str]] = frozenset(
4
+ {
5
+ "connection",
6
+ "content-length",
7
+ "host",
8
+ "keep-alive",
9
+ "transfer-encoding",
10
+ "upgrade",
11
+ }
12
+ )
13
+
14
+
15
+ def _filter_hop_by_hop_headers(headers: Any) -> dict[str, str]:
16
+ """
17
+ Remove hop-by-hop and proxy-controlled headers before forwarding to the local target.
18
+
19
+ :param headers: Request header mapping.
20
+ :returns: Filtered header mapping.
21
+ """
22
+ if not isinstance(headers, dict):
23
+ return {}
24
+
25
+ return {
26
+ str(key): str(value)
27
+ for key, value in headers.items()
28
+ if str(key).lower() not in HOP_BY_HOP_HEADERS
29
+ }
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lange-python"
3
- version = "0.3.24"
3
+ version = "0.3.26"
4
4
  description = "A bundeld set of tools, clients for the lange-suite of tools and more."
5
5
  authors = [
6
6
  {name = "contact@robertlange.me"}
@@ -1,18 +0,0 @@
1
- from typing import Any
2
-
3
- def _filter_hop_by_hop_headers(headers: Any) -> dict[str, str]:
4
- """
5
- Remove hop-by-hop headers before forwarding to the local target.
6
-
7
- :param headers: Request header mapping.
8
- :returns: Filtered header mapping.
9
- """
10
- if not isinstance(headers, dict):
11
- return {}
12
-
13
- hop_by_hop = {"connection", "keep-alive", "transfer-encoding", "upgrade"}
14
- return {
15
- str(key): str(value)
16
- for key, value in headers.items()
17
- if str(key).lower() not in hop_by_hop
18
- }
File without changes