Hello community,
here is the log from the commit of package python-SQLAlchemy-Utils for
openSUSE:Factory checked in at 2018-11-26 10:29:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils (Old)
and /work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new.19453 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-SQLAlchemy-Utils"
Mon Nov 26 10:29:24 2018 rev:14 rq:651323 version:0.33.8
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils/python-SQLAlchemy-Utils.changes
2018-10-15 09:47:56.871069559 +0200
+++
/work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new.19453/python-SQLAlchemy-Utils.changes
2018-11-26 10:29:41.213071565 +0100
@@ -1,0 +2,11 @@
+Thu Nov 22 21:49:03 UTC 2018 - Arun Persaud <[email protected]>
+
+- update to version 0.33.8:
+ * Added support of short-code in PhoneNumberType (#348, pull request
+ courtesy of anandtripathi5)
+
+- changes from version 0.33.7:
+ * Added MSSQL support for create_database and drop_database (#337,
+ pull request courtesy of jomasti)
+
+-------------------------------------------------------------------
Old:
----
SQLAlchemy-Utils-0.33.6.tar.gz
New:
----
SQLAlchemy-Utils-0.33.8.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-SQLAlchemy-Utils.spec ++++++
--- /var/tmp/diff_new_pack.icCUmR/_old 2018-11-26 10:29:41.773070908 +0100
+++ /var/tmp/diff_new_pack.icCUmR/_new 2018-11-26 10:29:41.773070908 +0100
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-SQLAlchemy-Utils
-Version: 0.33.6
+Version: 0.33.8
Release: 0
Summary: Various utility functions for SQLAlchemy
License: BSD-3-Clause
++++++ SQLAlchemy-Utils-0.33.6.tar.gz -> SQLAlchemy-Utils-0.33.8.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.6/CHANGES.rst
new/SQLAlchemy-Utils-0.33.8/CHANGES.rst
--- old/SQLAlchemy-Utils-0.33.6/CHANGES.rst 2018-10-14 09:08:52.000000000
+0200
+++ new/SQLAlchemy-Utils-0.33.8/CHANGES.rst 2018-11-19 13:06:09.000000000
+0100
@@ -4,6 +4,18 @@
Here you can see the full list of changes between each SQLAlchemy-Utils
release.
+0.33.8 (2018-11-19)
+^^^^^^^^^^^^^^^^^^^
+
+- Added support of short-code in PhoneNumberType (#348, pull request courtesy
of anandtripathi5)
+
+
+0.33.7 (2018-11-19)
+^^^^^^^^^^^^^^^^^^^
+
+- Added MSSQL support for create_database and drop_database (#337, pull
request courtesy of jomasti)
+
+
0.33.6 (2018-10-14)
^^^^^^^^^^^^^^^^^^^
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.6/PKG-INFO
new/SQLAlchemy-Utils-0.33.8/PKG-INFO
--- old/SQLAlchemy-Utils-0.33.6/PKG-INFO 2018-10-14 09:21:45.000000000
+0200
+++ new/SQLAlchemy-Utils-0.33.8/PKG-INFO 2018-11-19 13:41:48.000000000
+0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SQLAlchemy-Utils
-Version: 0.33.6
+Version: 0.33.8
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.33.6/SQLAlchemy_Utils.egg-info/PKG-INFO
new/SQLAlchemy-Utils-0.33.8/SQLAlchemy_Utils.egg-info/PKG-INFO
--- old/SQLAlchemy-Utils-0.33.6/SQLAlchemy_Utils.egg-info/PKG-INFO
2018-10-14 09:21:45.000000000 +0200
+++ new/SQLAlchemy-Utils-0.33.8/SQLAlchemy_Utils.egg-info/PKG-INFO
2018-11-19 13:41:47.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SQLAlchemy-Utils
-Version: 0.33.6
+Version: 0.33.8
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.33.6/SQLAlchemy_Utils.egg-info/requires.txt
new/SQLAlchemy-Utils-0.33.8/SQLAlchemy_Utils.egg-info/requires.txt
--- old/SQLAlchemy-Utils-0.33.6/SQLAlchemy_Utils.egg-info/requires.txt
2018-10-14 09:21:45.000000000 +0200
+++ new/SQLAlchemy-Utils-0.33.8/SQLAlchemy_Utils.egg-info/requires.txt
2018-11-19 13:41:47.000000000 +0100
@@ -44,6 +44,7 @@
pymysql
flake8>=2.4.0
isort>=4.2.2
+pyodbc
[test_all]
anyjson>=0.3.3
@@ -68,6 +69,7 @@
pymysql
flake8>=2.4.0
isort>=4.2.2
+pyodbc
python-dateutil
furl >= 0.4.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.6/conftest.py
new/SQLAlchemy-Utils-0.33.8/conftest.py
--- old/SQLAlchemy-Utils-0.33.6/conftest.py 2018-02-18 15:31:37.000000000
+0100
+++ new/SQLAlchemy-Utils-0.33.8/conftest.py 2018-11-19 08:53:23.000000000
+0100
@@ -78,16 +78,42 @@
@pytest.fixture
+def mssql_db_user():
+ return os.environ.get('SQLALCHEMY_UTILS_TEST_MSSQL_USER', 'sa')
+
+
[email protected]
+def mssql_db_password():
+ return os.environ.get('SQLALCHEMY_UTILS_TEST_MSSQL_PASSWORD',
+ 'Strong!Passw0rd')
+
+
[email protected]
+def mssql_db_driver():
+ driver = os.environ.get('SQLALCHEMY_UTILS_TEST_MSSQL_DRIVER',
+ 'ODBC Driver 17 for SQL Server')
+ return driver.replace(' ', '+')
+
+
[email protected]
+def mssql_dsn(mssql_db_user, mssql_db_password, mssql_db_driver, db_name):
+ return 'mssql+pyodbc://{0}:{1}@localhost/{2}?driver={3}'\
+ .format(mssql_db_user, mssql_db_password, db_name, mssql_db_driver)
+
+
[email protected]
def dsn(request):
if 'postgresql_dsn' in request.fixturenames:
- return request.getfuncargvalue('postgresql_dsn')
+ return request.getfixturevalue('postgresql_dsn')
elif 'mysql_dsn' in request.fixturenames:
- return request.getfuncargvalue('mysql_dsn')
+ return request.getfixturevalue('mysql_dsn')
+ elif 'mssql_dsn' in request.fixturenames:
+ return request.getfixturevalue('mssql_dsn')
elif 'sqlite_file_dsn' in request.fixturenames:
- return request.getfuncargvalue('sqlite_file_dsn')
+ return request.getfixturevalue('sqlite_file_dsn')
elif 'sqlite_memory_dsn' in request.fixturenames:
pass # Return default
- return request.getfuncargvalue('sqlite_memory_dsn')
+ return request.getfixturevalue('sqlite_memory_dsn')
@pytest.fixture
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.6/setup.py
new/SQLAlchemy-Utils-0.33.8/setup.py
--- old/SQLAlchemy-Utils-0.33.6/setup.py 2018-02-18 15:35:53.000000000
+0100
+++ new/SQLAlchemy-Utils-0.33.8/setup.py 2018-11-19 08:53:23.000000000
+0100
@@ -36,6 +36,7 @@
'pymysql',
'flake8>=2.4.0',
'isort>=4.2.2',
+ 'pyodbc',
],
'anyjson': ['anyjson>=0.3.3'],
'babel': ['Babel>=1.3'],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/__init__.py
new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/__init__.py
--- old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/__init__.py 2018-10-14
09:09:03.000000000 +0200
+++ new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/__init__.py 2018-11-19
13:06:17.000000000 +0100
@@ -100,4 +100,4 @@
refresh_materialized_view
)
-__version__ = '0.33.6'
+__version__ = '0.33.8'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/functions/database.py
new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/functions/database.py
--- old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/functions/database.py
2018-04-02 16:53:39.000000000 +0200
+++ new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/functions/database.py
2018-11-19 08:53:23.000000000 +0100
@@ -530,10 +530,15 @@
if url.drivername.startswith('postgres'):
url.database = 'postgres'
+ elif url.drivername.startswith('mssql'):
+ url.database = 'master'
elif not url.drivername.startswith('sqlite'):
url.database = None
- engine = sa.create_engine(url)
+ if url.drivername == 'mssql+pyodbc':
+ engine = sa.create_engine(url, connect_args={'autocommit': True})
+ else:
+ engine = sa.create_engine(url)
result_proxy = None
if engine.dialect.name == 'postgresql':
@@ -592,10 +597,15 @@
if url.drivername.startswith('postgres'):
url.database = 'postgres'
+ elif url.drivername.startswith('mssql'):
+ url.database = 'master'
elif not url.drivername.startswith('sqlite'):
url.database = None
- engine = sa.create_engine(url)
+ if url.drivername == 'mssql+pyodbc':
+ engine = sa.create_engine(url, connect_args={'autocommit': True})
+ else:
+ engine = sa.create_engine(url)
conn_resource = None
if engine.dialect.name == 'sqlite' and database != ':memory:':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/types/phone_number.py
new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/types/phone_number.py
--- old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/types/phone_number.py
2016-10-20 08:50:43.000000000 +0200
+++ new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/types/phone_number.py
2018-11-19 13:04:58.000000000 +0100
@@ -29,7 +29,7 @@
@str_coercible
class PhoneNumber(BasePhoneNumber):
- '''
+ """
Extends a PhoneNumber class from `Python phonenumbers library`_. Adds
different phone number formats to attributes, so they can be easily used
in templates. Phone number validation method is also implemented.
@@ -72,8 +72,12 @@
String representation of the phone number.
:param region:
Region of the phone number.
- '''
- def __init__(self, raw_number, region=None):
+ :param check_region:
+ Whether to check the supplied region parameter;
+ should always be True for external callers.
+ Can be useful for short codes or toll free
+ """
+ def __init__(self, raw_number, region=None, check_region=True):
# Bail if phonenumbers is not found.
if phonenumbers is None:
raise ImproperlyConfigured(
@@ -81,7 +85,11 @@
)
try:
- self._phone_number = phonenumbers.parse(raw_number, region)
+ self._phone_number = phonenumbers.parse(
+ raw_number,
+ region,
+ _check_region=check_region
+ )
except NumberParseException as e:
# Wrap exception so SQLAlchemy doesn't swallow it as a
# StatementError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/types/scalar_coercible.py
new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/types/scalar_coercible.py
--- old/SQLAlchemy-Utils-0.33.6/sqlalchemy_utils/types/scalar_coercible.py
2016-04-25 16:20:06.000000000 +0200
+++ new/SQLAlchemy-Utils-0.33.8/sqlalchemy_utils/types/scalar_coercible.py
2018-11-19 08:53:23.000000000 +0100
@@ -1,6 +1,6 @@
class ScalarCoercible(object):
def _coerce(self, value):
- raise NotImplemented
+ raise NotImplementedError
def coercion_listener(self, target, value, oldvalue, initiator):
return self._coerce(value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.6/tests/functions/test_database.py
new/SQLAlchemy-Utils-0.33.8/tests/functions/test_database.py
--- old/SQLAlchemy-Utils-0.33.6/tests/functions/test_database.py
2017-11-11 18:05:01.000000000 +0100
+++ new/SQLAlchemy-Utils-0.33.8/tests/functions/test_database.py
2018-11-19 08:53:23.000000000 +0100
@@ -118,3 +118,12 @@
for dsn_item in dsn_list:
drop_database(dsn_item)
assert not database_exists(dsn_item)
+
+
[email protected]('mssql_dsn')
+class TestDatabaseMssql(DatabaseTest):
+
+ @pytest.fixture
+ def db_name(self):
+ pytest.importorskip('pyodbc')
+ return 'db_test_sqlalchemy_util'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.6/tests/types/test_encrypted.py
new/SQLAlchemy-Utils-0.33.8/tests/types/test_encrypted.py
--- old/SQLAlchemy-Utils-0.33.6/tests/types/test_encrypted.py 2018-04-29
09:09:37.000000000 +0200
+++ new/SQLAlchemy-Utils-0.33.8/tests/types/test_encrypted.py 2018-11-19
08:53:23.000000000 +0100
@@ -384,8 +384,10 @@
class TestDatetimeHandler(object):
- def test_datetime_with_micro_and_timezone(self):
- original_datetime = datetime_with_micro_and_timezone()
+ def test_datetime_with_micro_and_timezone(
+ self, datetime_with_micro_and_timezone
+ ):
+ original_datetime = datetime_with_micro_and_timezone
original_datetime_isoformat = original_datetime.isoformat()
python_type = datetime
@@ -394,8 +396,8 @@
python_type
) == original_datetime
- def test_datetime_with_micro(self):
- original_datetime = datetime_with_micro()
+ def test_datetime_with_micro(self, datetime_with_micro):
+ original_datetime = datetime_with_micro
original_datetime_isoformat = original_datetime.isoformat()
python_type = datetime
@@ -404,8 +406,8 @@
python_type
) == original_datetime
- def test_datetime_simple(self):
- original_datetime = datetime_simple()
+ def test_datetime_simple(self, datetime_simple):
+ original_datetime = datetime_simple
original_datetime_isoformat = original_datetime.isoformat()
python_type = datetime
@@ -414,8 +416,8 @@
python_type
) == original_datetime
- def test_time_with_micro(self):
- original_time = time_with_micro()
+ def test_time_with_micro(self, time_with_micro):
+ original_time = time_with_micro
original_time_isoformat = original_time.isoformat()
python_type = time
@@ -424,8 +426,8 @@
python_type
) == original_time
- def test_time_simple(self):
- original_time = time_simple()
+ def test_time_simple(self, time_simple):
+ original_time = time_simple
original_time_isoformat = original_time.isoformat()
python_type = time
@@ -434,8 +436,8 @@
python_type
) == original_time
- def test_date_simple(self):
- original_date = date_simple()
+ def test_date_simple(self, date_simple):
+ original_date = date_simple
original_date_isoformat = original_date.isoformat()
python_type = date
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.6/tests/types/test_phonenumber.py
new/SQLAlchemy-Utils-0.33.8/tests/types/test_phonenumber.py
--- old/SQLAlchemy-Utils-0.33.6/tests/types/test_phonenumber.py 2017-11-11
18:53:06.000000000 +0100
+++ new/SQLAlchemy-Utils-0.33.8/tests/types/test_phonenumber.py 2018-11-19
13:04:58.000000000 +0100
@@ -90,6 +90,18 @@
assert number.international == u'+358 40 1234567'
assert number.national == u'040 1234567'
+ def test_phone_number_attributes_for_short_code(self):
+ """
+ For international and national shortcode remains the same, if we pass
+ short code to PhoneNumber library without giving check_region it will
+ raise exception
+ :return:
+ """
+ number = PhoneNumber('72404', check_region=False)
+ assert number.e164 == u'+072404'
+ assert number.international == u'72404'
+ assert number.national == u'72404'
+
def test_phone_number_str_repr(self):
number = PhoneNumber('+358401234567')
if six.PY2: