From 684137a395db20a27cfa1ca0213f66526ffc7f1b Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Thu, 30 Nov 2023 17:59:19 -0500 Subject: [PATCH 1/8] adds 3.12 support to the project --- .github/workflows/test.yml | 2 +- {{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev | 2 +- {{cookiecutter.__src_folder_name}}/.github/workflows/format.yml | 2 +- {{cookiecutter.__src_folder_name}}/infra/main.bicep | 2 +- {{cookiecutter.__src_folder_name}}/src/Dockerfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1f51da..a8fd16f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 cache: 'pip' - name: Test run: | diff --git a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev index feaa2e3..04a8805 100644 --- a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev +++ b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye +FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ diff --git a/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml b/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml index 26dcb0f..910d41d 100644 --- a/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml +++ b/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.12 cache: 'pip' - name: Install dependencies run: | diff --git a/{{cookiecutter.__src_folder_name}}/infra/main.bicep b/{{cookiecutter.__src_folder_name}}/infra/main.bicep index 7dbe7ff..fb2e652 100644 --- a/{{cookiecutter.__src_folder_name}}/infra/main.bicep +++ b/{{cookiecutter.__src_folder_name}}/infra/main.bicep @@ -119,7 +119,7 @@ module web 'web.bicep' = { keyVaultName: keyVault.outputs.name {% if cookiecutter.project_host == "appservice" %} appCommandLine: 'entrypoint.sh' - pythonVersion: '3.11' + pythonVersion: '3.12' {% endif %} {% if cookiecutter.project_host == "aca" %} identityName: '${prefix}-id-web' diff --git a/{{cookiecutter.__src_folder_name}}/src/Dockerfile b/{{cookiecutter.__src_folder_name}}/src/Dockerfile index 6c793a2..9a401aa 100644 --- a/{{cookiecutter.__src_folder_name}}/src/Dockerfile +++ b/{{cookiecutter.__src_folder_name}}/src/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/python:3.11-bullseye +FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ From c93b7da27c98ff73a9b7000dec5d916eb7c8383a Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 1 Dec 2023 14:48:45 -0500 Subject: [PATCH 2/8] add python version as option --- cookiecutter.json | 1 + {{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev | 2 +- .../.github/workflows/azure-dev.yml | 2 +- {{cookiecutter.__src_folder_name}}/.github/workflows/format.yml | 2 +- {{cookiecutter.__src_folder_name}}/infra/main.bicep | 2 +- {{cookiecutter.__src_folder_name}}/src/Dockerfile | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 434efce..1f0e95c 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -4,6 +4,7 @@ "db_resource": ["postgres-flexible", "cosmos-postgres", "postgres-addon", "cosmos-mongodb"], "project_host": ["aca", "appservice"], "web_port": "8000", + "__python_version": ["3.12","3.11", "3.10", "3.9", "3.8"], "__repo_name": "{{cookiecutter.project_name}}-{{cookiecutter.project_backend}}-{{cookiecutter.db_resource}}-{{cookiecutter.project_host}}", "__src_folder_name": "{{ cookiecutter.__repo_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}", "__project_short_description": "Create a relecloud demo application with {{cookiecutter.project_backend}} and {{cookiecutter.db_resource}}", diff --git a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev index 04a8805..90c3ed4 100644 --- a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev +++ b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye +FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter._python_version}}-bullseye RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ diff --git a/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml b/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml index 3013f96..022fdf7 100644 --- a/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml +++ b/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml @@ -95,7 +95,7 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: 3.12 + python-version: {{cookiecutter.__python_version}} - name: End-to-end smoke tests (playwright) env: diff --git a/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml b/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml index 910d41d..c20ce14 100644 --- a/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml +++ b/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: 3.12 + python-version: {{cookiecutter.__python_version}} cache: 'pip' - name: Install dependencies run: | diff --git a/{{cookiecutter.__src_folder_name}}/infra/main.bicep b/{{cookiecutter.__src_folder_name}}/infra/main.bicep index fb2e652..a58ebaa 100644 --- a/{{cookiecutter.__src_folder_name}}/infra/main.bicep +++ b/{{cookiecutter.__src_folder_name}}/infra/main.bicep @@ -119,7 +119,7 @@ module web 'web.bicep' = { keyVaultName: keyVault.outputs.name {% if cookiecutter.project_host == "appservice" %} appCommandLine: 'entrypoint.sh' - pythonVersion: '3.12' + pythonVersion: '{{cookiecutter.__python_version}}' {% endif %} {% if cookiecutter.project_host == "aca" %} identityName: '${prefix}-id-web' diff --git a/{{cookiecutter.__src_folder_name}}/src/Dockerfile b/{{cookiecutter.__src_folder_name}}/src/Dockerfile index 9a401aa..890f9e4 100644 --- a/{{cookiecutter.__src_folder_name}}/src/Dockerfile +++ b/{{cookiecutter.__src_folder_name}}/src/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye +FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter.__python_version}}-bullseye RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ From 1b9d1205af82f11955c605c316f3d102be9e26c3 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 1 Dec 2023 14:55:49 -0500 Subject: [PATCH 3/8] fix syntax error with python version --- {{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev index 90c3ed4..4f86984 100644 --- a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev +++ b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter._python_version}}-bullseye +FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter.__python_version}}-bullseye RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ From be2a4e1c5d607c49cca559d5190ff9b41be99dab Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 1 Dec 2023 15:05:39 -0500 Subject: [PATCH 4/8] removes __python_version from workflows --- .../.github/workflows/azure-dev.yml | 2 +- {{cookiecutter.__src_folder_name}}/.github/workflows/cruft.yml | 2 +- {{cookiecutter.__src_folder_name}}/.github/workflows/format.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml b/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml index 022fdf7..3013f96 100644 --- a/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml +++ b/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml @@ -95,7 +95,7 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: {{cookiecutter.__python_version}} + python-version: 3.12 - name: End-to-end smoke tests (playwright) env: diff --git a/{{cookiecutter.__src_folder_name}}/.github/workflows/cruft.yml b/{{cookiecutter.__src_folder_name}}/.github/workflows/cruft.yml index 6910276..2fed35b 100644 --- a/{{cookiecutter.__src_folder_name}}/.github/workflows/cruft.yml +++ b/{{cookiecutter.__src_folder_name}}/.github/workflows/cruft.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.12" - name: Install Cruft run: pip3 install -r requirements-dev.txt diff --git a/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml b/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml index c20ce14..910d41d 100644 --- a/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml +++ b/{{cookiecutter.__src_folder_name}}/.github/workflows/format.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: {{cookiecutter.__python_version}} + python-version: 3.12 cache: 'pip' - name: Install dependencies run: | From 3c79f0c61b1db801d32a4b3dd4618f255b503194 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 1 Dec 2023 15:12:22 -0500 Subject: [PATCH 5/8] make option for __python_version string --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 1f0e95c..51c562b 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -4,7 +4,7 @@ "db_resource": ["postgres-flexible", "cosmos-postgres", "postgres-addon", "cosmos-mongodb"], "project_host": ["aca", "appservice"], "web_port": "8000", - "__python_version": ["3.12","3.11", "3.10", "3.9", "3.8"], + "__python_version": "3.12", "__repo_name": "{{cookiecutter.project_name}}-{{cookiecutter.project_backend}}-{{cookiecutter.db_resource}}-{{cookiecutter.project_host}}", "__src_folder_name": "{{ cookiecutter.__repo_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}", "__project_short_description": "Create a relecloud demo application with {{cookiecutter.project_backend}} and {{cookiecutter.db_resource}}", From 77727ec82809620f4c1ad9e6708c7c411b8210b9 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 1 Dec 2023 15:36:53 -0500 Subject: [PATCH 6/8] make python_version --- cookiecutter.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 51c562b..845dda3 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,10 +1,10 @@ { "project_name": "azure", + "python_version": ["3.12", "3.11", "3.10", "3.9", "3.8"], "project_backend": ["django", "fastapi", "flask"], "db_resource": ["postgres-flexible", "cosmos-postgres", "postgres-addon", "cosmos-mongodb"], "project_host": ["aca", "appservice"], "web_port": "8000", - "__python_version": "3.12", "__repo_name": "{{cookiecutter.project_name}}-{{cookiecutter.project_backend}}-{{cookiecutter.db_resource}}-{{cookiecutter.project_host}}", "__src_folder_name": "{{ cookiecutter.__repo_name.lower()|replace(' ', '_')|replace('-', '_')|replace('.', '_')|trim() }}", "__project_short_description": "Create a relecloud demo application with {{cookiecutter.project_backend}} and {{cookiecutter.db_resource}}", @@ -21,6 +21,7 @@ }, "__prompts__": { "project_name": "Name prefix of your project?", + "python_version": "Python Version?", "project_backend": { "__prompt__": "Choose a Web Framework", "django": "Django", From 9774534153c6e8eb131dd07567ca12f99c57a494 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 1 Dec 2023 15:41:17 -0500 Subject: [PATCH 7/8] make variables public --- {{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev | 2 +- {{cookiecutter.__src_folder_name}}/infra/main.bicep | 2 +- {{cookiecutter.__src_folder_name}}/src/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev index 4f86984..d6240a8 100644 --- a/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev +++ b/{{cookiecutter.__src_folder_name}}/.devcontainer/Dockerfile_dev @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter.__python_version}}-bullseye +FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter.python_version}}-bullseye RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ diff --git a/{{cookiecutter.__src_folder_name}}/infra/main.bicep b/{{cookiecutter.__src_folder_name}}/infra/main.bicep index a58ebaa..b8bfe82 100644 --- a/{{cookiecutter.__src_folder_name}}/infra/main.bicep +++ b/{{cookiecutter.__src_folder_name}}/infra/main.bicep @@ -119,7 +119,7 @@ module web 'web.bicep' = { keyVaultName: keyVault.outputs.name {% if cookiecutter.project_host == "appservice" %} appCommandLine: 'entrypoint.sh' - pythonVersion: '{{cookiecutter.__python_version}}' + pythonVersion: '{{cookiecutter.python_version}}' {% endif %} {% if cookiecutter.project_host == "aca" %} identityName: '${prefix}-id-web' diff --git a/{{cookiecutter.__src_folder_name}}/src/Dockerfile b/{{cookiecutter.__src_folder_name}}/src/Dockerfile index 890f9e4..eca6de1 100644 --- a/{{cookiecutter.__src_folder_name}}/src/Dockerfile +++ b/{{cookiecutter.__src_folder_name}}/src/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter.__python_version}}-bullseye +FROM mcr.microsoft.com/devcontainers/python:{{cookiecutter.python_version}}-bullseye RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends postgresql-client \ From daf337f2059b8b6d8e3c4ea08f0d9464fb5b1509 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 1 Dec 2023 15:56:43 -0500 Subject: [PATCH 8/8] update azure-dev.yml --- .../.github/workflows/azure-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml b/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml index 3013f96..952f655 100644 --- a/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml +++ b/{{cookiecutter.__src_folder_name}}/.github/workflows/azure-dev.yml @@ -5,7 +5,7 @@ on: push: branches: - main - - cruft/update + - cruft/update* # GitHub Actions workflow to deploy to Azure using azd # To configure required secrets for connecting to Azure, simply run `azd pipeline config`