Skip to content

Commit 6e663bb

Browse files
authored
Merge pull request #1 from emirkmo/add-pypi-environment
Add pypi environment for publish job
2 parents 1e68a41 + 7f5083a commit 6e663bb

7 files changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/cd.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ jobs:
9090
publish:
9191
needs: check
9292
runs-on: ubuntu-latest
93+
environment:
94+
name: pypi
95+
# optionally, point to the URL of the deployed package:
96+
url: https://pypi.org/project/adaptive-cards-python/
9397
steps:
9498
- uses: actions/checkout@v4
9599
with:

.github/workflows/ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: ci
33
on:
44
pull_request:
55

6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
610
jobs:
711
test:
812
runs-on: ubuntu-latest

adaptive_cards_python/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"post_to_webhook",
1919
"create_payload",
2020
"Payload",
21-
"__version__"
21+
"__version__",
2222
]

adaptive_cards_python/adaptive_card/AdaptiveCard.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ def to_json(self) -> str:
237237
return self.model_dump_json(exclude_none=True)
238238

239239

240-
241240
class Refresh(ConfiguredBaseModel):
242241
"""
243242
Defines how a card can be refreshed by making a request to the target Bot.

adaptive_cards_python/adaptive_card/Extendable.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations # Required to defer type hint evaluation!
22

3-
from typing import Any
43

54
from pydantic import BaseModel, ConfigDict, Field
65
from pydantic.alias_generators import to_camel

tests/test_validation.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,11 @@ def test_construct_card():
117117
)
118118
)
119119

120-
card = AdaptiveCard(
121-
type="AdaptiveCard", version="1.5", body=body, actions=actions_list
122-
)
120+
AdaptiveCard(type="AdaptiveCard", version="1.5", body=body, actions=actions_list)
123121

124122

125123
def contruct_from_dict():
126-
updatable_card = AdaptiveCard.model_validate(
124+
AdaptiveCard.model_validate(
127125
{
128126
"type": "AdaptiveCard",
129127
"version": "1.5",
@@ -193,4 +191,4 @@ def test_construct_from_json_string():
193191
]
194192
}
195193
"""
196-
approvable_card = AdaptiveCard.model_validate_json(card_json)
194+
AdaptiveCard.model_validate_json(card_json)

tests/test_version.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
"""Check that basic version functionality works"""
2+
23
from adaptive_cards_python import __version__ as package_version
34

5+
46
def test_package_version():
57
assert package_version != ""
68
assert isinstance(package_version, str)
7-
assert package_version.count(".")==2
9+
assert package_version.count(".") == 2
10+
811

912
if __name__ == "__main__":
1013
test_package_version()

0 commit comments

Comments
 (0)