From 2d5ffa978b60fbf2ad4123d39c928c23865f4c9e Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Wed, 23 Oct 2024 15:35:51 +0200 Subject: [PATCH 1/3] feature: use pipenv sync instead of install pipenv sync does installation by looking at the Pipfile.lock, and it verifies package hashed. It should be the prefered way to install packages in a deployment environment. Signed-off-by: Oz Tiram --- internal/question/build_steps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/question/build_steps.go b/internal/question/build_steps.go index e59e94e..5a3529d 100644 --- a/internal/question/build_steps.go +++ b/internal/question/build_steps.go @@ -40,7 +40,7 @@ func (q *BuildSteps) Ask(ctx context.Context) error { "# Install Pipenv as a global tool", "python -m venv /app/.global", "pip install pipenv==$PIPENV_TOOL_VERSION", - "pipenv install", + "pipenv sync", ) case models.Pip: answers.BuildSteps = append( From e2bab4f27c97477828a851dfc0d302f0c0eec056 Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Wed, 23 Oct 2024 16:17:30 +0200 Subject: [PATCH 2/3] Bump poetry and pipenv versions Signed-off-by: Oz Tiram --- internal/question/environment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/question/environment.go b/internal/question/environment.go index ccd0247..b11d8e3 100644 --- a/internal/question/environment.go +++ b/internal/question/environment.go @@ -18,10 +18,10 @@ func (q *Environment) Ask(ctx context.Context) error { for _, dm := range answers.DependencyManagers { switch dm { case models.Poetry: - answers.Environment["POETRY_VERSION"] = "1.4.0" + answers.Environment["POETRY_VERSION"] = "1.8.4" answers.Environment["POETRY_VIRTUALENVS_IN_PROJECT"] = "true" case models.Pipenv: - answers.Environment["PIPENV_TOOL_VERSION"] = "2023.2.18" + answers.Environment["PIPENV_TOOL_VERSION"] = "2024.2.0" answers.Environment["PIPENV_VENV_IN_PROJECT"] = "1" } } From 6b64d4bcb4333a35ec683245de6c09a7dbe6218b Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Thu, 24 Oct 2024 08:34:30 +0200 Subject: [PATCH 3/3] chore: remove out python3.6> block This removed block was for versions older than python3.5. None of these versions are supported by upsun. Signed-off-by: Oz Tiram --- platformifier/templates/django/settings_psh.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/platformifier/templates/django/settings_psh.py b/platformifier/templates/django/settings_psh.py index a841266..f865eff 100644 --- a/platformifier/templates/django/settings_psh.py +++ b/platformifier/templates/django/settings_psh.py @@ -22,10 +22,7 @@ def decode(variable): JSON decoding error. """ try: - if sys.version_info[1] > 5: - return json.loads(base64.b64decode(variable)) - else: - return json.loads(base64.b64decode(variable).decode("utf-8")) + return json.loads(base64.b64decode(variable)) except json.decoder.JSONDecodeError: print("Error decoding JSON, code %d", json.decoder.JSONDecodeError)