Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
davorrunje committed Nov 8, 2024
1 parent 840d9b0 commit 0e7ec32
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
shutil.rmtree(p, ignore_errors=True)
else:
os.unlink(p)

# run linter to fix any formatting issues
cmd = "./scripts/lint.sh"
os.system(cmd)
2 changes: 2 additions & 0 deletions scripts/test_cookiecutter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ cd generated/$1-$2-$3/my_fastagency_app && pip install -e .[dev] && cd ../../..
# Initialize git in the generated project(needed for pre-commit)
echo -e "\033[32mInitializing git in the generated project\033[0m"
cd generated/$1-$2-$3/my_fastagency_app && git init && git add . && cd ../../..
# uncomment this for debugging
# cd generated/$1-$2-$3/my_fastagency_app && git commit -m "init" --no-verify && cd ../../..

# Run pre-commit
echo -e "\033[32mRunning pre-commit\033[0m"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from fastagency.adapters.fastapi import FastAPIAdapter
{% if cookiecutter.authentication == "google" %}
from fastagency.ui.mesop.auth.firebase import FirebaseAuth, FirebaseConfig
{% endif %}
from fastagency.app import FastAgency
from fastagency.ui.mesop import MesopUI
{% if cookiecutter.authentication == "google" %}
from pathlib import Path

import yaml
{% endif %}
from fastagency.adapters.fastapi import FastAPIAdapter
from fastagency.app import FastAgency
from fastagency.ui.mesop import MesopUI{% if cookiecutter.authentication == "google" %}
from fastagency.ui.mesop.auth.firebase import FirebaseAuth, FirebaseConfig{% endif %}

fastapi_url = "http://localhost:8008"

Expand All @@ -15,8 +15,11 @@
)

{% if cookiecutter.authentication == "google" %}
firebase_config = FirebaseConfig(**yaml.safe_load(open("firebase_config.yaml")))
allowed_users = yaml.safe_load(open("allowed_users.yaml"))
with Path("firebase_config.yaml").open() as f:
firebase_config = FirebaseConfig(**yaml.safe_load(f))
with Path("allowed_users.yaml").open() as f:
allowed_users = yaml.safe_load(f)

auth = FirebaseAuth(
sign_in_methods=["google"],
config=firebase_config,
Expand Down

0 comments on commit 0e7ec32

Please sign in to comment.