3
0
Fork 0

Compare commits

...

2 commits

Author SHA1 Message Date
a6e8e12156 bump: version 0.28.1 → 0.28.2 2025-12-31 20:24:14 -06:00
18c23ce0ce 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
2025-12-31 20:23:00 -06:00
4 changed files with 29 additions and 2 deletions

View file

@ -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/) 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). 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) ## v0.28.1 (2025-12-31)
### Fix ### Fix

View file

@ -6,7 +6,7 @@ build-backend = "hatchling.build"
[project] [project]
name = "WuttJamaican" name = "WuttJamaican"
version = "0.28.1" version = "0.28.2"
description = "Base package for Wutta Framework" description = "Base package for Wutta Framework"
readme = "README.md" readme = "README.md"
authors = [{name = "Lance Edgar", email = "lance@wuttaproject.org"}] authors = [{name = "Lance Edgar", email = "lance@wuttaproject.org"}]

View file

@ -298,6 +298,9 @@ class InstallHandler(GenericHandler):
""" """
envname = os.path.basename(sys.prefix) envname = os.path.basename(sys.prefix)
appdir = os.path.join(sys.prefix, "app") appdir = os.path.join(sys.prefix, "app")
dburl = dbinfo["dburl"]
if not isinstance(dburl, str):
dburl = dburl.render_as_string(hide_password=False)
context = { context = {
"envdir": sys.prefix, "envdir": sys.prefix,
"envname": envname, "envname": envname,
@ -305,7 +308,7 @@ class InstallHandler(GenericHandler):
"app_title": self.app_title, "app_title": self.app_title,
"pypi_name": self.pypi_name, "pypi_name": self.pypi_name,
"appdir": appdir, "appdir": appdir,
"db_url": dbinfo["dburl"], "db_url": dburl,
"egg_name": self.egg_name, "egg_name": self.egg_name,
} }
context.update(kwargs) context.update(kwargs)

View file

@ -170,6 +170,8 @@ class TestInstallHandler(ConfigTestCase):
def test_make_template_context(self): def test_make_template_context(self):
handler = self.make_handler() handler = self.make_handler()
# can handle dburl as string
dbinfo = {"dburl": "sqlite:///poser.sqlite"} dbinfo = {"dburl": "sqlite:///poser.sqlite"}
context = handler.make_template_context(dbinfo) context = handler.make_template_context(dbinfo)
self.assertEqual(context["envdir"], sys.prefix) 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["appdir"], os.path.join(sys.prefix, "app"))
self.assertEqual(context["db_url"], "sqlite:///poser.sqlite") 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): def test_make_appdir(self):
handler = self.make_handler() handler = self.make_handler()
handler.templates = TemplateLookup( handler.templates = TemplateLookup(