Hello community,

here is the log from the commit of package python-dj-database-url for 
openSUSE:Factory checked in at 2019-03-12 09:53:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-dj-database-url (Old)
 and      /work/SRC/openSUSE:Factory/.python-dj-database-url.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-dj-database-url"

Tue Mar 12 09:53:55 2019 rev:4 rq:682847 version:0.5.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-dj-database-url/python-dj-database-url.changes
    2018-12-13 19:43:03.665120935 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-dj-database-url.new.28833/python-dj-database-url.changes
 2019-03-12 09:53:59.907531079 +0100
@@ -1,0 +2,7 @@
+Fri Mar  8 13:30:15 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 0.5.0:
+  * Fixes for python3.6
+  * ipv6 parsing
+
+-------------------------------------------------------------------

Old:
----
  v0.4.2.tar.gz

New:
----
  v0.5.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-dj-database-url.spec ++++++
--- /var/tmp/diff_new_pack.zBgyW3/_old  2019-03-12 09:54:01.303530800 +0100
+++ /var/tmp/diff_new_pack.zBgyW3/_new  2019-03-12 09:54:01.331530795 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-dj-database-url
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-dj-database-url
-Version:        0.4.2
+Version:        0.5.0
 Release:        0
 Summary:        Use Database URLs in your Django Application
 License:        BSD-3-Clause
@@ -59,6 +59,8 @@
 %python_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
+# all tests connect to AWS for DB servers
+
 %files %{python_files}
 %license LICENSE
 %doc README.rst

++++++ v0.4.2.tar.gz -> v0.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dj-database-url-0.4.2/.travis.yml 
new/dj-database-url-0.5.0/.travis.yml
--- old/dj-database-url-0.4.2/.travis.yml       2017-01-05 18:47:54.000000000 
+0100
+++ new/dj-database-url-0.5.0/.travis.yml       2018-03-01 19:37:00.000000000 
+0100
@@ -5,4 +5,5 @@
   - 3.3
   - 3.4
   - 3.5
+  - 3.6
 script: make test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dj-database-url-0.4.2/README.rst 
new/dj-database-url-0.5.0/README.rst
--- old/dj-database-url-0.4.2/README.rst        2017-01-05 18:47:54.000000000 
+0100
+++ new/dj-database-url-0.5.0/README.rst        2018-03-01 19:37:00.000000000 
+0100
@@ -60,6 +60,8 @@
 
+-------------+-----------------------------------------------+--------------------------------------------------+
 | PostGIS     | ``django.contrib.gis.db.backends.postgis``    | 
``postgis://USER:PASSWORD@HOST:PORT/NAME``       |
 
+-------------+-----------------------------------------------+--------------------------------------------------+
+| MSSQL       | ``sql_server.pyodbc``                         | 
``mssql://USER:PASSWORD@HOST:PORT/NAME``         |
++-------------+-----------------------------------------------+--------------------------------------------------+
 | MySQL       | ``django.db.backends.mysql``                  | 
``mysql://USER:PASSWORD@HOST:PORT/NAME``         |
 
+-------------+-----------------------------------------------+--------------------------------------------------+
 | MySQL (GIS) | ``django.contrib.gis.db.backends.mysql``      | 
``mysqlgis://USER:PASSWORD@HOST:PORT/NAME``      |
@@ -72,7 +74,7 @@
 
+-------------+-----------------------------------------------+--------------------------------------------------+
 | Oracle (GIS)| ``django.contrib.gis.db.backends.oracle``     | 
``oraclegis://USER:PASSWORD@HOST:PORT/NAME``     |
 
+-------------+-----------------------------------------------+--------------------------------------------------+
-| Redshift    | ``django_redshift_backend``                   | 
``redshift://USER:PASSWORD@HOST:PORT/NAME``     |
+| Redshift    | ``django_redshift_backend``                   | 
``redshift://USER:PASSWORD@HOST:PORT/NAME``      |
 
+-------------+-----------------------------------------------+--------------------------------------------------+
 
 .. [1] With PostgreSQL, you can also use unix domain socket paths with
@@ -86,4 +88,3 @@
        from using other Oracle tools (like SQLPlus) i.e. user and password are 
