diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e22370..c991759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,6 @@ All notable changes to wuttaweb 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.8.1 (2024-08-15) - -### Fix - -- improve backward compat for `util.get_liburl()` - ## v0.8.0 (2024-08-15) ### Feat diff --git a/pyproject.toml b/pyproject.toml index e07c98b..118e712 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" [project] name = "WuttaWeb" -version = "0.8.1" +version = "0.8.0" description = "Web App for Wutta Framework" readme = "README.md" authors = [{name = "Lance Edgar", email = "lance@edbob.org"}] diff --git a/src/wuttaweb/util.py b/src/wuttaweb/util.py index 2f0e592..02b5bcd 100644 --- a/src/wuttaweb/util.py +++ b/src/wuttaweb/util.py @@ -27,7 +27,6 @@ Web Utilities import importlib import json import logging -import warnings import sqlalchemy as sa @@ -154,34 +153,20 @@ def get_libver( config = request.wutta_config # nb. we prefer a setting to be named like: wuttaweb.libver.vue - # but for back-compat this also can work: tailbone.libver.vue - # and for more back-compat this can work: wuttaweb.vue_version + # but for back-compat this also can work: wuttaweb.vue_version # however that compat only works for some of the settings... if not default_only: - # nb. new/preferred setting - version = config.get(f'wuttaweb.libver.{key}') + version = config.get(f'{prefix}.libver.{key}') if version: return version - # fallback to caller-specified prefix - if prefix != 'wuttaweb': - version = config.get(f'{prefix}.libver.{key}') - if version: - warnings.warn(f"config for {prefix}.libver.{key} is deprecated; " - f"please set wuttaweb.libver.{key} instead", - DeprecationWarning) - return version - if key == 'buefy': if not default_only: # nb. old/legacy setting version = config.get(f'{prefix}.buefy_version') if version: - warnings.warn(f"config for {prefix}.buefy_version is deprecated; " - "please set wuttaweb.libver.buefy instead", - DeprecationWarning) return version if not configured_only: return 'latest' @@ -197,9 +182,6 @@ def get_libver( # nb. old/legacy setting version = config.get(f'{prefix}.vue_version') if version: - warnings.warn(f"config for {prefix}.vue_version is deprecated; " - "please set wuttaweb.libver.vue instead", - DeprecationWarning) return version if not configured_only: return '2.6.14' @@ -311,35 +293,16 @@ def get_liburl( config = request.wutta_config if not default_only: - - # nb. new/preferred setting - url = config.get(f'wuttaweb.liburl.{key}') - if url: - return url - - # fallback to caller-specified prefix url = config.get(f'{prefix}.liburl.{key}') if url: - warnings.warn(f"config for {prefix}.liburl.{key} is deprecated; " - f"please set wuttaweb.liburl.{key} instead", - DeprecationWarning) return url if configured_only: return - version = get_libver(request, key, prefix=prefix, - configured_only=False, - default_only=default_only) + version = get_libver(request, key, prefix=prefix) - # load fanstatic libcache if configured static = config.get('wuttaweb.static_libcache.module') - if not static: - static = config.get(f'{prefix}.static_libcache.module') - if static: - warnings.warn(f"config for {prefix}.static_libcache.module is deprecated; " - "please set wuttaweb.static_libcache.module instead", - DeprecationWarning) if static: static = importlib.import_module(static) needed = request.environ['fanstatic.needed'] diff --git a/tests/test_util.py b/tests/test_util.py index 021394b..f0f04af 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -59,11 +59,6 @@ class TestGetLibVer(TestCase): version = util.get_libver(self.request, 'buefy') self.assertEqual(version, '0.9.29') - def test_buefy_custom_old_tailbone(self): - self.config.setdefault('tailbone.libver.buefy', '0.9.28') - version = util.get_libver(self.request, 'buefy', prefix='tailbone') - self.assertEqual(version, '0.9.28') - def test_buefy_custom_new(self): self.config.setdefault('wuttaweb.libver.buefy', '0.9.29') version = util.get_libver(self.request, 'buefy') @@ -226,11 +221,10 @@ class TestGetLibUrl(TestCase): def tearDown(self): testing.tearDown() - def setup_fanstatic(self, register=True): + def setup_fanstatic(self): self.pyramid_config.include('pyramid_fanstatic') - if register: - self.config.setdefault('wuttaweb.static_libcache.module', - 'tests.test_util') + self.config.setdefault('wuttaweb.static_libcache.module', + 'tests.test_util') needed = MagicMock() needed.library_url = MagicMock(return_value='/fanstatic') @@ -246,11 +240,6 @@ class TestGetLibUrl(TestCase): url = util.get_liburl(self.request, 'buefy') self.assertEqual(url, '/lib/buefy.js') - def test_buefy_custom_tailbone(self): - self.config.setdefault('tailbone.liburl.buefy', '/tailbone/buefy.js') - url = util.get_liburl(self.request, 'buefy', prefix='tailbone') - self.assertEqual(url, '/tailbone/buefy.js') - def test_buefy_default_only(self): self.config.setdefault('wuttaweb.liburl.buefy', '/lib/buefy.js') url = util.get_liburl(self.request, 'buefy', default_only=True) @@ -265,12 +254,6 @@ class TestGetLibUrl(TestCase): url = util.get_liburl(self.request, 'buefy') self.assertEqual(url, '/wutta/fanstatic/buefy.js') - def test_buefy_fanstatic_tailbone(self): - self.setup_fanstatic(register=False) - self.config.setdefault('tailbone.static_libcache.module', 'tests.test_util') - url = util.get_liburl(self.request, 'buefy', prefix='tailbone') - self.assertEqual(url, '/wutta/fanstatic/buefy.js') - def test_buefy_css_default(self): url = util.get_liburl(self.request, 'buefy.css') self.assertEqual(url, 'https://unpkg.com/buefy@latest/dist/buefy.min.css')