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 d1b28f0 commit 34d7dc8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 4 additions & 1 deletion scripts/test_cookiecutter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
# The script accepts two positional arguments: app-type and python-version
# The cookiecutter replay file is used to provide the default values for the cookiecutter template

set -o errexit

# Accept two arguments: app-type and python-version
echo -e "\033[32mGenerating project using cookiecutter template with app-type: $1, python-version: $2 and authentication: $3\033[0m"
rm -rf generated/$1-$2-$3
mkdir generated/$1-$2-$3
cookiecutter -f --no-input --output-dir generated/$1-$2-$3/ ./ app_type=$1 python_version=$2 authentication=$3

# Install generated project's dependencies
Expand All @@ -16,7 +19,7 @@ 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 ../../..
cd generated/$1-$2-$3/my_fastagency_app && git init && git add . && git commit -m "init" --no-verify && cd ../../..

# Run pre-commit
echo -e "\033[32mRunning pre-commit\033[0m"
Expand Down
6 changes: 2 additions & 4 deletions {{cookiecutter.project_slug}}/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
"./docker-compose.yml"
],
"service": "python-{{cookiecutter.python_version}}-{{cookiecutter.project_slug}}",
{% if "nats" in cookiecutter.app_type %
}
{% if "nats" in cookiecutter.app_type %}
"forwardPorts": [
"{{cookiecutter.project_slug}}-${containerEnv:CONTAINER_PREFIX}-nats-py{{cookiecutter.python_version.replace('.','')}}:9222"
],
{% endif %
}
{% endif %}
"secrets": {
"OPENAI_API_KEY": {
"description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal."
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ name = "{{cookiecutter.project_slug}}"

dependencies = [
"fastagency[autogen,mesop,server{% if "fastapi" in cookiecutter.app_type %},fastapi{% endif %}{% if "nats" in cookiecutter.app_type %},nats{% endif %}{% if cookiecutter.authentication == "google" %},firebase{% endif %}]>=0.3.0",
{% if cookiecutter.authentication == "google" %}
{% if cookiecutter.authentication == "google" %}
"PyYAML>=6.0.2",
{% endif %}
{% endif %}
]

[project.optional-dependencies]
Expand Down

0 comments on commit 34d7dc8

Please sign in to comment.