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
4 changes: 4 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ jobs:
publish:
needs: check
runs-on: ubuntu-latest
environment:
name: pypi
# optionally, point to the URL of the deployed package:
url: https://pypi.org/project/adaptive-cards-python/
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: ci
on:
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion adaptive_cards_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
"post_to_webhook",
"create_payload",
"Payload",
"__version__"
"__version__",
]
1 change: 0 additions & 1 deletion adaptive_cards_python/adaptive_card/AdaptiveCard.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ def to_json(self) -> str:
return self.model_dump_json(exclude_none=True)



class Refresh(ConfiguredBaseModel):
"""
Defines how a card can be refreshed by making a request to the target Bot.
Expand Down
1 change: 0 additions & 1 deletion adaptive_cards_python/adaptive_card/Extendable.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations # Required to defer type hint evaluation!

from typing import Any

from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
Expand Down
8 changes: 3 additions & 5 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ def test_construct_card():
)
)

card = AdaptiveCard(
type="AdaptiveCard", version="1.5", body=body, actions=actions_list
)
AdaptiveCard(type="AdaptiveCard", version="1.5", body=body, actions=actions_list)


def contruct_from_dict():
updatable_card = AdaptiveCard.model_validate(
AdaptiveCard.model_validate(
{
"type": "AdaptiveCard",
"version": "1.5",
Expand Down Expand Up @@ -193,4 +191,4 @@ def test_construct_from_json_string():
]
}
"""
approvable_card = AdaptiveCard.model_validate_json(card_json)
AdaptiveCard.model_validate_json(card_json)
5 changes: 4 additions & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"""Check that basic version functionality works"""

from adaptive_cards_python import __version__ as package_version


def test_package_version():
assert package_version != ""
assert isinstance(package_version, str)
assert package_version.count(".")==2
assert package_version.count(".") == 2


if __name__ == "__main__":
test_package_version()