From 2e9e6fceb9a5529f253752d1cce810fe3bc09e8b Mon Sep 17 00:00:00 2001 From: TheBurchLog <5104941+TheBurchLog@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:34:53 -0500 Subject: [PATCH 1/3] Add User Preferences (#571) * Add User Preferences * Update fixtures * fixed schema test --- CHANGELOG.rst | 2 ++ brewtils/models.py | 2 ++ brewtils/schemas.py | 1 + brewtils/test/fixtures.py | 1 + 4 files changed, 6 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ce648c07..0cf4921b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,8 @@ Brewtils Changelog ================== +- Added support for preferences in User model + 3.30.0 ------ 9/23/25 diff --git a/brewtils/models.py b/brewtils/models.py index 5354b012..a8ff3f91 100644 --- a/brewtils/models.py +++ b/brewtils/models.py @@ -1914,6 +1914,7 @@ def __init__( is_remote=False, protected=False, file_generated=False, + preferences=None, ): self.username = username self.id = id @@ -1926,6 +1927,7 @@ def __init__( self.metadata = metadata or {} self.protected = protected self.file_generated = file_generated + self.preferences = preferences or {} def __str__(self): return "%s: %s" % (self.username, self.roles) diff --git a/brewtils/schemas.py b/brewtils/schemas.py index 32c38eb0..16edcc7e 100644 --- a/brewtils/schemas.py +++ b/brewtils/schemas.py @@ -645,6 +645,7 @@ class UserSchema(BaseSchema): metadata = fields.Dict(allow_none=True) protected = fields.Boolean(allow_none=True) file_generated = fields.Boolean(allow_none=True) + preferences = fields.Dict(allow_none=True) model_schema_map.update( diff --git a/brewtils/test/fixtures.py b/brewtils/test/fixtures.py index beead57f..91627713 100644 --- a/brewtils/test/fixtures.py +++ b/brewtils/test/fixtures.py @@ -680,6 +680,7 @@ def user_dict(role_dict, upstream_role_dict, alias_user_map_dict): "metadata": {}, "protected": False, "file_generated": False, + "preferences": {"theme": "dark"}, } From 5eadd3824c994760201c88c5047515dcf6f57c5f Mon Sep 17 00:00:00 2001 From: TheBurchLog <5104941+TheBurchLog@users.noreply.github.com> Date: Wed, 17 Dec 2025 14:24:46 -0500 Subject: [PATCH 2/3] 3.32.0rc0 --- CHANGELOG.rst | 4 ++++ brewtils/__version__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e29c7423..1f694cb1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ Brewtils Changelog ================== +3.32.0rc0 +------ +12/17/25 + - Added support for preferences in User model 3.31.0 diff --git a/brewtils/__version__.py b/brewtils/__version__.py index 127b12fa..28e0eb88 100644 --- a/brewtils/__version__.py +++ b/brewtils/__version__.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = "3.31.0" +__version__ = "3.32.0rc0" From bba8a1c7646da66728811bfcfef234b5f1c29d67 Mon Sep 17 00:00:00 2001 From: TheBurchLog <5104941+TheBurchLog@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:47:45 +0000 Subject: [PATCH 3/3] formatting --- brewtils/choices.py | 1 - brewtils/queues.py | 1 + brewtils/rest/easy_client.py | 2 +- brewtils/test/comparable.py | 1 + test/decorators_test.py | 6 ++---- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/brewtils/choices.py b/brewtils/choices.py index 37008787..5505282d 100644 --- a/brewtils/choices.py +++ b/brewtils/choices.py @@ -8,7 +8,6 @@ from lark import ParseError from lark import GrammarError, LexError - choices_grammar = r""" func: CNAME [func_args] url: ADDRESS [url_args] diff --git a/brewtils/queues.py b/brewtils/queues.py index 7f42c4bd..6226054a 100644 --- a/brewtils/queues.py +++ b/brewtils/queues.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- """This module currently exists to maintain backwards compatibility.""" + import warnings from brewtils.pika import PikaClient diff --git a/brewtils/rest/easy_client.py b/brewtils/rest/easy_client.py index 98a4eaa5..7e6cebc0 100644 --- a/brewtils/rest/easy_client.py +++ b/brewtils/rest/easy_client.py @@ -1066,7 +1066,7 @@ def download_chunked_file(self, file_id): # before giving up for _ in range(10): - (valid, meta) = self._check_chunked_file_validity(file_id) + valid, meta = self._check_chunked_file_validity(file_id) if valid: break diff --git a/brewtils/test/comparable.py b/brewtils/test/comparable.py index bba46ea9..914b580d 100644 --- a/brewtils/test/comparable.py +++ b/brewtils/test/comparable.py @@ -10,6 +10,7 @@ Seriously, this is a 'use at your own risk' kind of thing. """ + from functools import partial import brewtils.test diff --git a/test/decorators_test.py b/test/decorators_test.py index ecaa7c77..8285cab8 100644 --- a/test/decorators_test.py +++ b/test/decorators_test.py @@ -1385,13 +1385,11 @@ def test_positional_only(self): import textwrap exec_locals = {} - class_dec = textwrap.dedent( - """ + class_dec = textwrap.dedent(""" class Tester(object): def c(self, foo, /): pass - """ - ) + """) # Black doesn't handle this well - because we run in 2.7 mode it wants to # put a space after exec, but then it complains about the space after exec.