apexdevkit 1.32.1__tar.gz → 1.32.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.
Files changed (65) hide show
  1. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/PKG-INFO +1 -1
  2. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/sync/source.py +29 -26
  3. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/sync/sync.py +5 -3
  4. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/sync/target.py +13 -13
  5. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/pyproject.toml +1 -1
  6. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/LICENSE +0 -0
  7. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/README.md +0 -0
  8. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/__init__.py +0 -0
  9. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/annotation/__init__.py +0 -0
  10. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/annotation/deprecate.py +0 -0
  11. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/date.py +0 -0
  12. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/environment.py +0 -0
  13. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/error.py +0 -0
  14. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/__init__.py +0 -0
  15. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/builder.py +0 -0
  16. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/dependable.py +0 -0
  17. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/docs.py +0 -0
  18. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/name.py +0 -0
  19. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/resource.py +0 -0
  20. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/response.py +0 -0
  21. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/router.py +0 -0
  22. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/schema.py +0 -0
  23. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fastapi/service.py +0 -0
  24. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/fluent.py +0 -0
  25. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/formatter.py +0 -0
  26. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/__init__.py +0 -0
  27. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/fake.py +0 -0
  28. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/fluent.py +0 -0
  29. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/httpx/__init__.py +0 -0
  30. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/httpx/client.py +0 -0
  31. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/httpx/hooks.py +0 -0
  32. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/json.py +0 -0
  33. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/http/url.py +0 -0
  34. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/key_fn.py +0 -0
  35. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/py.typed +0 -0
  36. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/query/__init__.py +0 -0
  37. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/query/generator.py +0 -0
  38. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/query/query.py +0 -0
  39. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/__init__.py +0 -0
  40. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/core/__init__.py +0 -0
  41. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/core/database.py +0 -0
  42. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/core/decorator.py +0 -0
  43. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/core/interface.py +0 -0
  44. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/core/mixin.py +0 -0
  45. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/core/multi.py +0 -0
  46. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/in_memory/__init__.py +0 -0
  47. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/in_memory/mixin.py +0 -0
  48. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/in_memory/repository.py +0 -0
  49. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/in_memory/store.py +0 -0
  50. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/sql/__init__.py +0 -0
  51. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/sql/connector.py +0 -0
  52. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/sql/field.py +0 -0
  53. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/sql/mssql.py +0 -0
  54. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/repository/sql/sqlite.py +0 -0
  55. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/security/__init__.py +0 -0
  56. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/security/core.py +0 -0
  57. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/security/hashing.py +0 -0
  58. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/server.py +0 -0
  59. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/sync/__init__.py +0 -0
  60. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/sync/observer.py +0 -0
  61. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/testing/__init__.py +0 -0
  62. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/testing/database.py +0 -0
  63. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/testing/fake.py +0 -0
  64. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/testing/rest.py +0 -0
  65. {apexdevkit-1.32.1 → apexdevkit-1.32.2}/apexdevkit/value.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apexdevkit
3
- Version: 1.32.1
3
+ Version: 1.32.2
4
4
  Summary: Apex Development Tools for python.
5
5
  License-File: LICENSE
6
6
  Author: Apex Dev
@@ -6,10 +6,10 @@ from typing import Generic, Protocol, TypeVar
6
6
 
7
7
  from apexdevkit.key_fn import AttributeKey, KeyFn
8
8
 
9
- T = TypeVar("T")
9
+ T = TypeVar("T", covariant=True)
10
10
 
11
11
 
12
- class Source(Protocol): # pragma: no cover
12
+ class Source(Protocol[T]): # pragma: no cover
13
13
  def absent(self) -> Iterable[T]:
14
14
  pass
15
15
 
@@ -21,7 +21,7 @@ class Source(Protocol): # pragma: no cover
21
21
 
22
22
 
23
23
  @dataclass(frozen=True)
24
- class EmptySource: # pragma: no cover
24
+ class EmptySource(Generic[T]): # pragma: no cover
25
25
  def absent(self) -> Iterable[T]:
26
26
  return []
27
27
 
@@ -33,8 +33,8 @@ class EmptySource: # pragma: no cover
33
33
 