separated
        by ``:`` not by ``/``. Also you can omit ``HOST`` and ``PORT``
        and provide a full DSN string or TNS name in ``NAME`` part.
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dj-database-url-0.4.2/dj_database_url.py 
new/dj-database-url-0.5.0/dj_database_url.py
--- old/dj-database-url-0.4.2/dj_database_url.py        2017-01-05 
18:47:54.000000000 +0100
+++ new/dj-database-url-0.5.0/dj_database_url.py        2018-03-01 
19:37:00.000000000 +0100
@@ -17,6 +17,7 @@
 urlparse.uses_netloc.append('mysql2')
 urlparse.uses_netloc.append('mysqlgis')
 urlparse.uses_netloc.append('mysql-connector')
+urlparse.uses_netloc.append('mssql')
 urlparse.uses_netloc.append('spatialite')
 urlparse.uses_netloc.append('sqlite')
 urlparse.uses_netloc.append('oracle')
@@ -34,6 +35,7 @@
     'mysql2': 'django.db.backends.mysql',
     'mysqlgis': 'django.contrib.gis.db.backends.mysql',
     'mysql-connector': 'mysql.connector.django',
+    'mssql': 'sql_server.pyodbc',
     'spatialite': 'django.contrib.gis.db.backends.spatialite',
     'sqlite': 'django.db.backends.sqlite3',
     'oracle': 'django.db.backends.oracle',
@@ -42,7 +44,7 @@
 }
 
 
-def config(env=DEFAULT_ENV, default=None, engine=None, conn_max_age=0):
+def config(env=DEFAULT_ENV, default=None, engine=None, conn_max_age=0, 
ssl_require=False):
     """Returns configured DATABASE dictionary from DATABASE_URL."""
 
     config = {}
@@ -50,12 +52,12 @@
     s = os.environ.get(env, default)
 
     if s:
-        config = parse(s, engine, conn_max_age)
+        config = parse(s, engine, conn_max_age, ssl_require)
 
     return config
 
 
-def parse(url, engine=None, conn_max_age=0):
+def parse(url, engine=None, conn_max_age=0, ssl_require=False):
     """Parses a database URL."""
 
     if url == 'sqlite://:memory:':
@@ -87,28 +89,32 @@
         path = ':memory:'
 
     # Handle postgres percent-encoded paths.
-    netloc = url.netloc
-    if "@" in netloc:
-        netloc = netloc.rsplit("@", 1)[1]
-    if ":" in netloc:
-        netloc = netloc.split(":", 1)[0]
-    hostname = netloc or ''
+    hostname = url.hostname or ''
     if '%2f' in hostname.lower():
+        # Switch to url.netloc to avoid lower cased paths
+        hostname = url.netloc
+        if "@" in hostname:
+            hostname = hostname.rsplit("@", 1)[1]
+        if ":" in hostname:
+            hostname = hostname.split(":", 1)[0]
         hostname = hostname.replace('%2f', '/').replace('%2F', '/')
 
+    # Lookup specified engine.
+    engine = SCHEMES[url.scheme] if engine is None else engine
+
+    port = (str(url.port) if url.port and engine == SCHEMES['oracle']
+            else url.port)
+
     # Update with environment configuration.
     config.update({
         'NAME': urlparse.unquote(path or ''),
         'USER': urlparse.unquote(url.username or ''),
         'PASSWORD': urlparse.unquote(url.password or ''),
         'HOST': hostname,
-        'PORT': url.port or '',
+        'PORT': port or '',
         'CONN_MAX_AGE': conn_max_age,
     })
 
-    # Lookup specified engine.
-    engine = SCHEMES[url.scheme] if engine is None else engine
-
     # Pass the query string into OPTIONS.
     options = {}
     for key, values in query.items():
@@ -118,6 +124,9 @@
 
         options[key] = values[-1]
 
