Skip to content

Commit

Permalink
update python
Browse files Browse the repository at this point in the history
chriskapp committed Nov 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 05a164f commit 109d005
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ jobs:
NAMESPACE: ""
run: cd ../../ && docker compose up
- name: Move
run: mv ../../output/*.py .
run: mv ../../output/*.py ./gen
- name: Run
run: python main.py
rust:
Empty file added integration/python/gen/.gitkeep
Empty file.
17 changes: 12 additions & 5 deletions integration/python/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import json
from pathlib import Path
from .news import News
from gen.news import News

input = Path('../input.json').read_text()

news = News.model_validate_json(input)
def main():
input = Path('../input.json').read_text()

output = json.dumps(news)
news = News.model_validate_json(input)

output = news.model_dump_json()

Path('../output.json').write_text(output)


if __name__ == '__main__':
main()

Path('../output.json').write_text(output)

0 comments on commit 109d005

Please sign in to comment.