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.
Files changed (44) hide show
  1. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/PKG-INFO +2 -2
  2. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/README.md +1 -1
  3. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/__init__.py +1 -1
  4. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/clients.py +16 -4
  5. devopsdriver-0.1.44/devopsdriver/azdo/pipeline/__init__.py +12 -0
  6. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/run.py +1 -1
  7. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/workitem/client.py +3 -2
  8. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/PKG-INFO +2 -2
  9. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_clients.py +32 -7
  10. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_pipeline_run.py +1 -1
  11. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_workitem_client.py +1 -1
  12. devopsdriver-0.1.43/devopsdriver/azdo/pipeline/__init__.py +0 -0
  13. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/LICENSE +0 -0
  14. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/__init__.py +0 -0
  15. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/azureobject.py +0 -0
  16. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/client.py +0 -0
  17. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/log.py +0 -0
  18. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/pipeline/pipeline.py +0 -0
  19. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/timestamp.py +0 -0
  20. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/workitem/__init__.py +0 -0
  21. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/azdo/workitem/wiql.py +0 -0
  22. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/dataobject.py +0 -0
  23. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/manage_settings.py +0 -0
  24. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/sendmail.py +0 -0
  25. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/settings.py +0 -0
  26. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/template.py +0 -0
  27. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver/templates/manage_settings.txt.mako +0 -0
  28. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/SOURCES.txt +0 -0
  29. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/dependency_links.txt +0 -0
  30. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/entry_points.txt +0 -0
  31. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/requires.txt +0 -0
  32. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/devopsdriver.egg-info/top_level.txt +0 -0
  33. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/pyproject.toml +0 -0
  34. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/setup.cfg +0 -0
  35. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_azureobject.py +0 -0
  36. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_pipeline.py +0 -0
  37. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_pipeline_client.py +0 -0
  38. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_timestamp.py +0 -0
  39. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_azure_workitem_wiql.py +0 -0
  40. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_dataobject.py +0 -0
  41. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_manage_settings.py +0 -0
  42. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_sendmail.py +0 -0
  43. {devopsdriver-0.1.43 → devopsdriver-0.1.44}/tests/test_settings.py +0 -0
  44. {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.43
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
  ![status sheild](https://img.shields.io/static/v1?label=status&message=beta&color=blue&style=plastic)
63
- [![status sheild](https://img.shields.io/static/v1?label=released&message=v0.1.43&color=active&style=plastic)](https://pypi.org/project/devopsdriver/0.1.43/)
63
+ [![status sheild](https://img.shields.io/static/v1?label=released&message=v0.1.44&color=active&style=plastic)](https://pypi.org/project/devopsdriver/0.1.44/)
64
64
  [![GitHub](https://img.shields.io/github/license/marcpage/devops-driver?style=plastic)](https://github.com/marcpage/devops-driver?tab=Unlicense-1-ov-file#readme)
65
65
  [![GitHub contributors](https://img.shields.io/github/contributors/marcpage/devops-driver?style=flat)](https://github.com/marcpage/devops-driver/graphs/contributors)
66
66
  [![PR's Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com)
@@ -1,5 +1,5 @@
1
1
  ![status sheild](https://img.shields.io/static/v1?label=status&message=beta&color=blue&style=plastic)
2
- [![status sheild](https://img.shields.io/static/v1?label=released&message=v0.1.43&color=active&style=plastic)](https://pypi.org/project/devopsdriver/0.1.43/)
2
+ [![status sheild](https://img.shields.io/static/v1?label=released&message=v0.1.44&color=active&style=plastic)](https://pypi.org/project/devopsdriver/0.1.44/)
3
3
  [![GitHub](https://img.shields.io/github/license/marcpage/devops-driver?style=plastic)](https://github.com/marcpage/devops-driver?tab=Unlicense-1-ov-file#readme)
4
4
  [![GitHub contributors](https://img.shields.io/github/contributors/marcpage/devops-driver?style=flat)](https://github.com/marcpage/devops-driver/graphs/contributors)
5
5
  [![PR's Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com)
@@ -6,6 +6,6 @@ from .template import Template
6
6
  from .azdo.clients import Azure
7
7
 
8
8
 
9
- __version__ = "0.1.43"
9
+ __version__ = "0.1.44"
10
10
  __author__ = "Marc Page"
11
11
  __credits__ = ""
@@ -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
- SUPPORTED_CLIENTS = {"workitem", "pipeline"}
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
@@ -35,7 +35,7 @@ class Run(AzureObject): # pylint: disable=too-few-public-methods
35
35
  self.pipeline = pipeline
36
36
  super().__init__(run)
37
37
 
38
- def logs(self):
38
+ def get_logs(self):
39
39
  """Get Logs for the run"""
40
40
  return [
41
41
  Log(l)
@@ -43,7 +43,7 @@ class Client:
43
43
  top=top,
44
44
  )
45
45
 
46
- def history( # pylint: disable=too-many-arguments
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.history(i)] for i in self.find_ids(wiql, top)
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.43
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
  ![status sheild](https://img.shields.io/static/v1?label=status&message=beta&color=blue&style=plastic)
63
- [![status sheild](https://img.shields.io/static/v1?label=released&message=v0.1.43&color=active&style=plastic)](https://pypi.org/project/devopsdriver/0.1.43/)
63
+ [![status sheild](https://img.shields.io/static/v1?label=released&message=v0.1.44&color=active&style=plastic)](https://pypi.org/project/devopsdriver/0.1.44/)
64
64
  [![GitHub](https://img.shields.io/github/license/marcpage/devops-driver?style=plastic)](https://github.com/marcpage/devops-driver?tab=Unlicense-1-ov-file#readme)
65
65
  [![GitHub contributors](https://img.shields.io/github/contributors/marcpage/devops-driver?style=flat)](https://github.com/marcpage/devops-driver/graphs/contributors)
66
66
  [![PR's Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](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
- def get_work_item_tracking_client(self) -> str:
28
- """fakes getting work item client"""
29
- return "work_item_tracking_client"
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 get_pipelines_client(self) -> str:
32
- """mocks getting pipeline client"""
33
- return "get_pipelines_client"
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 azure.workitem.client == "work_item_tracking_client"
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()
@@ -60,7 +60,7 @@ def test_basic() -> None:
60
60
  """test basic run and log"""
61
61
  log.GET_URL = lambda x, timeout: x
62
62
  run = Run(MockPipelineClient(), "project", MockPipeline(5), MockAzureRun(83))
63
- logs = run.logs()
63
+ logs = run.get_logs()
64
64
  assert len(logs) == 2, logs
65
65
 
66
66
 
@@ -44,7 +44,7 @@ def test_basic() -> None:
44
44
  def test_history() -> None:
45
45
  """test history"""
46
46
  client = Client(MockClient())
47
- history = client.history(2)
47
+ history = client.get_history(2)
48
48
  assert not history
49
49
 
50
50
 
File without changes
File without changes