Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-SQLAlchemy-Utils for openSUSE:Factory checked in at 2021-06-19 23:03:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils (Old) and /work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new.2625 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-SQLAlchemy-Utils" Sat Jun 19 23:03:05 2021 rev:30 rq:900657 version:0.37.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils/python-SQLAlchemy-Utils.changes 2021-05-15 23:17:29.644425051 +0200 +++ /work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new.2625/python-SQLAlchemy-Utils.changes 2021-06-19 23:03:36.139723309 +0200 @@ -1,0 +2,10 @@ +Thu Jun 17 20:49:07 UTC 2021 - Dirk M??ller <dmuel...@suse.com> + +- update to 0.37.6: + * Added `cache_ok=True` for TSVectorType + * Fixed instant_defaults_listener to respect constructor supplied kwargs + * Fixed incorrect Ltree.lca behaviour + * Added `cache_ok=True` for all custom types + * Added CockroachDB support for UUIDType + +------------------------------------------------------------------- Old: ---- SQLAlchemy-Utils-0.37.2.tar.gz New: ---- SQLAlchemy-Utils-0.37.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-SQLAlchemy-Utils.spec ++++++ --- /var/tmp/diff_new_pack.rffyoM/_old 2021-06-19 23:03:36.607724031 +0200 +++ /var/tmp/diff_new_pack.rffyoM/_new 2021-06-19 23:03:36.611724037 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-SQLAlchemy-Utils -Version: 0.37.2 +Version: 0.37.6 Release: 0 Summary: Various utility functions for SQLAlchemy License: BSD-3-Clause ++++++ SQLAlchemy-Utils-0.37.2.tar.gz -> SQLAlchemy-Utils-0.37.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/CHANGES.rst new/SQLAlchemy-Utils-0.37.6/CHANGES.rst --- old/SQLAlchemy-Utils-0.37.2/CHANGES.rst 2021-05-05 08:03:52.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/CHANGES.rst 2021-06-02 17:21:28.000000000 +0200 @@ -4,6 +4,31 @@ Here you can see the full list of changes between each SQLAlchemy-Utils release. +0.37.6 (2021-06-02) +^^^^^^^^^^^^^^^^^^^ + +- Added `cache_ok=True` for TSVectorType + + +0.37.5 (2021-05-31) +^^^^^^^^^^^^^^^^^^^ + +- Fixed instant_defaults_listener to respect constructor supplied kwargs (#516, pull request courtesy of soundstripe) + + +0.37.4 (2021-05-21) +^^^^^^^^^^^^^^^^^^^ + +- Fixed incorrect Ltree.lca behaviour (#468, pull request courtesy of slymit) + + +0.37.3 (2021-05-16) +^^^^^^^^^^^^^^^^^^^ + +- Added `cache_ok=True` for all custom types +- Added CockroachDB support for UUIDType (#526, pull request courtesy of chrishemmings) + + 0.37.2 (2021-05-05) ^^^^^^^^^^^^^^^^^^^ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/PKG-INFO new/SQLAlchemy-Utils-0.37.6/PKG-INFO --- old/SQLAlchemy-Utils-0.37.2/PKG-INFO 2021-05-05 08:05:19.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/PKG-INFO 2021-06-02 17:25:03.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: SQLAlchemy-Utils -Version: 0.37.2 +Version: 0.37.6 Summary: Various utility functions for SQLAlchemy. Home-page: https://github.com/kvesteri/sqlalchemy-utils Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/SQLAlchemy_Utils.egg-info/PKG-INFO new/SQLAlchemy-Utils-0.37.6/SQLAlchemy_Utils.egg-info/PKG-INFO --- old/SQLAlchemy-Utils-0.37.2/SQLAlchemy_Utils.egg-info/PKG-INFO 2021-05-05 08:05:18.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/SQLAlchemy_Utils.egg-info/PKG-INFO 2021-06-02 17:25:03.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: SQLAlchemy-Utils -Version: 0.37.2 +Version: 0.37.6 Summary: Various utility functions for SQLAlchemy. Home-page: https://github.com/kvesteri/sqlalchemy-utils Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/__init__.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/__init__.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/__init__.py 2021-05-05 08:04:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/__init__.py 2021-06-02 17:21:47.000000000 +0200 @@ -102,4 +102,4 @@ refresh_materialized_view ) -__version__ = '0.37.2' +__version__ = '0.37.6' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/listeners.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/listeners.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/listeners.py 2021-04-12 14:12:57.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/listeners.py 2021-05-31 14:42:25.000000000 +0200 @@ -22,17 +22,24 @@ def instant_defaults_listener(target, args, kwargs): + # insertion order of kwargs matters + # copy and clear so that we can add back later at the end of the dict + original = kwargs.copy() + kwargs.clear() + for key, column in sa.inspect(target.__class__).columns.items(): if ( hasattr(column, 'default') and - column.default is not None and - key not in kwargs + column.default is not None ): if callable(column.default.arg): kwargs[key] = column.default.arg(target) else: kwargs[key] = column.default.arg + # supersede w/initial in case target uses setters overriding defaults + kwargs.update(original) + def force_auto_coercion(mapper=None): """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/primitives/ltree.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/primitives/ltree.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/primitives/ltree.py 2019-02-02 12:03:24.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/primitives/ltree.py 2021-05-21 12:24:40.000000000 +0200 @@ -173,7 +173,7 @@ parts = self.path.split('.') for index, element in enumerate(parts): if any(( - other[index] != element or len(other) <= index + 1 + other[index] != element or len(other) <= index + 1 or len(parts) == index + 1 for other in other_parts )): if index == 0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/arrow.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/arrow.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/arrow.py 2021-03-21 17:35:59.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/arrow.py 2021-05-16 10:51:24.000000000 +0200 @@ -55,5 +55,8 @@ "'arrow' package is required to use 'ArrowType'" ) - super(ArrowType, self).__init__(datetime_processor=ArrowDateTime, - *args, **kwargs) + super(ArrowType, self).__init__( + datetime_processor=ArrowDateTime, + *args, + **kwargs + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/bit.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/bit.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/bit.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/bit.py 2021-05-16 10:51:24.000000000 +0200 @@ -8,6 +8,8 @@ """ impl = sa.types.BINARY + cache_ok = True + def __init__(self, length=1, **kwargs): self.length = length sa.types.TypeDecorator.__init__(self, **kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/choice.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/choice.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/choice.py 2019-11-01 11:18:12.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/choice.py 2021-05-16 10:51:24.000000000 +0200 @@ -1,14 +1,11 @@ +from enum import Enum + import six from sqlalchemy import types from ..exceptions import ImproperlyConfigured from .scalar_coercible import ScalarCoercible -try: - from enum import Enum -except ImportError: - Enum = None - class Choice(object): def __init__(self, code, value): @@ -39,7 +36,7 @@ ) -class ChoiceType(types.TypeDecorator, ScalarCoercible): +class ChoiceType(ScalarCoercible, types.TypeDecorator): """ ChoiceType offers way of having fixed set of choices for given column. It could work with a list of tuple (a collection of key-value pairs), or @@ -147,7 +144,7 @@ impl = types.Unicode(255) def __init__(self, choices, impl=None): - self.choices = choices + self.choices = tuple(choices) if ( Enum is not None and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/color.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/color.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/color.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/color.py 2021-05-16 10:51:24.000000000 +0200 @@ -12,7 +12,7 @@ python_colour_type = None -class ColorType(types.TypeDecorator, ScalarCoercible): +class ColorType(ScalarCoercible, types.TypeDecorator): """ ColorType provides a way for saving Color (from colour_ package) objects into database. ColorType saves Color objects as strings on the way in and @@ -49,7 +49,7 @@ .. _colour: https://github.com/vaab/colour """ - STORE_FORMAT = u'hex' + STORE_FORMAT = 'hex' impl = types.Unicode(20) python_type = python_colour_type diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/country.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/country.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/country.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/country.py 2021-05-16 10:51:24.000000000 +0200 @@ -5,7 +5,7 @@ from .scalar_coercible import ScalarCoercible -class CountryType(types.TypeDecorator, ScalarCoercible): +class CountryType(ScalarCoercible, types.TypeDecorator): """ Changes :class:`.Country` objects to a string representation on the way in and changes them back to :class:`.Country objects on the way out. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/currency.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/currency.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/currency.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/currency.py 2021-05-16 10:51:24.000000000 +0200 @@ -6,7 +6,7 @@ from .scalar_coercible import ScalarCoercible -class CurrencyType(types.TypeDecorator, ScalarCoercible): +class CurrencyType(ScalarCoercible, types.TypeDecorator): """ Changes :class:`.Currency` objects to a string representation on the way in and changes them back to :class:`.Currency` objects on the way out. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/email.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/email.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/email.py 2016-10-20 08:55:26.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/email.py 2021-05-16 10:51:24.000000000 +0200 @@ -33,6 +33,7 @@ """ impl = sa.Unicode comparator_factory = CaseInsensitiveComparator + cache_ok = True def __init__(self, length=255, *args, **kwargs): super(EmailType, self).__init__(length=length, *args, **kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/encrypted/encrypted_type.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/encrypted/encrypted_type.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/encrypted/encrypted_type.py 2020-09-20 18:38:00.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/encrypted/encrypted_type.py 2021-05-16 10:51:24.000000000 +0200 @@ -40,7 +40,7 @@ pass -class EncryptionDecryptionBaseEngine(object): +class EncryptionDecryptionBaseEngine: """A base encryption and decryption engine. This class must be sub-classed in order to create @@ -347,11 +347,17 @@ sa.Unicode, get_key)) """ - impl = String + cache_ok = True - def __init__(self, type_in=None, key=None, - engine=None, padding=None, **kwargs): + def __init__( + self, + type_in=None, + key=None, + engine=None, + padding=None, + **kwargs + ): """Initialization.""" if not cryptography: raise ImproperlyConfigured( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py 2020-05-03 19:55:01.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py 2021-05-16 10:51:24.000000000 +0200 @@ -1,14 +1,10 @@ +from collections.abc import Iterable from datetime import datetime import six from ...exceptions import ImproperlyConfigured -try: - from collections.abc import Iterable -except ImportError: # For python 2.7 support - from collections import Iterable - arrow = None try: import arrow diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/enriched_date_type.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/enriched_date_type.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/enriched_date_type.py 2020-05-03 19:55:01.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/enriched_date_type.py 2021-05-16 10:51:24.000000000 +0200 @@ -27,6 +27,7 @@ session.commit() """ impl = types.Date + cache_ok = True def __init__(self, date_processor=PendulumDate, *args, **kwargs): super(EnrichedDateType, self).__init__(*args, **kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/enriched_datetime_type.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/enriched_datetime_type.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/enriched_datetime_type.py 2020-05-03 19:55:01.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/enriched_datetime_type.py 2021-05-16 10:51:24.000000000 +0200 @@ -28,6 +28,7 @@ session.commit() """ impl = types.DateTime + cache_ok = True def __init__(self, datetime_processor=PendulumDateTime, *args, **kwargs): super(EnrichedDateTimeType, self).__init__(*args, **kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/pendulum_datetime.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/pendulum_datetime.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/enriched_datetime/pendulum_datetime.py 2020-05-03 19:55:01.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/enriched_datetime/pendulum_datetime.py 2021-05-16 10:51:24.000000000 +0200 @@ -27,17 +27,22 @@ elif isinstance(value, six.string_types) and value.isdigit(): value = pendulum.from_timestamp(int(value)) elif isinstance(value, datetime): - value = pendulum.datetime(value.year, - value.month, value.day, - value.hour, value.minute, - value.second, value.microsecond) + value = pendulum.datetime( + value.year, + value.month, + value.day, + value.hour, + value.minute, + value.second, + value.microsecond + ) else: value = pendulum.parse(value) return value def process_bind_param(self, impl, value, dialect): if value: - return self._coerce(impl, value).in_tz("UTC") + return self._coerce(impl, value).in_tz('UTC') return value def process_result_value(self, impl, value, dialect): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/ip_address.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/ip_address.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/ip_address.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/ip_address.py 2021-05-16 10:51:24.000000000 +0200 @@ -1,20 +1,13 @@ +from ipaddress import ip_address + import six from sqlalchemy import types from ..exceptions import ImproperlyConfigured from .scalar_coercible import ScalarCoercible -ip_address = None -try: - from ipaddress import ip_address -except ImportError: - try: - from ipaddr import IPAddress as ip_address - except ImportError: - pass - -class IPAddressType(types.TypeDecorator, ScalarCoercible): +class IPAddressType(ScalarCoercible, types.TypeDecorator): """ Changes IPAddress objects to a string representation on the way in and changes them back to IPAddress objects on the way out. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/json.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/json.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/json.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/json.py 2021-05-16 10:51:24.000000000 +0200 @@ -55,6 +55,7 @@ session.commit() """ impl = sa.UnicodeText + cache_ok = True def __init__(self, *args, **kwargs): if json is None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/locale.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/locale.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/locale.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/locale.py 2021-05-16 10:51:24.000000000 +0200 @@ -11,7 +11,7 @@ pass -class LocaleType(types.TypeDecorator, ScalarCoercible): +class LocaleType(ScalarCoercible, types.TypeDecorator): """ LocaleType saves Babel_ Locale objects into database. The Locale objects are converted to string on the way in and back to object on the way out. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/password.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/password.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/password.py 2018-10-14 09:13:47.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/password.py 2021-05-16 10:51:24.000000000 +0200 @@ -76,7 +76,7 @@ return not (self == value) -class PasswordType(types.TypeDecorator, ScalarCoercible): +class PasswordType(ScalarCoercible, types.TypeDecorator): """ PasswordType hashes passwords as they come into the database and allows verifying them using a Pythonic interface. This Pythonic interface diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/pg_composite.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/pg_composite.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/pg_composite.py 2020-09-20 18:38:00.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/pg_composite.py 2021-05-21 12:24:40.000000000 +0200 @@ -58,7 +58,7 @@ account1.balance = ('USD', 15) account2 = Account() - account2.balance = {'currency': 'USD', 'balance': 15} + account2.balance = {'currency': 'USD', 'amount': 15} session.add(account1) session.add(account2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/phone_number.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/phone_number.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/phone_number.py 2020-03-18 10:24:41.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/phone_number.py 2021-05-16 10:51:24.000000000 +0200 @@ -140,7 +140,7 @@ return hash(self.e164) -class PhoneNumberType(types.TypeDecorator, ScalarCoercible): +class PhoneNumberType(ScalarCoercible, types.TypeDecorator): """ Changes PhoneNumber objects to a string representation on the way in and changes them back to PhoneNumber objects on the way out. If E164 is used diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/range.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/range.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/range.py 2019-12-08 18:38:14.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/range.py 2021-05-16 10:51:24.000000000 +0200 @@ -134,10 +134,7 @@ .. _intervals: https://github.com/kvesteri/intervals """ -try: - from collections.abc import Iterable -except ImportError: # For python 2.7 support - from collections import Iterable +from collections.abc import Iterable from datetime import timedelta import six @@ -265,7 +262,7 @@ ) -class RangeType(types.TypeDecorator, ScalarCoercible): +class RangeType(ScalarCoercible, types.TypeDecorator): comparator_factory = RangeComparator def __init__(self, *args, **kwargs): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/scalar_coercible.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/scalar_coercible.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/scalar_coercible.py 2018-11-19 08:53:23.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/scalar_coercible.py 2021-05-16 10:51:24.000000000 +0200 @@ -1,4 +1,6 @@ -class ScalarCoercible(object): +class ScalarCoercible: + cache_ok = True + def _coerce(self, value): raise NotImplementedError diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/scalar_list.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/scalar_list.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/scalar_list.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/scalar_list.py 2021-05-21 12:24:40.000000000 +0200 @@ -50,10 +50,23 @@ session.commit() - """ + ScalarListType is always stored as text. To use an array field on PostgreSQL + database use variant construct:: + + from sqlalchemy_utils import ScalarListType + + + class Player(Base): + __tablename__ = 'player' + id = sa.Column(sa.Integer, autoincrement=True) + points = sa.Column(ARRAY(Integer).with_variant(ScalarListType(int), 'sqlite')) + + """ impl = sa.UnicodeText() + cache_ok = True + def __init__(self, coerce_func=six.text_type, separator=u','): self.separator = six.text_type(separator) self.coerce_func = coerce_func diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/timezone.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/timezone.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/timezone.py 2019-06-09 14:59:02.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/timezone.py 2021-05-16 10:51:24.000000000 +0200 @@ -5,7 +5,7 @@ from .scalar_coercible import ScalarCoercible -class TimezoneType(types.TypeDecorator, ScalarCoercible): +class TimezoneType(ScalarCoercible, types.TypeDecorator): """ TimezoneType provides a way for saving timezones (from either the pytz or the dateutil package) objects into database. TimezoneType saves timezone diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/ts_vector.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/ts_vector.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/ts_vector.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/ts_vector.py 2021-06-02 17:21:35.000000000 +0200 @@ -82,6 +82,7 @@ """ impl = TSVECTOR + cache_ok = True class comparator_factory(TSVECTOR.Comparator): def match(self, other, **kwargs): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/url.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/url.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/url.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/url.py 2021-05-16 10:51:24.000000000 +0200 @@ -10,7 +10,7 @@ pass -class URLType(types.TypeDecorator, ScalarCoercible): +class URLType(ScalarCoercible, types.TypeDecorator): """ URLType stores furl_ objects into database. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/uuid.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/uuid.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/uuid.py 2020-05-03 19:55:01.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/uuid.py 2021-05-16 10:51:24.000000000 +0200 @@ -8,7 +8,7 @@ from .scalar_coercible import ScalarCoercible -class UUIDType(types.TypeDecorator, ScalarCoercible): +class UUIDType(ScalarCoercible, types.TypeDecorator): """ Stores a UUID in the database natively when it can and falls back to a BINARY(16) or a CHAR(32) when it can't. @@ -28,7 +28,7 @@ python_type = uuid.UUID - def __init__(self, binary=True, native=True, **kwargs): + def __init__(self, binary=True, native=True): """ :param binary: Whether to use a BINARY(16) or CHAR(32) fallback. """ @@ -39,7 +39,7 @@ return util.generic_repr(self) def load_dialect_impl(self, dialect): - if dialect.name == 'postgresql' and self.native: + if self.native and dialect.name in ('postgresql', 'cockroachdb'): # Use the native UUID type. return dialect.type_descriptor(postgresql.UUID()) @@ -70,7 +70,7 @@ if not isinstance(value, uuid.UUID): value = self._coerce(value) - if self.native and dialect.name in ('postgresql', 'mssql'): + if self.native and dialect.name in ('postgresql', 'mssql', 'cockroachdb'): return str(value) return value.bytes if self.binary else value.hex @@ -79,7 +79,7 @@ if value is None: return value - if self.native and dialect.name in ('postgresql', 'mssql'): + if self.native and dialect.name in ('postgresql', 'mssql', 'cockroachdb'): if isinstance(value, uuid.UUID): # Some drivers convert PostgreSQL's uuid values to # Python's uuid.UUID objects by themselves diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/weekdays.py new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/weekdays.py --- old/SQLAlchemy-Utils-0.37.2/sqlalchemy_utils/types/weekdays.py 2016-04-25 16:20:06.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/sqlalchemy_utils/types/weekdays.py 2021-05-16 10:51:24.000000000 +0200 @@ -51,6 +51,8 @@ impl = BitType(WeekDay.NUM_WEEK_DAYS) + cache_ok = True + def __init__(self, *args, **kwargs): if i18n.babel is None: raise ImproperlyConfigured( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/primitives/test_ltree.py new/SQLAlchemy-Utils-0.37.6/tests/primitives/test_ltree.py --- old/SQLAlchemy-Utils-0.37.2/tests/primitives/test_ltree.py 2018-02-18 15:34:52.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/tests/primitives/test_ltree.py 2021-05-21 12:24:40.000000000 +0200 @@ -92,6 +92,7 @@ ('1.2.3', ['1.2.3', '1.2'], '1'), ('1.2.3.4.5', ['1.2.3', '1.2.3.4'], '1.2'), ('1.2.3.4.5', ['3.4', '1.2.3.4'], None), + ('1.2', ['1.2.3', '1.2.4'], '1') ) ) def test_lca(self, path, others, result): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/test_instant_defaults_listener.py new/SQLAlchemy-Utils-0.37.6/tests/test_instant_defaults_listener.py --- old/SQLAlchemy-Utils-0.37.2/tests/test_instant_defaults_listener.py 2021-04-12 14:12:57.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/test_instant_defaults_listener.py 2021-05-31 14:42:25.000000000 +0200 @@ -15,6 +15,16 @@ id = sa.Column(sa.Integer, primary_key=True) name = sa.Column(sa.Unicode(255), default='Some article') created_at = sa.Column(sa.DateTime, default=datetime.now) + _byline = sa.Column(sa.Unicode(255), default='Default byline') + + @property + def byline(self): + return self._byline + + @byline.setter + def byline(self, value): + self._byline = value + return Article @@ -26,3 +36,7 @@ def test_callables_as_defaults(self, Article): article = Article() assert isinstance(article.created_at, datetime) + + def test_override_default_with_setter_function(self, Article): + article = Article(byline='provided byline') + assert article.byline == 'provided byline' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_arrow.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_arrow.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_arrow.py 2020-04-27 12:45:14.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_arrow.py 2021-05-16 10:51:24.000000000 +0200 @@ -25,7 +25,6 @@ @pytest.mark.skipif('arrow.arrow is None') class TestArrowDateTimeType(object): - def test_parameter_processing(self, session, Article): article = Article( created_at=arrow.arrow.get(datetime(2000, 11, 1)) @@ -78,3 +77,8 @@ item = session.query(Article).one() assert item.published_at.datetime == item.published_at_dt assert item.published_at.to(timezone) == dt + + def test_compilation(self, Article, session): + query = sa.select([Article.created_at]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_choice.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_choice.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_choice.py 2017-11-05 16:23:59.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_choice.py 2021-05-16 10:51:24.000000000 +0200 @@ -21,10 +21,8 @@ class TestChoiceType(object): - @pytest.fixture def User(self, Base): - class User(Base): TYPES = [ ('admin', 'Admin'), @@ -82,6 +80,11 @@ with pytest.raises(ImproperlyConfigured): ChoiceType([]) + def test_compilation(self, User, session): + query = sa.select([User.type]) + # the type should be cacheable and not throw exception + session.execute(query) + class TestChoiceTypeWithCustomUnderlyingType(object): def test_init_type(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_color.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_color.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_color.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_color.py 2021-05-16 10:51:24.000000000 +0200 @@ -60,3 +60,8 @@ clause = Document.bg_color == 'white' compiled = str(clause.compile(compile_kwargs={'literal_binds': True})) assert compiled == "document.bg_color = 'white'" + + def test_compilation(self, Document, session): + query = sa.select([Document.bg_color]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_country.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_country.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_country.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_country.py 2021-05-16 10:51:24.000000000 +0200 @@ -43,3 +43,8 @@ clause = User.country == 'FI' compiled = str(clause.compile(compile_kwargs={'literal_binds': True})) assert compiled == '"user".country = \'FI\'' + + def test_compilation(self, User, session): + query = sa.select([User.country]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_currency.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_currency.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_currency.py 2016-04-25 20:10:56.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_currency.py 2021-05-16 10:51:24.000000000 +0200 @@ -29,7 +29,6 @@ @pytest.mark.skipif('i18n.babel is None') class TestCurrencyType(object): - def test_parameter_processing(self, session, User, set_get_locale): user = User( currency=Currency('USD') @@ -53,3 +52,8 @@ clause = User.currency == 'USD' compiled = str(clause.compile(compile_kwargs={'literal_binds': True})) assert compiled == '"user".currency = \'USD\'' + + def test_compilation(self, User, session): + query = sa.select([User.currency]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_date_range.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_date_range.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_date_range.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_date_range.py 2021-05-16 10:51:24.000000000 +0200 @@ -42,8 +42,7 @@ @pytest.mark.skipif('intervals is None') -class DateRangeTestCase(object): - +class DateRangeTestCase: def test_nullify_range(self, create_booking): booking = create_booking(None) assert booking.during is None @@ -85,8 +84,7 @@ @pytest.mark.usefixtures('postgresql_dsn') -class TestDateRangeOnPostgres(object): - +class TestDateRangeOnPostgres(DateRangeTestCase): @pytest.mark.parametrize( ('date_range', 'length'), ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_datetime_range.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_datetime_range.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_datetime_range.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_datetime_range.py 2021-05-16 10:51:24.000000000 +0200 @@ -42,8 +42,7 @@ @pytest.mark.skipif('intervals is None') -class DateRangeTestCase(object): - +class DateTimeRangeTestCase: def test_nullify_range(self, create_booking): booking = create_booking(None) assert booking.during is None @@ -85,8 +84,7 @@ @pytest.mark.usefixtures('postgresql_dsn') -class TestDateRangeOnPostgres(object): - +class TestDateTimeRangeOnPostgres(DateTimeRangeTestCase): @pytest.mark.parametrize( ('date_range', 'length'), ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_email.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_email.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_email.py 2016-07-10 11:03:30.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_email.py 2021-05-16 10:51:24.000000000 +0200 @@ -34,3 +34,8 @@ def test_custom_length(self, session, User): assert User.short_email.type.impl.length == 70 + + def test_compilation(self, User, session): + query = sa.select([User.email]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_encrypted.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_encrypted.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_encrypted.py 2021-04-12 14:12:57.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_encrypted.py 2021-05-16 10:51:24.000000000 +0200 @@ -338,7 +338,6 @@ class AesEncryptedTypeTestCase(EncryptedTypeTestCase): - @pytest.fixture def encryption_engine(self): return AesEngine @@ -352,28 +351,24 @@ class TestAesEncryptedTypeWithPKCS5Padding(AesEncryptedTypeTestCase): - @pytest.fixture def padding_mechanism(self): return 'pkcs5' class TestAesEncryptedTypeWithOneAndZeroesPadding(AesEncryptedTypeTestCase): - @pytest.fixture def padding_mechanism(self): return 'oneandzeroes' class TestAesEncryptedTypeWithZeroesPadding(AesEncryptedTypeTestCase): - @pytest.fixture def padding_mechanism(self): return 'zeroes' class TestAesEncryptedTypeTestcaseWithNaivePadding(AesEncryptedTypeTestCase): - @pytest.fixture def padding_mechanism(self): return 'naive' @@ -390,7 +385,6 @@ class TestFernetEncryptedTypeTestCase(EncryptedTypeTestCase): - @pytest.fixture def encryption_engine(self): return FernetEngine @@ -400,8 +394,7 @@ return None -class TestDatetimeHandler(object): - +class TestDatetimeHandler: def test_datetime_with_micro_and_timezone( self, datetime_with_micro_and_timezone ): @@ -533,7 +526,6 @@ class TestAesGcmEncryptedType(EncryptedTypeTestCase): - @pytest.fixture def encryption_engine(self): return AesGcmEngine diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_enriched_date_pendulum.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_enriched_date_pendulum.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_enriched_date_pendulum.py 2020-05-03 20:15:41.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_enriched_date_pendulum.py 2021-05-16 10:51:24.000000000 +0200 @@ -19,7 +19,8 @@ birthday = sa.Column( enriched_date_type.EnrichedDateType( date_processor=pendulum_date.PendulumDate - )) + ) + ) return User @@ -30,7 +31,6 @@ @pytest.mark.skipif('pendulum_date.pendulum is None') class TestPendulumDateType(object): - def test_parameter_processing(self, session, User): user = User( birthday=pendulum_date.pendulum.date(1995, 7, 11) @@ -66,3 +66,8 @@ clause = User.birthday > '2015-01-01' compiled = str(clause.compile(compile_kwargs={"literal_binds": True})) assert compiled == "users.birthday > '2015-01-01'" + + def test_compilation(self, User, session): + query = sa.select([User.birthday]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_enriched_datetime_arrow.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_enriched_datetime_arrow.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_enriched_datetime_arrow.py 2020-05-03 20:15:55.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_enriched_datetime_arrow.py 2021-05-16 10:51:24.000000000 +0200 @@ -35,7 +35,6 @@ @pytest.mark.skipif('arrow_datetime.arrow is None') class TestArrowDateTimeType(object): - def test_parameter_processing(self, session, Article): article = Article( created_at=arrow_datetime.arrow.get(datetime(2000, 11, 1)) @@ -89,3 +88,8 @@ item = session.query(Article).one() assert item.published_at.datetime == item.published_at_dt assert item.published_at.to(timezone) == dt + + def test_compilation(self, Article, session): + query = sa.select([Article.published_at]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_ip_address.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_ip_address.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_ip_address.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_ip_address.py 2021-05-16 10:51:24.000000000 +0200 @@ -24,7 +24,6 @@ @pytest.mark.skipif('ip_address.ip_address is None') class TestIPAddressType(object): - def test_parameter_processing(self, session, Visitor): visitor = Visitor( ip_address=u'111.111.111.111' @@ -35,3 +34,8 @@ visitor = session.query(Visitor).first() assert six.text_type(visitor.ip_address) == u'111.111.111.111' + + def test_compilation(self, Visitor, session): + query = sa.select([Visitor.ip_address]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_json.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_json.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_json.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_json.py 2021-05-16 10:51:24.000000000 +0200 @@ -20,7 +20,6 @@ class JSONTestCase(object): - def test_list(self, session, Document): document = Document( json=[1, 2, 3] @@ -54,6 +53,11 @@ document = session.query(Document).first() assert document.json == {'something': u'????????????'} + def test_compilation(self, Document, session): + query = sa.select([Document.json]) + # the type should be cacheable and not throw exception + session.execute(query) + @pytest.mark.skipif('json.json is None') @pytest.mark.usefixtures('sqlite_memory_dsn') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_locale.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_locale.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_locale.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_locale.py 2021-05-16 10:51:24.000000000 +0200 @@ -23,7 +23,6 @@ @pytest.mark.skipif('locale.babel is None') class TestLocaleType(object): - def test_parameter_processing(self, session, User): user = User( locale=locale.babel.Locale(u'fi') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_ltree.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_ltree.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_ltree.py 2016-04-25 20:10:56.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_ltree.py 2021-05-16 10:51:24.000000000 +0200 @@ -39,3 +39,8 @@ clause = Section.path == 'path' compiled = str(clause.compile(compile_kwargs={'literal_binds': True})) assert compiled == 'section.path = \'path\'' + + def test_compilation(self, Section, session): + query = sa.select([Section.path]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_password.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_password.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_password.py 2019-07-15 14:44:13.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_password.py 2021-05-16 10:51:24.000000000 +0200 @@ -55,7 +55,6 @@ @pytest.mark.skipif('types.password.passlib is None') class TestPasswordType(object): - @pytest.mark.parametrize('dialect_module,impl', [ (sqlalchemy.dialects.sqlite, sa.dialects.sqlite.BLOB), (sqlalchemy.dialects.postgresql, sa.dialects.postgresql.BYTEA), @@ -255,3 +254,8 @@ onload = mock.Mock(return_value={}) PasswordType(onload=onload) assert not onload.called + + def test_compilation(self, User, session): + query = sa.select([User.password]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_phonenumber.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_phonenumber.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_phonenumber.py 2020-03-18 10:24:41.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_phonenumber.py 2021-05-16 10:51:24.000000000 +0200 @@ -54,8 +54,7 @@ @pytest.mark.skipif('types.phone_number.phonenumbers is None') -class TestPhoneNumber(object): - +class TestPhoneNumber: @pytest.mark.parametrize('raw_number', VALID_PHONE_NUMBERS) def test_valid_phone_numbers(self, raw_number): number = PhoneNumber(raw_number, 'FI') @@ -119,8 +118,7 @@ @pytest.mark.skipif('types.phone_number.phonenumbers is None') -class TestPhoneNumberType(object): - +class TestPhoneNumberType: def test_query_returns_phone_number_object( self, session, @@ -178,9 +176,14 @@ assert isinstance(user.phone_number, PhoneNumber) + def test_compilation(self, User, session): + query = sa.select([User.phone_number]) + # the type should be cacheable and not throw exception + session.execute(query) + @pytest.mark.skipif('types.phone_number.phonenumbers is None') -class TestPhoneNumberComposite(object): +class TestPhoneNumberComposite: @pytest.fixture def User(self, Base): class User(Base): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_scalar_list.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_scalar_list.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_scalar_list.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_scalar_list.py 2021-05-16 10:51:24.000000000 +0200 @@ -92,3 +92,8 @@ user = session.query(User).first() assert user.some_list == [] + + def test_compilation(self, User, session): + query = sa.select([User.some_list]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_timezone.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_timezone.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_timezone.py 2017-08-31 14:50:46.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_timezone.py 2021-05-16 10:51:24.000000000 +0200 @@ -28,8 +28,7 @@ pass -class TestTimezoneType(object): - +class TestTimezoneType: def test_parameter_processing(self, session, Visitor): visitor = Visitor( timezone_dateutil=u'America/Los_Angeles', @@ -49,6 +48,11 @@ assert visitor_dateutil is not None assert visitor_pytz is not None + def test_compilation(self, Visitor, session): + query = sa.select([Visitor.timezone_pytz]) + # the type should be cacheable and not throw exception + session.execute(query) + TIMEZONE_BACKENDS = ['dateutil', 'pytz'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_tsvector.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_tsvector.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_tsvector.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_tsvector.py 2021-05-16 10:51:24.000000000 +0200 @@ -26,8 +26,7 @@ @pytest.mark.usefixtures('postgresql_dsn') -class TestTSVector(object): - +class TestTSVector: def test_generates_table(self, User): assert 'search_index' in User.__table__.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_url.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_url.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_url.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_url.py 2021-05-16 10:51:24.000000000 +0200 @@ -23,7 +23,6 @@ @pytest.mark.skipif('url.furl is None') class TestURLType(object): - def test_color_parameter_processing(self, session, User): user = User( website=url.furl(u'www.example.com') @@ -39,3 +38,8 @@ user = User(website=u'www.example.com') assert isinstance(user.website, url.furl) + + def test_compilation(self, User, session): + query = sa.select([User.website]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_uuid.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_uuid.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_uuid.py 2020-03-16 12:56:33.000000000 +0100 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_uuid.py 2021-05-16 10:51:24.000000000 +0200 @@ -23,7 +23,6 @@ class TestUUIDType(object): - def test_repr(self): plain = UUIDType() assert repr(plain) == 'UUIDType()' @@ -56,3 +55,8 @@ assert isinstance(obj.id, uuid.UUID) assert obj.id.bytes == identifier + + def test_compilation(self, User, session): + query = sa.select([User.id]) + # the type should be cacheable and not throw exception + session.execute(query) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SQLAlchemy-Utils-0.37.2/tests/types/test_weekdays.py new/SQLAlchemy-Utils-0.37.6/tests/types/test_weekdays.py --- old/SQLAlchemy-Utils-0.37.2/tests/types/test_weekdays.py 2016-04-25 16:20:07.000000000 +0200 +++ new/SQLAlchemy-Utils-0.37.6/tests/types/test_weekdays.py 2021-05-16 10:51:24.000000000 +0200 @@ -32,7 +32,6 @@ @pytest.mark.usefixtures('set_get_locale') @pytest.mark.skipif('i18n.babel is None') class WeekDaysTypeTestCase(object): - def test_color_parameter_processing(self, session, Schedule): schedule = Schedule( working_days=b'0001111' @@ -48,6 +47,11 @@ assert isinstance(schedule.working_days, WeekDays) + def test_compilation(self, Schedule, session): + query = sa.select([Schedule.working_days]) + # the type should be cacheable and not throw exception + session.execute(query) + @pytest.mark.usefixtures('sqlite_memory_dsn') class TestWeekDaysTypeOnSQLite(WeekDaysTypeTestCase):