Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/pants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -40,8 +41,9 @@ jobs:
pants --tag="integration" test --output=all :: -- -m 'integration and not admin'
env:
integration_test_secrets: ${{secrets.integration_test_secrets}}
shard: ${{ matrix.python-version }}
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: dist/coverage/python/coverage.xml
Expand Down
2,132 changes: 1,382 additions & 750 deletions cicd/python-default.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions llamazure/azgraph/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,25 @@ python_tests(
python_distribution(
name="llamazure.azgraph",
repositories=["@llamazure.azgraph"],
dependencies=[":azgraph"],
dependencies=[":azgraph", ":py.typed"],
long_description_path="llamazure/azgraph/readme.md",
provides=python_artifact(
name="llamazure.azgraph",
version="0.1.0",
version="0.1.1",
description="Azure Resources Graph client",
author="Daniel Goldman",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
"Topic :: Internet :: Log Analysis",
],
license="Round Robin 2.0.0",
long_description_content_type="text/markdown",
),
)

resource(name="py.typed", source="py.typed")
4 changes: 4 additions & 0 deletions llamazure/azgraph/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from llamazure.azgraph.azgraph import Graph
from llamazure.azgraph.models import AzureGraphException, Req, Res, ResErr, ResMaybe

__all__ = ["Graph", "Req", "Res", "ResErr", "ResMaybe", "AzureGraphException"]
5 changes: 5 additions & 0 deletions llamazure/azgraph/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

## 0.1

### 0.1.1

- task: add py.typed
- feature: add default exports

### 0.1.0

- feature: easier to raise Exception from ResErr
Expand Down
4 changes: 3 additions & 1 deletion llamazure/azgraph/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from azure.identity import ClientSecretCredential

from llamazure.azgraph.azgraph import Graph
from llamazure.azgraph.models import AzureGraphException, Req, Res
from llamazure.azgraph.models import AzureGraphException, Req, Res, ResErr


def print_output(name: str, output: Any):
Expand Down Expand Up @@ -71,6 +71,8 @@ def test_paginated(graph: Graph):
)
)
print_output("paginated", res)
if isinstance(res, ResErr):
raise res.exception()
matches_type = isinstance(res, Res)
assert matches_type

