nextmv 0.27.0__py3-none-any.whl → 0.28.1__py3-none-any.whl

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.
nextmv/cloud/version.py CHANGED
@@ -1,4 +1,20 @@
1
- """This module contains definitions for versions."""
1
+ """Manages application versions within the Nextmv Cloud API.
2
+
3
+ This module provides data models for representing application versions,
4
+ their executables, and associated requirements. These models are used
5
+ for interacting with version-related endpoints of the Nextmv Cloud API,
6
+ allowing users to define, retrieve, and manage different versions of their
7
+ decision applications.
8
+
9
+ Classes
10
+ -------
11
+ VersionExecutableRequirements
12
+ Defines the requirements for a version's executable, such as type and runtime.
13
+ VersionExecutable
14
+ Represents the executable artifact for a specific application version.
15
+ Version
16
+ Represents a version of an application, linking to its executable and metadata.
17
+ """
2
18
 
3
19
  from datetime import datetime
4
20
 
@@ -6,7 +22,34 @@ from nextmv.base_model import BaseModel
6
22
 
7
23
 
8
24
  class VersionExecutableRequirements(BaseModel):
9
- """Requirements for a version executable."""
25
+ """
26
+ Requirements for a version executable.
27
+
28
+ You can import the `VersionExecutableRequirements` class directly from `cloud`:
29
+
30
+ ```python
31
+ from nextmv.cloud import VersionExecutableRequirements
32
+ ```
33
+
34
+ These requirements specify the environment and type of executable needed
35
+ to run a particular version of an application.
36
+
37
+ Parameters
38
+ ----------
39
+ executable_type : str
40
+ The type of the executable (e.g., "binary", "docker").
41
+ runtime : str
42
+ The runtime environment for the executable (e.g., "go", "python").
43
+
44
+ Examples
45
+ --------
46
+ >>> requirements = VersionExecutableRequirements(
47
+ ... executable_type="binary",
48
+ ... runtime="go1.x"
49
+ ... )
50
+ >>> print(requirements.executable_type)
51
+ binary
52
+ """
10
53
 
11
54
  executable_type: str
12
55
  """Type of the executable."""
@@ -15,7 +58,42 @@ class VersionExecutableRequirements(BaseModel):
15
58
 
16
59
 
17
60
  class VersionExecutable(BaseModel):
18
- """Executable for a version."""
61
+ """
62
+ Executable for a version.
63
+
64
+ You can import the `VersionExecutable` class directly from `cloud`:
65
+
66
+ ```python
67
+ from nextmv.cloud import VersionExecutable
68
+ ```
69
+
70
+ This class holds information about the actual executable file or image
71
+ associated with an application version, including who uploaded it and when.
72
+
73
+ Parameters
74
+ ----------
75
+ id : str
76
+ Unique identifier for the version executable.
77
+ user_email : str
78
+ Email of the user who uploaded the executable.
79
+ uploaded_at : datetime
80
+ Timestamp indicating when the executable was uploaded.
81
+ requirements : VersionExecutableRequirements
82
+ The specific requirements for this executable.
83
+
84
+ Examples
85
+ --------
86
+ >>> from datetime import datetime
87
+ >>> reqs = VersionExecutableRequirements(executable_type="docker", runtime="custom")
88
+ >>> executable = VersionExecutable(
89
+ ... id="exec-123",
90
+ ... user_email="user@example.com",
91
+ ... uploaded_at=datetime.now(),
92
+ ... requirements=reqs
93
+ ... )
94
+ >>> print(executable.id)
95
+ exec-123
96
+ """
19
97
 
20
98
  id: str
21
99
  """ID of the version."""
@@ -28,7 +106,57 @@ class VersionExecutable(BaseModel):
28
106
 
29
107
 
30
108
  class Version(BaseModel):
31
- """A version of an application representing a code artifact or a compiled binary."""
109
+ """
110
+ A version of an application representing a code artifact or a compiled binary.
111
+
112
+ You can import the `Version` class directly from `cloud`:
113
+
114
+ ```python
115
+ from nextmv.cloud import Version
116
+ ```
117
+
118
+ This class encapsulates all details of a specific version of an application,
119
+ including its metadata, associated executable, and timestamps.
120
+
121
+ Parameters
122
+ ----------
123
+ id : str
124
+ Unique identifier for the version.
125
+ application_id : str
126
+ Identifier of the application to which this version belongs.
127
+ name : str
128
+ User-defined name for the version (e.g., "v1.0.0", "feature-branch-build").
129
+ description : str
130
+ A more detailed description of the version and its changes.
131
+ executable : VersionExecutable
132
+ The executable artifact associated with this version.
133
+ created_at : datetime
134
+ Timestamp indicating when the version was created.
135
+ updated_at : datetime
136
+ Timestamp indicating when the version was last updated.
137
+
138
+ Examples
139
+ --------
140
+ >>> from datetime import datetime
141
+ >>> reqs = VersionExecutableRequirements(executable_type="binary", runtime="java11")
142
+ >>> exe = VersionExecutable(
143
+ ... id="exec-abc",
144
+ ... user_email="dev@example.com",
145
+ ... uploaded_at=datetime.now(),
146
+ ... requirements=reqs
147
+ ... )
148
+ >>> version_info = Version(
149
+ ... id="ver-xyz",
150
+ ... application_id="app-123",
151
+ ... name="Initial Release",
152
+ ... description="First stable release of the model.",
153
+ ... executable=exe,
154
+ ... created_at=datetime.now(),
155
+ ... updated_at=datetime.now()
156
+ ... )
157
+ >>> print(version_info.name)
158
+ Initial Release
159
+ """
32
160
 
33
161
  id: str
34
162
  """ID of the version."""
nextmv/deprecated.py CHANGED
@@ -1,8 +1,42 @@
1
+ """Utilities for handling deprecated functionality within the Nextmv Python SDK.
2
+
3
+ This module provides tools to mark functions, methods, or features as deprecated,
4
+ emitting appropriate warnings to users. These warnings inform users that the
5
+ functionality will be removed in a future release and suggest alternative approaches.
6
+
7
+ The main purpose of this module is to help with the smooth transition when
8
+ API changes are necessary, giving users time to update their code before
9
+ functionality is removed completely.
10
+ """
11
+
1
12
  import warnings
2
13
 
3
14
 
4
- def deprecated(name: str, reason: str):
5
- """A very simple functon to mark something as deprecated."""
15
+ def deprecated(name: str, reason: str) -> None:
16
+ """Mark functionality as deprecated with a warning message.
17
+
18
+ This function emits a DeprecationWarning when called, indicating that
19
+ the functionality will be removed in a future release.
20
+
21
+ Parameters
22
+ ----------
23
+ name : str
24
+ The name of the function, method, or feature being deprecated.
25
+ reason : str
26
+ The reason why the functionality is being deprecated, possibly
27
+ with suggestions for alternative approaches.
28
+
29
+ Notes
30
+ -----
31
+ This function temporarily changes the warning filter to ensure the
32
+ deprecation warning is shown, then resets it afterward.
33
+
34
+ Examples
35
+ --------
36
+ >>> def some_function():
37
+ ... deprecated("feature_x", "Use feature_y instead")
38
+ ... # function implementation
39
+ """
6
40
 
7
41
  warnings.simplefilter("always", DeprecationWarning)
8
42
  warnings.warn(