From 18c23ce0ce14831f2d9c517c557ca7d4c83ef882 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 31 Dec 2025 20:04:49 -0600 Subject: [PATCH 1/2] fix: render db engine with password intact, for installer config not sure when things changed, pretty sure this is a new thing? hopefully doesn't break anything since the installer is likely dealing with "latest" sqlalchemy --- src/wuttjamaican/install.py | 5 ++++- tests/test_install.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/wuttjamaican/install.py b/src/wuttjamaican/install.py index 5077644..395a4a9 100644 --- a/src/wuttjamaican/install.py +++ b/src/wuttjamaican/install.py @@ -298,6 +298,9 @@ class InstallHandler(GenericHandler): """ envname = os.path.basename(sys.prefix) appdir = os.path.join(sys.prefix, "app") + dburl = dbinfo["dburl"] + if not isinstance(dburl, str): + dburl = dburl.render_as_string(hide_password=False) context = { "envdir": sys.prefix, "envname": envname, @@ -305,7 +308,7 @@ class InstallHandler(GenericHandler): "app_title": self.app_title, "pypi_name": self.pypi_name, "appdir": appdir, - "db_url": dbinfo["dburl"], + "db_url": dburl, "egg_name": self.egg_name, } context.update(kwargs) diff --git a/tests/test_install.py b/tests/test_install.py index a58725f..603485c 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -170,6 +170,8 @@ class TestInstallHandler(ConfigTestCase): def test_make_template_context(self): handler = self.make_handler() + + # can handle dburl as string dbinfo = {"dburl": "sqlite:///poser.sqlite"} context = handler.make_template_context(dbinfo) self.assertEqual(context["envdir"], sys.prefix) @@ -180,6 +182,22 @@ class TestInstallHandler(ConfigTestCase): self.assertEqual(context["appdir"], os.path.join(sys.prefix, "app")) self.assertEqual(context["db_url"], "sqlite:///poser.sqlite") + try: + import sqlalchemy as sa + except ImportError: + pytest.skip("remainder of test is not relevant without sqlalchemy") + + # but also can handle dburl as object + dbinfo = {"dburl": sa.create_engine("sqlite:///poser.sqlite").url} + context = handler.make_template_context(dbinfo) + self.assertEqual(context["envdir"], sys.prefix) + self.assertEqual(context["pkg_name"], "poser") + self.assertEqual(context["app_title"], "poser") + self.assertEqual(context["pypi_name"], "poser") + self.assertEqual(context["egg_name"], "poser") + self.assertEqual(context["appdir"], os.path.join(sys.prefix, "app")) + self.assertEqual(context["db_url"], "sqlite:///poser.sqlite") + def test_make_appdir(self): handler = self.make_handler() handler.templates = TemplateLookup( From a6e8e121567ee71dca5f27d81baa8fd29832a04a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 31 Dec 2025 20:24:14 -0600 Subject: [PATCH 2/2] =?UTF-8?q?bump:=20version=200.28.1=20=E2=86=92=200.28?= =?UTF-8?q?.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4483972..35d527e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to WuttJamaican will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## v0.28.2 (2025-12-31) + +### Fix + +- render db engine with password intact, for installer config + ## v0.28.1 (2025-12-31) ### Fix diff --git a/pyproject.toml b/pyproject.toml index a8c75f8..7ac1f4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "WuttJamaican" -version = "0.28.1" +version = "0.28.2" description = "Base package for Wutta Framework" readme = "README.md" authors = [{name = "Lance Edgar", email = "lance@wuttaproject.org"}]