Update to 0.7.10
This commit is contained in:
parent
395d837b7a
commit
ed12619fcf
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
/PyMySQL-0.6.6.tar.gz
|
/PyMySQL-0.6.6.tar.gz
|
||||||
/PyMySQL-0.6.7.tar.gz
|
/PyMySQL-0.6.7.tar.gz
|
||||||
/PyMySQL-0.7.9.tar.gz
|
/PyMySQL-0.7.9.tar.gz
|
||||||
|
/PyMySQL-0.7.10.tar.gz
|
||||||
|
|||||||
@ -1,69 +0,0 @@
|
|||||||
From 755dfdc2e16f2f7f5fa6669cb81d0ec3118ec203 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Damien Ciabrini <damien.ciabrini@gmail.com>
|
|
||||||
Date: Wed, 16 Nov 2016 13:11:03 +0100
|
|
||||||
Subject: [PATCH] Add bind_address option (#529)
|
|
||||||
|
|
||||||
Allow connecting to the DB from a specific network interface
|
|
||||||
---
|
|
||||||
pymysql/connections.py | 14 ++++++++++++--
|
|
||||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pymysql/connections.py b/pymysql/connections.py
|
|
||||||
index d5e39a1..2884cdc 100644
|
|
||||||
--- a/pymysql/connections.py
|
|
||||||
+++ b/pymysql/connections.py
|
|
||||||
@@ -534,7 +534,8 @@ class Connection(object):
|
|
||||||
compress=None, named_pipe=None, no_delay=None,
|
|
||||||
autocommit=False, db=None, passwd=None, local_infile=False,
|
|
||||||
max_allowed_packet=16*1024*1024, defer_connect=False,
|
|
||||||
- auth_plugin_map={}, read_timeout=None, write_timeout=None):
|
|
||||||
+ auth_plugin_map={}, read_timeout=None, write_timeout=None,
|
|
||||||
+ bind_address=None):
|
|
||||||
"""
|
|
||||||
Establish a connection to the MySQL database. Accepts several
|
|
||||||
arguments:
|
|
||||||
@@ -544,6 +545,9 @@ class Connection(object):
|
|
||||||
password: Password to use.
|
|
||||||
database: Database to use, None to not use a particular one.
|
|
||||||
port: MySQL port to use, default is usually OK. (default: 3306)
|
|
||||||
+ bind_address: When the client has multiple network interfaces, specify
|
|
||||||
+ the interface from which to connect to the host. Argument can be
|
|
||||||
+ a hostname or an IP address.
|
|
||||||
unix_socket: Optionally, you can use a unix socket rather than TCP/IP.
|
|
||||||
charset: Charset you want to use.
|
|
||||||
sql_mode: Default SQL_MODE to use.
|
|
||||||
@@ -632,6 +636,7 @@ class Connection(object):
|
|
||||||
database = _config("database", database)
|
|
||||||
unix_socket = _config("socket", unix_socket)
|
|
||||||
port = int(_config("port", port))
|
|
||||||
+ bind_address = _config("bind-address", bind_address)
|
|
||||||
charset = _config("default-character-set", charset)
|
|
||||||
|
|
||||||
self.host = host or "localhost"
|
|
||||||
@@ -640,6 +645,7 @@ class Connection(object):
|
|
||||||
self.password = password or ""
|
|
||||||
self.db = database
|
|
||||||
self.unix_socket = unix_socket
|
|
||||||
+ self.bind_address = bind_address
|
|
||||||
if read_timeout is not None and read_timeout <= 0:
|
|
||||||
raise ValueError("read_timeout should be >= 0")
|
|
||||||
self._read_timeout = read_timeout
|
|
||||||
@@ -884,10 +890,14 @@ class Connection(object):
|
|
||||||
self.host_info = "Localhost via UNIX socket"
|
|
||||||
if DEBUG: print('connected using unix_socket')
|
|
||||||
else:
|
|
||||||
+ kwargs = {}
|
|
||||||
+ if self.bind_address is not None:
|
|
||||||
+ kwargs['source_address'] = (self.bind_address, 0)
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
sock = socket.create_connection(
|
|
||||||
- (self.host, self.port), self.connect_timeout)
|
|
||||||
+ (self.host, self.port), self.connect_timeout,
|
|
||||||
+ **kwargs)
|
|
||||||
break
|
|
||||||
except (OSError, IOError) as e:
|
|
||||||
if e.errno == errno.EINTR:
|
|
||||||
--
|
|
||||||
2.5.5
|
|
||||||
|
|
||||||
@ -4,15 +4,13 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 0.7.9
|
Version: 0.7.10
|
||||||
Release: 4%{?dist}
|
Release: 10%{?dist}
|
||||||
Summary: Pure-Python MySQL client library
|
Summary: Pure-Python MySQL client library
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://pypi.python.org/pypi/%{pypi_name}/
|
URL: https://pypi.python.org/pypi/%{pypi_name}/
|
||||||
Source0: https://pypi.python.org/packages/a4/c4/c15457f261fda9839637de044eca9b6da8f55503183fe887523801b85701/PyMySQL-0.7.9.tar.gz
|
Source0: https://pypi.python.org/packages/90/c2/d81638491baa572d6e79b78bde42c7449d2e45b578c919c0df1a76cb859b/PyMySQL-0.7.10.tar.gz
|
||||||
|
|
||||||
Patch1: bz1378008-add-bind-address-option.patch
|
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
@ -47,11 +45,11 @@ to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython
|
|||||||
and Jython.
|
and Jython.
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -qn %{pypi_name}-%{version}
|
%setup -qn %{pypi_name}-%{version}
|
||||||
rm -rf %{pypi_name}.egg-info
|
rm -rf %{pypi_name}.egg-info
|
||||||
|
|
||||||
%patch1 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py2_build
|
%py2_build
|
||||||
@ -59,6 +57,7 @@ rm -rf %{pypi_name}.egg-info
|
|||||||
%py3_build
|
%py3_build
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py2_install
|
%py2_install
|
||||||
# Remove shebang
|
# Remove shebang
|
||||||
@ -74,6 +73,7 @@ for lib in %{buildroot}%{python3_sitelib}/pymysql/tests/thirdparty/test_MySQLdb/
|
|||||||
done
|
done
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# Tests cannot be launch on koji, they require a mysqldb running.
|
# Tests cannot be launch on koji, they require a mysqldb running.
|
||||||
|
|
||||||
@ -92,7 +92,11 @@ done
|
|||||||
%{python3_sitelib}/pymysql/
|
%{python3_sitelib}/pymysql/
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Feb 15 2017 Julien Enselme <jujens@jujens.eu> - 0.7.10-1
|
||||||
|
- Update to 0.7.10
|
||||||
|
|
||||||
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-4
|
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.9-4
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user