34
34
 
35
35
  @dataclass(frozen=True, kw_only=True)
36
- class SourceDecorator: # pragma: no cover
37
- inner: Source = field(default_factory=EmptySource)
36
+ class SourceDecorator(Generic[T]): # pragma: no cover
37
+ inner: Source[T] = field(default_factory=EmptySource)
38
38
 
39
39
  def absent(self) -> Iterable[T]:
40
40
  return self.inner.absent()
@@ -62,9 +62,9 @@ class SourcePreSet(Generic[T]):
62
62
  return self.changes
63
63
 
64
64
 
65
- class SourceFailing:
65
+ class SourceFailing(Generic[T]):
66
66
  @staticmethod
67
- def on_everything(using: Source | None = None) -> Source:
67
+ def on_everything(using: Source[T] | None = None) -> Source[T]:
68
68
  return SourceFailing.on_absent(
69
69
  using=SourceFailing.on_new(
70
70
  using=SourceFailing.on_update(
@@ -74,31 +74,34 @@ class SourceFailing:
74
74
  )
75
75
 
76
76
  @staticmethod
77
- def on_absent(using: Source | None = None) -> Source:
78
- return SourceFailing.OnAbsent(inner=using or EmptySource())
77
+ def on_absent(using: Source[T] | None = None) -> Source[T]:
78
+ return _FailOnAbsent(inner=using or EmptySource())
79
79
 
80
- @dataclass(frozen=True, kw_only=True)
81
- class OnAbsent(SourceDecorator):
82
- def absent(self) -> Iterable[T]: # pragma: no cover
83
- raise RuntimeError("Should not request absent!")
80
+ @staticmethod
81
+ def on_new(using: Source[T] | None = None) -> Source[T]:
82
+ return _FailOnNew(inner=using or EmptySource())
84
83
 
85
84
  @staticmethod
86
- def on_new(using: Source | None = None) -> Source:
87
- return SourceFailing.OnNew(inner=using or EmptySource())
85
+ def on_update(using: Source[T] | None = None) -> Source[T]:
86
+ return _FailOnUpdate(inner=using or EmptySource())
88
87
 
89
- @dataclass(frozen=True, kw_only=True)
90
- class OnNew(SourceDecorator):
91
- def new(self) -> Iterable[T]: # pragma: no cover
92
- raise RuntimeError("Should not request new!")
93
88
 
94
- @staticmethod
95
- def on_update(using: Source | None = None) -> Source:
96
- return SourceFailing.OnUpdate(inner=using or EmptySource())
89
+ @dataclass(frozen=True, kw_only=True)
90
+ class _FailOnAbsent(SourceDecorator[T]):
91
+ def absent(self) -> Iterable[T]: # pragma: no cover
92
+ raise RuntimeError("Should not request absent!")
93
+
97
94
 
98
- @dataclass(frozen=True, kw_only=True)
99
- class OnUpdate(SourceDecorator):
100
- def updates(self) -> Iterable[T]: # pragma: no cover
101
- raise RuntimeError("Should not request updates!")
95
+ @dataclass(frozen=True, kw_only=True)
96
+ class _FailOnNew(SourceDecorator[T]):
97
+ def new(self) -> Iterable[T]: # pragma: no cover
98
+ raise RuntimeError("Should not request new!")
99
+
100
+
101
+ @dataclass(frozen=True, kw_only=True)
102
+ class _FailOnUpdate(SourceDecorator[T]):
103
+ def updates(self) -> Iterable[T]: # pragma: no cover
104
+ raise RuntimeError("Should not request updates!")
102
105
 
103
106
 
104
107
  @dataclass(frozen=True, kw_only=True)
@@ -2,16 +2,18 @@ from __future__ import annotations
2
2
 
3
3
  from collections.abc import Callable, Collection, Iterable
4
4
  from dataclasses import dataclass
5
- from typing import Any, Self
5
+ from typing import Any, Generic, Self, TypeVar
6
6
 
7
7
  from .observer import DefaultLog, ObservableSync
8
8
  from .source import Source
9
9
  from .target import Target
10
10
 
11
+ T = TypeVar("T")
12
+
11
13
 
12
14
  @dataclass(frozen=True, kw_only=True)
13
- class Sync(ObservableSync):
14
- source: Source
15
+ class Sync(ObservableSync, Generic[T]):
16
+ source: Source[T]
15
17
  target: Target
16
18
 
17
19
  dry_run: bool = False
@@ -2,30 +2,30 @@ from __future__ import annotations
2
2
 
3
3
  from collections.abc import Iterable
4
4
  from dataclasses import dataclass, field
5
- from typing import Protocol, TypeVar
5
+ from typing import Any, Protocol, TypeVar
6
6
 
7
7
  T = TypeVar("T")
8
8
 
9
9
 
10
10
  class Target(Protocol): # pragma: no cover
11
- def prune(self, source: Iterable[T]) -> None:
11
+ def prune(self, source: Iterable[T]) -> Any:
12
12
  pass
13
13
 
14
- def load(self, source: Iterable[T]) -> None:
14
+ def load(self, source: Iterable[T]) -> Any:
15
15
  pass
16
16
 
17
- def renew(self, source: Iterable[T]) -> None:
17
+ def renew(self, source: Iterable[T]) -> Any:
18
18
  pass
19
19
 
20
20
 
21
21
  class NoTarget: # pragma: no cover
22
- def prune(self, source: Iterable[T]) -> None:
22
+ def prune(self, source: Iterable[T]) -> Any:
23
23
  pass
24
24
 
25
- def load(self, source: Iterable[T]) -> None:
25
+ def load(self, source: Iterable[T]) -> Any:
26
26
  pass
27
27
 
28
- def renew(self, source: Iterable[T]) -> None:
28
+ def renew(self, source: Iterable[T]) -> Any:
29
29
  pass
30
30
 
31
31
 
@@ -33,13 +33,13 @@ class NoTarget: # pragma: no cover
33
33
  class TargetDecorator:
34
34
  inner: Target = field(default_factory=NoTarget)
35
35
 
36
- def prune(self, source: Iterable[T]) -> None:
36
+ def prune(self, source: Iterable[T]) -> Any:
37
37
  self.inner.prune(source)
38
38
 
39
- def load(self, source: Iterable[T]) -> None:
39
+ def load(self, source: Iterable[T]) -> Any:
40
40
  self.inner.load(source)
41
41
 
42
- def renew(self, source: Iterable[T]) -> None:
42
+ def renew(self, source: Iterable[T]) -> Any:
43
43
  self.inner.renew(source)
44
44
 
45
45
 
@@ -60,7 +60,7 @@ class TargetFailing:
60
60
 
61
61
  @dataclass(frozen=True, kw_only=True)
62
62
  class OnPrune(TargetDecorator):
63
- def prune(self, source: Iterable[T]) -> None: # pragma: no cover
63
+ def prune(self, source: Iterable[T]) -> Any: # pragma: no cover
64
64
  raise RuntimeError(source)
65
65
 
66
66
  @staticmethod
@@ -69,7 +69,7 @@ class TargetFailing:
69
69
 
70
70
  @dataclass(frozen=True, kw_only=True)
71
71
  class OnLoad(TargetDecorator):
72
- def load(self, source: Iterable[T]) -> None: # pragma: no cover
72
+ def load(self, source: Iterable[T]) -> Any: # pragma: no cover
73
73
  raise RuntimeError(source)
74
74
 
75
75
  @staticmethod
@@ -78,5 +78,5 @@ class TargetFailing:
78
78
 
79
79
  @dataclass(frozen=True, kw_only=True)
80
80
  class OnUpdate(TargetDecorator):
81
- def renew(self, source: Iterable[T]) -> None: # pragma: no cover
81
+ def renew(self, source: Iterable[T]) -> Any: # pragma: no cover
82
82
  raise RuntimeError(source)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "apexdevkit"
3
- version = "1.32.1"
3
+ version = "1.32.2"
4
4
  description = "Apex Development Tools for python."
5
5
  readme = "README.md"
6
6
  authors = [
File without changes
File without changes