+    if ssl_require:
+        options['sslmode'] = 'require'
+
     # Support for Postgres Schema URLs
     if 'currentSchema' in options and engine in (
         'django.contrib.gis.db.backends.postgis',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dj-database-url-0.4.2/manifest.in 
new/dj-database-url-0.5.0/manifest.in
--- old/dj-database-url-0.4.2/manifest.in       1970-01-01 01:00:00.000000000 
+0100
+++ new/dj-database-url-0.5.0/manifest.in       2018-03-01 19:37:00.000000000 
+0100
@@ -0,0 +1 @@
+include LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dj-database-url-0.4.2/setup.cfg 
new/dj-database-url-0.5.0/setup.cfg
--- old/dj-database-url-0.4.2/setup.cfg 2017-01-05 18:47:54.000000000 +0100
+++ new/dj-database-url-0.5.0/setup.cfg 1970-01-01 01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-[wheel]
-universal = 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dj-database-url-0.4.2/setup.py 
new/dj-database-url-0.5.0/setup.py
--- old/dj-database-url-0.4.2/setup.py  2017-01-05 18:47:54.000000000 +0100
+++ new/dj-database-url-0.5.0/setup.py  2018-03-01 19:37:00.000000000 +0100
@@ -37,7 +37,7 @@
 
     import dj_database_url
 
-    DATABASES['default'] = dj_database_url.config(conn_max_age=600)
+    DATABASES['default'] = dj_database_url.config(conn_max_age=600, 
ssl_require=True)
 
 Provide a default::
 
@@ -55,17 +55,11 @@
 
 """
 
-import sys
-import os
 from setuptools import setup
 
-if sys.argv[-1] == "publish":
-    os.system("python setup.py sdist bdist_wheel upload")
-    sys.exit()
-
 setup(
     name='dj-database-url',
-    version='0.4.2',
+    version='0.5.0',
     url='https://github.com/kennethreitz/dj-database-url',
     license='BSD',
     author='Kenneth Reitz',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dj-database-url-0.4.2/test_dj_database_url.py 
new/dj-database-url-0.5.0/test_dj_database_url.py
--- old/dj-database-url-0.4.2/test_dj_database_url.py   2017-01-05 
18:47:54.000000000 +0100
+++ new/dj-database-url-0.5.0/test_dj_database_url.py   2018-03-01 
19:37:00.000000000 +0100
@@ -43,6 +43,17 @@
         assert url['PASSWORD'] == ''
         assert url['PORT'] == ''
 
+    def test_ipv6_parsing(self):
+        url = 
'postgres://ieRaekei9wilaim7:wegauwhgeuioweg@[2001:db8:1234::1234:5678:90af]:5431/d8r82722r2kuvn'
+        url = dj_database_url.parse(url)
+
+        assert url['ENGINE'] == 'django.db.backends.postgresql_psycopg2'
+        assert url['NAME'] == 'd8r82722r2kuvn'
+        assert url['HOST'] == '2001:db8:1234::1234:5678:90af'
+        assert url['USER'] == 'ieRaekei9wilaim7'
+        assert url['PASSWORD'] == 'wegauwhgeuioweg'
+        assert url['PORT'] == 5431
+
     def test_postgres_search_path_parsing(self):
         url = 
'postgres://uf07k1i6d8ia0v:[email protected]:5431/d8r82722r2kuvn?currentSchema=otherschema'
         url = dj_database_url.parse(url)
@@ -231,7 +242,7 @@
         assert url['HOST'] == 'oraclehost'
         assert url['USER'] == 'scott'
         assert url['PASSWORD'] == 'tiger'
-        assert url['PORT'] == 1521
+        assert url['PORT'] == '1521'
 
     def test_oracle_gis_parsing(self):
         url = 'oraclegis://scott:tiger@oraclehost:1521/hr'
@@ -291,6 +302,19 @@
         assert url['OPTIONS']['options'] == '-c search_path=otherschema'
         assert 'currentSchema' not in url['OPTIONS']
 
+    def test_mssql_parsing(self):
+        url = 
'mssql://uf07k1i6d8ia0v:[email protected]/d8r82722r2kuvn?driver=ODBC
 Driver 13 for SQL Server'
+        url = dj_database_url.parse(url)
+
+        assert url['ENGINE'] == 'sql_server.pyodbc'
+        assert url['NAME'] == 'd8r82722r2kuvn'
+        assert url['HOST'] == 'ec2-107-21-253-135.compute-1.amazonaws.com'
+        assert url['USER'] == 'uf07k1i6d8ia0v'
+        assert url['PASSWORD'] == 'wegauwhgeuioweg'
+        assert url['PORT'] == ''
+        assert url['OPTIONS']['driver'] == 'ODBC Driver 13 for SQL Server'
+        assert 'currentSchema' not in url['OPTIONS']
+
 
 if __name__ == '__main__':
     unittest.main()


Reply via email to