Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up package structure + add new update functionality #45

Merged
merged 42 commits into from
Mar 22, 2025
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
03c952f
Use proper .gitignore file
Mar 10, 2025
468133b
Implement update method and change result handling
Mar 13, 2025
c8a1823
Switch to uv for environment management
Mar 13, 2025
b2fb99b
Add rules and change default python version
Mar 13, 2025
957dc73
Fix merging issues after rebase
dennis6p Mar 13, 2025
bf0ad11
Fi x formatting issues
dennis6p Mar 14, 2025
9240aa8
Union with string not allowed in >python3.10
dennis6p Mar 14, 2025
0dbd109
Run build and publish also for dev
dennis6p Mar 16, 2025
53a38a2
Debug pyproject.toml
dennis6p Mar 16, 2025
94ef310
Don't update version number
dennis6p Mar 16, 2025
9078996
Fix url
dennis6p Mar 16, 2025
456535d
check url to handle duplication error
dennis6p Mar 16, 2025
df29a67
Use caching for uv setup
dennis6p Mar 16, 2025
636b83f
Debug command
dennis6p Mar 16, 2025
b0fe1eb
Use index url
dennis6p Mar 16, 2025
b5a654a
Check dist content
dennis6p Mar 16, 2025
0018a75
Use specific build folder
dennis6p Mar 16, 2025
3948f78
Use trusted publishing
dennis6p Mar 16, 2025
8fd2174
debug issue
dennis6p Mar 16, 2025
fa10379
Use trusted publisher environment
dennis6p Mar 16, 2025
36bcbde
Add permissions
dennis6p Mar 16, 2025
8c7ddb8
Use environments for deployment
dennis6p Mar 16, 2025
41fd1ec
Check url in case version exists
dennis6p Mar 16, 2025
3312acd
Needs build running in advance
dennis6p Mar 16, 2025
6ffebea
Increment version based on latest one for test
dennis6p Mar 16, 2025
bfd7c33
Remove ids
dennis6p Mar 16, 2025
5634352
Adapt card fields according to pydantic rules
dennis6p Mar 18, 2025
7b5a750
Enable tests again
dennis6p Mar 18, 2025
8b3372a
Remove useless fixture
dennis6p Mar 18, 2025
00aff3c
Add tests for actions
dennis6p Mar 19, 2025
213db61
Implement proper update mechanism for items and actions
dennis6p Mar 19, 2025
135c31e
Add update card example
dennis6p Mar 19, 2025
c6b60dc
Update README file according to changes
dennis6p Mar 19, 2025
a84fd76
Fix wrong info in README
dennis6p Mar 19, 2025
9568919
Execute test properly
dennis6p Mar 19, 2025
919b36e
Add tests for teams client
dennis6p Mar 22, 2025
e99dd31
move pytest to dev dependencies
dennis6p Mar 22, 2025
03db2cf
Setup example for card validation
dennis6p Mar 22, 2025
f919e8a
Fix wrong import in README example
dennis6p Mar 22, 2025
d5b4e74
Remove unused imports
dennis6p Mar 22, 2025
10c951b
Fix wrong grammar
dennis6p Mar 22, 2025
3e7751b
Use different term
dennis6p Mar 22, 2025
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
Prev Previous commit
Next Next commit
Switch to uv for environment management
edd2abt authored and dennis6p committed Mar 13, 2025
commit c8a182302d233c3d1f716aed6d8ee9ee0c74078e
50 changes: 27 additions & 23 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -11,28 +11,32 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install uv for package management
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
python -m pip install --upgrade pip
uv pip install --system ruff
uv pip install --system -r pyproject.toml

- uses: chartboost/ruff-action@v1

- name: Test with pytest
run: |
uv run tests/*.py
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install uv for package management
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
python -m pip install --upgrade pip
uv pip install --system ruff
uv pip install --system -r pyproject.toml

- uses: chartboost/ruff-action@v1

- name: Test with pytest
run: |
uv run tests/*.py

- name: Build package
run: |
uv build
54 changes: 28 additions & 26 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -17,32 +17,34 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Update version in pyproject.toml
id: update_version
run: |
echo "Updating version in pyproject.toml"
TAG_NAME=${GITHUB_REF##*/} # Get the tag name from GITHUB_REF
# Optionally, you may want to sanitize TAG_NAME (remove 'v' prefix, etc.)
sed -i "s/version = \".*\"/version = \"${TAG_NAME}\"/" pyproject.toml

- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Update version in pyproject.toml
id: update_version
run: |
echo "Updating version in pyproject.toml"
TAG_NAME=${GITHUB_REF##*/} # Get the tag name from GITHUB_REF
# Optionally, you may want to sanitize TAG_NAME (remove 'v' prefix, etc.)
sed -i "s/version = \".*\"/version = \"${TAG_NAME}\"/" pyproject.toml

- name: Build package
run: uv build

- name: Publish package
run: uv publish

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
22 changes: 16 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# pyproject.toml

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "adaptive-cards-py"
version = "0.0.7"
version = "0.2.4"
description = "Python wrapper library for building beautiful adaptive cards"
classifiers = [
"License :: OSI Approved :: MIT License",
@@ -16,11 +12,25 @@ classifiers = [
readme = "README.md"
license = { file = "LICENSE" }
keywords = ["bot", "ui", "adaptivecards", "cards", "adaptivecardsio", "python"]
dependencies = ["dataclasses-json", "requests", "jsonschema"]
dependencies = [
"requests",
"jsonschema",
"pytest>=8.3.5",
"pydantic>=2.10.6",
"mypy>=1.15.0",
"result>=0.17.0",
]
requires-python = ">=3.10"

[project.urls]
Homepage = "https://github.com/dennis6p/adaptive-cards-py"

[tool.setuptools.package-data]
adaptive_cards = ["schemas/*.json"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/adaptive_cards"]
527 changes: 527 additions & 0 deletions uv.lock

Large diffs are not rendered by default.