diff --git a/.gitignore b/.gitignore index 09fa8e6..3283ae3 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,5 @@ sonarqube/logs .terraform -my_app \ No newline at end of file +my_app +backend2 \ No newline at end of file diff --git a/create_fastapi_project/templates/__init__.py b/create_fastapi_project/templates/__init__.py index 05b4486..1a2897d 100644 --- a/create_fastapi_project/templates/__init__.py +++ b/create_fastapi_project/templates/__init__.py @@ -37,14 +37,11 @@ def install_template(root: str, template: ITemplate, app_name: str): dirs_exist_ok=True, ) - poetry_path = "" - if template == ITemplate.full or template == ITemplate.langchain_basic: + poetry_path = os.path.join(root, "backend", "app") + if template == ITemplate.langchain_basic: # TODO: CHECK PATHS IN MACOS AND WINDOWS | (os.path.join) poetry_frontend_path = os.path.join(root, "frontend", "app") - - else: - poetry_path = os.path.join(root, "backend", "app") - + has_pyproject = add_configuration_to_pyproject(poetry_path) if has_pyproject: @@ -114,6 +111,8 @@ def install_template(root: str, template: ITemplate, app_name: str): dev_dependencies.extend(full_dev_dependencies) print("- Installing main packages. This might take a couple of minutes.") + print("poetry_path", poetry_path) + print("template", template) install_dependencies(poetry_path, dependencies) print("- Installing development packages. This might take a couple of minutes.") install_dependencies(poetry_path, dev_dependencies, dev=True) diff --git a/create_fastapi_project/templates/basic/Makefile b/create_fastapi_project/templates/basic/Makefile index e95a107..1d71a22 100644 --- a/create_fastapi_project/templates/basic/Makefile +++ b/create_fastapi_project/templates/basic/Makefile @@ -30,7 +30,7 @@ help: @echo " Lint code with ruff and try to fix." install: - cd backend/app && poetry install && cd .. + cd backend/app && poetry install && cd ../.. run-app: cd backend/app && poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 && cd .. diff --git a/create_fastapi_project/templates/full/Makefile b/create_fastapi_project/templates/full/Makefile index e804303..0c62626 100644 --- a/create_fastapi_project/templates/full/Makefile +++ b/create_fastapi_project/templates/full/Makefile @@ -60,9 +60,7 @@ help: @echo " Stops Sonarqube container." install: - cd backend/app && \ - poetry shell && \ - poetry install + cd backend/app && poetry install && cd ../.. run-dev-build: docker compose -f docker-compose-dev.yml up --build diff --git a/create_fastapi_project/templates/full/backend/app/README.md b/create_fastapi_project/templates/full/backend/app/README.md new file mode 100644 index 0000000..e69de29 diff --git a/create_fastapi_project/templates/langchain_basic/Makefile b/create_fastapi_project/templates/langchain_basic/Makefile index 7a2c1b8..1d71a22 100644 --- a/create_fastapi_project/templates/langchain_basic/Makefile +++ b/create_fastapi_project/templates/langchain_basic/Makefile @@ -30,10 +30,10 @@ help: @echo " Lint code with ruff and try to fix." install: - cd app && poetry install && cd .. + cd backend/app && poetry install && cd ../.. run-app: - cd app && poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 && cd .. + cd backend/app && poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 && cd .. run-dev-build: diff --git a/pyproject.toml b/pyproject.toml index bc5b134..d46cda9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "create-fastapi-project" -version = "0.2.2" +version = "0.2.3" description = "" authors = ["jonra1993 "] readme = "README.md"