Skip to content

Commit

Permalink
Add script to generate replay files and generated replay files
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Nov 8, 2024
1 parent 4718d26 commit 29ac11a
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cookiecutter_replay/fastapi+mesop_3.10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "fastapi+mesop",
"python_version": "3.10"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/fastapi+mesop_3.11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "fastapi+mesop",
"python_version": "3.11"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/fastapi+mesop_3.12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "fastapi+mesop",
"python_version": "3.12"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/mesop_3.10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "mesop",
"python_version": "3.10"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/mesop_3.11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "mesop",
"python_version": "3.11"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/mesop_3.12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "mesop",
"python_version": "3.12"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/nats+fastapi+mesop_3.10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "nats+fastapi+mesop",
"python_version": "3.10"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/nats+fastapi+mesop_3.11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "nats+fastapi+mesop",
"python_version": "3.11"
}
}
8 changes: 8 additions & 0 deletions cookiecutter_replay/nats+fastapi+mesop_3.12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cookiecutter": {
"project_name": "My FastAgency App",
"project_slug": "my_fastagency_app",
"app_type": "nats+fastapi+mesop",
"python_version": "3.12"
}
}
33 changes: 33 additions & 0 deletions scripts/generate_cookiecutter_replay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import json
from pathlib import Path

PROJECT_NAME = "My FastAgency App"
PROJECT_SLUG = "my_fastagency_app"

APP_TYPES = ["fastapi+mesop", "mesop", "nats+fastapi+mesop"]

PYTHON_VERSIONS = ["3.12", "3.11", "3.10"]


def generate_cookiecutter_replay():
for app_type in APP_TYPES:
for python_version in PYTHON_VERSIONS:
print(f"Generating cookiecutter replay for {app_type} with Python {python_version}")
cookiecutter_replay = {
"cookiecutter": {
"project_name": PROJECT_NAME,
"project_slug": PROJECT_SLUG,
"app_type": app_type,
"python_version": python_version,
}
}

# Write to cookiecutter replay file
replay_file = Path(__file__).parent.parent.resolve() / "cookiecutter_replay" / f"{app_type}_{python_version}.json"

with open(replay_file, "w") as f:
json.dump(cookiecutter_replay, f, indent=4)


if __name__ == "__main__":
generate_cookiecutter_replay()
3 changes: 3 additions & 0 deletions scripts/generate_cookiecutter_replay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

python3 scripts/generate_cookiecutter_replay.py

0 comments on commit 29ac11a

Please sign in to comment.