devopsdriver 0.1.43__tar.gz → 0.1.44__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.
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/PKG-INFO +2 -2
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/README.md +1 -1
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/__init__.py +1 -1
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/clients.py +16 -4
- devopsdriver-0.1.44/devopsdriver/azdo/pipeline/__init__.py +12 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/run.py +1 -1
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/workitem/client.py +3 -2
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/PKG-INFO +2 -2
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_clients.py +32 -7
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_pipeline_run.py +1 -1
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_workitem_client.py +1 -1
- devopsdriver-0.1.43/devopsdriver/azdo/pipeline/__init__.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/LICENSE +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/__init__.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/azureobject.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/client.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/log.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/pipeline.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/timestamp.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/workitem/__init__.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/workitem/wiql.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/dataobject.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/manage_settings.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/sendmail.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/settings.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/template.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/templates/manage_settings.txt.mako +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/SOURCES.txt +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/dependency_links.txt +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/entry_points.txt +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/requires.txt +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/top_level.txt +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/pyproject.toml +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/setup.cfg +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_azureobject.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_pipeline.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_pipeline_client.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_timestamp.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_workitem_wiql.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_dataobject.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_manage_settings.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_sendmail.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_settings.py +0 -0
- {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_template.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: devopsdriver
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.44
|
|
4
4
|
Summary: DevOps tools
|
|
5
5
|
Author-email: Marc Page <marcallenpage@gmail.com>
|
|
6
6
|
License: This is free and unencumbered software released into the public domain.
|
|
@@ -60,7 +60,7 @@ Requires-Dist: coverage>=7.4.4; extra == "test"
|
|
|
60
60
|
Provides-Extra: doc
|
|
61
61
|
|
|
62
62
|

|
|
63
|
-
[](https://pypi.org/project/devopsdriver/0.1.44/)
|
|
64
64
|
[](https://github.com/marcpage/devops-driver?tab=Unlicense-1-ov-file#readme)
|
|
65
65
|
[](https://github.com/marcpage/devops-driver/graphs/contributors)
|
|
66
66
|
[](http://makeapullrequest.com)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|

|
|
2
|
-
[](https://pypi.org/project/devopsdriver/0.1.44/)
|
|
3
3
|
[](https://github.com/marcpage/devops-driver?tab=Unlicense-1-ov-file#readme)
|
|
4
4
|
[](https://github.com/marcpage/devops-driver/graphs/contributors)
|
|
5
5
|
[](http://makeapullrequest.com)
|
|
@@ -21,16 +21,16 @@ CONNECTION = AzureConnection
|
|
|
21
21
|
AUTHENTICATION = MSBasicAuthentication
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class Azure: # pylint: disable=too-few-public-methods
|
|
24
|
+
class Azure: # pylint: disable=too-few-public-methods,too-many-instance-attributes
|
|
25
25
|
"""A connection to Azure clients"""
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
class _Client:
|
|
28
|
+
def __init__(self, client):
|
|
29
|
+
self.client = client
|
|
28
30
|
|
|
29
31
|
def __init__(
|
|
30
32
|
self, settings: Settings = None, token: str = None, url: str = None, **clients
|
|
31
33
|
):
|
|
32
|
-
unsupported_clients = set(clients) - Azure.SUPPORTED_CLIENTS
|
|
33
|
-
assert not unsupported_clients, f"{unsupported_clients} not supported"
|
|
34
34
|
settings = (
|
|
35
35
|
Settings(__file__).key("secrets")
|
|
36
36
|
if settings is None and token is None and url is None
|
|
@@ -47,9 +47,21 @@ class Azure: # pylint: disable=too-few-public-methods
|
|
|
47
47
|
client_calls = {
|
|
48
48
|
"workitem": self.connection.clients_v7_1.get_work_item_tracking_client,
|
|
49
49
|
"pipeline": self.connection.clients_v7_1.get_pipelines_client,
|
|
50
|
+
"task": self.connection.clients_v7_1.get_task_agent_client,
|
|
51
|
+
"git": self.connection.clients_v7_1.get_git_client,
|
|
52
|
+
"core": self.connection.clients_v7_1.get_core_client,
|
|
53
|
+
"build": self.connection.clients_v7_1.get_build_client,
|
|
54
|
+
"identity": self.connection.clients_v7_1.get_identity_client,
|
|
50
55
|
}
|
|
56
|
+
unsupported_clients = set(clients) - set(client_calls)
|
|
57
|
+
assert not unsupported_clients, f"{unsupported_clients} not supported"
|
|
51
58
|
self.workitem = WIClient(Azure.__client("workitem", clients, client_calls))
|
|
52
59
|
self.pipeline = PLClient(Azure.__client("pipeline", clients, client_calls))
|
|
60
|
+
self.core = Azure._Client(Azure.__client("core", clients, client_calls))
|
|
61
|
+
self.task = Azure._Client(Azure.__client("task", clients, client_calls))
|
|
62
|
+
self.git = Azure._Client(Azure.__client("git", clients, client_calls))
|
|
63
|
+
self.build = Azure._Client(Azure.__client("build", clients, client_calls))
|
|
64
|
+
self.identity = Azure._Client(Azure.__client("identity", clients, client_calls))
|
|
53
65
|
|
|
54
66
|
@staticmethod
|
|
55
67
|
def __client(name: str, clients: dict, calls: dict) -> any:
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# pylint: disable=cyclic-import
|
|
2
|
+
|
|
3
|
+
# devopsdriver.azdo
|
|
4
|
+
# -> devopsdriver.azdo.clients
|
|
5
|
+
# -> devopsdriver.azdo.pipeline.client
|
|
6
|
+
# -> devopsdriver.azdo.pipeline.pipeline
|
|
7
|
+
|
|
8
|
+
# devopsdriver.azdo
|
|
9
|
+
# -> devopsdriver.azdo.clients
|
|
10
|
+
# -> devopsdriver.azdo.pipeline.client
|
|
11
|
+
# -> devopsdriver.azdo.pipeline.pipeline
|
|
12
|
+
# -> devopsdriver.azdo.pipeline.run
|
|
@@ -43,7 +43,7 @@ class Client:
|
|
|
43
43
|
top=top,
|
|
44
44
|
)
|
|
45
45
|
|
|
46
|
-
def
|
|
46
|
+
def get_history( # pylint: disable=too-many-arguments
|
|
47
47
|
self,
|
|
48
48
|
wi_id: int,
|
|
49
49
|
project: str = None,
|
|
@@ -86,5 +86,6 @@ class Client:
|
|
|
86
86
|
list[list[WorkItem]]: List of work items, each is a history of work items
|
|
87
87
|
"""
|
|
88
88
|
return [
|
|
89
|
-
[AzureObject(e) for e in self.
|
|
89
|
+
[AzureObject(e) for e in self.get_history(i)]
|
|
90
|
+
for i in self.find_ids(wiql, top)
|
|
90
91
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: devopsdriver
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.44
|
|
4
4
|
Summary: DevOps tools
|
|
5
5
|
Author-email: Marc Page <marcallenpage@gmail.com>
|
|
6
6
|
License: This is free and unencumbered software released into the public domain.
|
|
@@ -60,7 +60,7 @@ Requires-Dist: coverage>=7.4.4; extra == "test"
|
|
|
60
60
|
Provides-Extra: doc
|
|
61
61
|
|
|
62
62
|

|
|
63
|
-
[](https://pypi.org/project/devopsdriver/0.1.44/)
|
|
64
64
|
[](https://github.com/marcpage/devops-driver?tab=Unlicense-1-ov-file#readme)
|
|
65
65
|
[](https://github.com/marcpage/devops-driver/graphs/contributors)
|
|
66
66
|
[](http://makeapullrequest.com)
|
|
@@ -24,13 +24,23 @@ class MockConnection: # pylint: disable=too-few-public-methods
|
|
|
24
24
|
class Clients71: # pylint: disable=too-few-public-methods
|
|
25
25
|
"""Fakes a 7.1 clients factory"""
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
""
|
|
29
|
-
|
|
27
|
+
SUPPORTED = {
|
|
28
|
+
"get_work_item_tracking_client",
|
|
29
|
+
"get_pipelines_client",
|
|
30
|
+
"get_task_agent_client",
|
|
31
|
+
"get_git_client",
|
|
32
|
+
"get_core_client",
|
|
33
|
+
"get_build_client",
|
|
34
|
+
"get_identity_client",
|
|
35
|
+
}
|
|
30
36
|
|
|
31
|
-
def
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
def __getattr__(self, name: str) -> str:
|
|
38
|
+
assert name in Clients71.SUPPORTED, name
|
|
39
|
+
|
|
40
|
+
def function():
|
|
41
|
+
return name.replace("get_", "")
|
|
42
|
+
|
|
43
|
+
return function
|
|
34
44
|
|
|
35
45
|
self.clients_v7_1 = Clients71()
|
|
36
46
|
|
|
@@ -124,7 +134,9 @@ def test_load_settings() -> None:
|
|
|
124
134
|
), azure.connection.base_url
|
|
125
135
|
assert azure.connection.creds.token == "token", azure.connection.creds.token
|
|
126
136
|
assert azure.connection.creds.empty == "", azure.connection.creds.empty
|
|
127
|
-
assert
|
|
137
|
+
assert (
|
|
138
|
+
azure.workitem.client == "work_item_tracking_client"
|
|
139
|
+
), azure.workitem.client
|
|
128
140
|
|
|
129
141
|
|
|
130
142
|
def test_not_all_clients() -> None:
|
|
@@ -140,7 +152,20 @@ def test_not_all_clients() -> None:
|
|
|
140
152
|
assert azure.workitem.client is None
|
|
141
153
|
|
|
142
154
|
|
|
155
|
+
def test_unsupported_client() -> None:
|
|
156
|
+
"""test the basic calling"""
|
|
157
|
+
clients.CONNECTION = MockConnection
|
|
158
|
+
clients.AUTHENTICATION = lambda a, b: SimpleNamespace(empty=a, token=b)
|
|
159
|
+
try:
|
|
160
|
+
_ = Azure(None, "token", "https://url.com/project", google=True)
|
|
161
|
+
raise KeyError("google should not have worked")
|
|
162
|
+
|
|
163
|
+
except AssertionError as error:
|
|
164
|
+
assert "google" in str(error), error
|
|
165
|
+
|
|
166
|
+
|
|
143
167
|
if __name__ == "__main__":
|
|
168
|
+
test_unsupported_client()
|
|
144
169
|
test_not_all_clients()
|
|
145
170
|
test_load_settings()
|
|
146
171
|
test_mixed_settings()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|