diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index b4d19bf..b20d00f 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -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: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4731cc8..92130d6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,10 @@ name: ci on: pull_request: +permissions: + contents: read + pull-requests: write + jobs: test: runs-on: ubuntu-latest diff --git a/adaptive_cards_python/__init__.py b/adaptive_cards_python/__init__.py index 299630e..8be8a67 100644 --- a/adaptive_cards_python/__init__.py +++ b/adaptive_cards_python/__init__.py @@ -18,5 +18,5 @@ "post_to_webhook", "create_payload", "Payload", - "__version__" + "__version__", ] diff --git a/adaptive_cards_python/adaptive_card/AdaptiveCard.py b/adaptive_cards_python/adaptive_card/AdaptiveCard.py index 64b90ee..599c2b8 100644 --- a/adaptive_cards_python/adaptive_card/AdaptiveCard.py +++ b/adaptive_cards_python/adaptive_card/AdaptiveCard.py @@ -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. diff --git a/adaptive_cards_python/adaptive_card/Extendable.py b/adaptive_cards_python/adaptive_card/Extendable.py index fef4ec5..ea9dab5 100644 --- a/adaptive_cards_python/adaptive_card/Extendable.py +++ b/adaptive_cards_python/adaptive_card/Extendable.py @@ -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 diff --git a/tests/test_validation.py b/tests/test_validation.py index dae4852..188eca9 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -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", @@ -193,4 +191,4 @@ def test_construct_from_json_string(): ] } """ - approvable_card = AdaptiveCard.model_validate_json(card_json) + AdaptiveCard.model_validate_json(card_json) diff --git a/tests/test_version.py b/tests/test_version.py index abd57f7..2fbccf2 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -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()