Expand Down
Empty file added llamazure/azgraph/py.typed
Empty file.
8 changes: 5 additions & 3 deletions llamazure/azrest/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ python_tests(

python_distribution(
name="llamazure.rid",
dependencies=[":azrest"],
dependencies=[":azrest", ":py.typed"],
long_description_path="llamazure/azrest/readme.md",
provides=python_artifact(
name="llamazure.azrest",
version="0.4.0",
version="0.4.1",
description="Azure REST client",
author="Daniel Goldman",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
"Topic :: Internet :: Log Analysis",
],
Expand All @@ -35,3 +35,5 @@ python_distribution(
python_test_utils(
name="test_utils",
)

resource(name="py.typed", source="py.typed")
4 changes: 4 additions & 0 deletions llamazure/azrest/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from llamazure.azrest.azrest import AzOps, AzRest
from llamazure.azrest.models import AzList, AzureError, BatchReq, Req

__all__ = ["AzRest", "AzOps", "Req", "BatchReq", "AzureError", "AzList"]
7 changes: 6 additions & 1 deletion llamazure/azrest/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

## 0.4

## 0.4.0
### 0.4.1

- task: add py.typed
- feature: add default exports

### 0.4.0

- fix: improve inference of dicts
- feature: longpoll
Expand Down
Empty file added llamazure/azrest/py.typed
Empty file.
10 changes: 6 additions & 4 deletions llamazure/msgraph/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ python_tests(

python_distribution(
name="llamazure.rid",
dependencies=[":msgraph"],
dependencies=[":msgraph", ":py.typed"],
long_description_path="llamazure/msgraph/readme.md",
provides=python_artifact(
name="llamazure.msgraph",
version="0.1.0",
version="0.1.1",
description="Microsoft Graph client",
author="Daniel Goldman",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
"Topic :: Internet :: Log Analysis",
],
license="Round Robin 2.0.0",
long_description_content_type="text/markdown",
),
)
)

resource(name="py.typed", source="py.typed")
4 changes: 4 additions & 0 deletions llamazure/msgraph/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from llamazure.msgraph.models import MicrosoftGraphException, QueryOpts, Req, Res, ResErr, ResMaybe
from llamazure.msgraph.msgraph import Graph

__all__ = ["Graph", "Req", "Res", "ResErr", "MicrosoftGraphException", "QueryOpts", "ResMaybe"]
6 changes: 6 additions & 0 deletions llamazure/msgraph/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## 0.1

### 0.1.1

- fix: `q` follows pagination
- task: add py.typed
- feature: add default exports

### 0.1.0

- feature: **breaking** `q` throws on error
Expand Down
2 changes: 1 addition & 1 deletion llamazure/msgraph/msgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def from_credential(cls, credential) -> Graph:

def q(self, q: str) -> Any:
"""Make a graph query"""
res = self._exec_query(Req(q))
res = self.query(Req(q))
if isinstance(res, ResErr):
raise res.exception()
return res.value
Expand Down
Empty file added llamazure/msgraph/py.typed
Empty file.
8 changes: 5 additions & 3 deletions llamazure/rbac/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,26 @@ experimental_wrap_as_python_sources(

python_distribution(
name="llamazure.rbac",
dependencies=[":rbac"],
dependencies=[":rbac", ":py.typed"],
long_description_path="llamazure/rbac/readme.md",
provides=python_artifact(
name="llamazure.rbac",
version="0.2.0",
version="0.2.1",
description="Azure roles, users, and assignments",
author="Daniel Goldman",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
"Topic :: Internet :: Log Analysis",
],
license="Round Robin 2.0.0",
long_description_content_type="text/markdown",
),
)

resource(name="py.typed", source="py.typed")
4 changes: 4 additions & 0 deletions llamazure/rbac/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 0.2

### 0.2.1

- task: add py.typed

### 0.2.0

- task: bump llamazure.azrest dependency
Expand Down
Empty file added llamazure/rbac/py.typed
Empty file.
8 changes: 5 additions & 3 deletions llamazure/rid/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ python_tests(

python_distribution(
name="llamazure.rid",
dependencies=[":rid"],
dependencies=[":rid", ":py.typed"],
long_description_path="llamazure/rid/readme.md",
provides=python_artifact(
name="llamazure.rid",
version="0.1.0",
version="0.1.1",
description="Azure Resource IDs you can use",
author="Daniel Goldman",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
"Topic :: Internet :: Log Analysis",
],
Expand All @@ -33,3 +33,5 @@ python_distribution(
python_test_utils(
name="test_utils",
)

resource(name="py.typed", source="py.typed")
5 changes: 5 additions & 0 deletions llamazure/rid/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## 0.1

### 0.1.1

- feature: helpers to create subresources
- task: add py.typed

### 0.1.0

- task: fix namespace package
Expand Down
19 changes: 3 additions & 16 deletions llamazure/rid/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
)
st_subresource = builds(
lambda res_type, name, rg_name, sub: SubResource(res_type, name, ResourceGroup(rg_name, sub) if rg_name else None, parent=None, sub=sub),
az_alnum_lower,
az_alnum_lower.filter(lambda s: s not in {"subscriptions", "resourcegroups", "providers"}), # "providers" is not valid as a subresource type and will trip up the parser
az_alnum_lower,
none() | az_alnum_lower,
st_subscription,
Expand All @@ -38,22 +38,9 @@ def complex_resource(draw, res_gen) -> Union[Resource, SubResource]:
child = draw(res_gen)
parent = draw(res_gen)
if isinstance(child, Resource):
return Resource(
child.provider,
child.res_type,
child.name,
rg=parent.rg,
parent=parent,
sub=parent.sub,
)
return parent.resource(child.provider, child.res_type, child.name)
if isinstance(child, SubResource):
return SubResource(
child.res_type,
child.name,
rg=parent.rg,
parent=parent,
sub=parent.sub,
)
return parent.subresource(child.res_type, child.name)
else:
raise RuntimeError("AAAA")

Expand Down
Empty file added llamazure/rid/py.typed
Empty file.
27 changes: 27 additions & 0 deletions llamazure/rid/rid.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ class Subscription(AzObj):
def slug(self) -> str:
return f"/subscriptions/{self.uuid}"

def rg(self, name: str) -> ResourceGroup:
return ResourceGroup(name, self)

def resource(self, provider: str, res_type: str, name: str) -> Resource:
return Resource(provider, res_type, name, rg=None, sub=self)

def subresource(self, res_type: str, name: str) -> SubResource:
return SubResource(res_type, name, rg=None, sub=self)


@dataclass(frozen=True)
class ResourceGroup(AzObj):
Expand All @@ -43,6 +52,12 @@ class ResourceGroup(AzObj):
def slug(self) -> str:
return f"/resourcegroups/{self.name}"

def resource(self, provider: str, res_type: str, name: str) -> Resource:
return Resource(provider, res_type, name, rg=self, sub=self.sub)

def subresource(self, res_type: str, name: str) -> SubResource:
return SubResource(res_type, name, rg=self, sub=self.sub)


@dataclass(frozen=True)
class Resource(AzObj):
Expand All @@ -58,6 +73,12 @@ class Resource(AzObj):
def slug(self) -> str:
return f"/providers/{self.provider}/{self.res_type}/{self.name}"

def resource(self, provider: str, res_type: str, name: str) -> Resource:
return Resource(provider, res_type, name, rg=self.rg, sub=self.sub, parent=self)

def subresource(self, res_type: str, name: str) -> SubResource:
return SubResource(res_type, name, rg=self.rg, sub=self.sub, parent=self)


@dataclass(frozen=True)
class SubResource(AzObj):
Expand All @@ -72,6 +93,12 @@ class SubResource(AzObj):
def slug(self) -> str:
return f"/{self.res_type}/{self.name}"

def resource(self, provider: str, res_type: str, name: str) -> Resource:
return Resource(provider, res_type, name, rg=self.rg, sub=self.sub, parent=self)

def subresource(self, res_type: str, name: str) -> SubResource:
return SubResource(res_type, name, rg=self.rg, sub=self.sub, parent=self)


def parse(rid: str) -> AzObj:
"""Parse an Azure resource ID into the Azure Resource it represents and its chain of parents"""
Expand Down
8 changes: 5 additions & 3 deletions llamazure/tf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ python_test_utils(
python_distribution(
name="llamazure.tf",
repositories=["@llamazure.tf"],
dependencies=[":tf"],
dependencies=[":tf", ":py.typed"],
long_description_path="llamazure/tf/readme.md",
provides=python_artifact(
name="llamazure.tf",
version="0.2.0",
version="0.2.1",
description="Generate some azurerm resources without the headache",
author="Daniel Goldman",
maintainer="Daniel Goldman",
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
"Topic :: Internet :: Log Analysis",
],
Expand All @@ -41,3 +41,5 @@ python_distribution(
long_description_content_type="text/markdown",
),
)

resource(name="py.typed", source="py.typed")
Loading
Loading