Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mysqlclient for openSUSE:Factory checked in at 2022-03-31 17:18:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mysqlclient (Old) and /work/SRC/openSUSE:Factory/.python-mysqlclient.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mysqlclient" Thu Mar 31 17:18:13 2022 rev:13 rq:965319 version:2.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mysqlclient/python-mysqlclient.changes 2021-09-13 16:24:54.070770377 +0200 +++ /work/SRC/openSUSE:Factory/.python-mysqlclient.new.1900/python-mysqlclient.changes 2022-03-31 17:18:14.453575143 +0200 @@ -1,0 +2,19 @@ +Thu Mar 24 13:10:53 UTC 2022 - [email protected] + +- version update to 2.1.0 + * Add ``multistatement=True`` option. You can disable multi statement. (#500). + * Remove unnecessary bytes encoder which is remained for Django 1.11 + compatibility (#490). + * Deprecate ``passwd`` and ``db`` keyword. Use ``password`` and ``database`` + instead. (#488). + * Windows: Binary wheels are built with MariaDB Connector/C 3.2.4. (#508) + * ``set_character_set()`` sends ``SET NAMES`` query always. This means + all new connections send it too. This solves compatibility issues + when server and client library are different version. (#509) + * Remove ``escape()`` and ``escape_string()`` from ``MySQLdb`` package. + (#511) + * Add Python 3.10 support and drop Python 3.5 support. +- deleted patches + - liberally-accept-charsets.patch (upstreamed) + +------------------------------------------------------------------- Old: ---- liberally-accept-charsets.patch mysqlclient-2.0.3.tar.gz New: ---- mysqlclient-2.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mysqlclient.spec ++++++ --- /var/tmp/diff_new_pack.V84aW4/_old 2022-03-31 17:18:15.005568916 +0200 +++ /var/tmp/diff_new_pack.V84aW4/_new 2022-03-31 17:18:15.009568872 +0200 @@ -1,7 +1,7 @@ # # spec file # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,13 +29,12 @@ %bcond_with test %endif Name: python-mysqlclient%{psuffix} -Version: 2.0.3 +Version: 2.1.0 Release: 0 Summary: Python interface to MySQL License: GPL-2.0-or-later URL: https://github.com/PyMySQL/mysqlclient-python Source: https://files.pythonhosted.org/packages/source/m/mysqlclient/mysqlclient-%{version}.tar.gz -Patch0: liberally-accept-charsets.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -50,7 +49,6 @@ Provides: python-MySQL-python = %{version} Obsoletes: python-MySQL-python < %{version} %if %{with test} -BuildRequires: %{python_module mock} BuildRequires: %{python_module mysqlclient >= %{version}} BuildRequires: %{python_module pytest} BuildRequires: mariadb-rpm-macros ++++++ mysqlclient-2.0.3.tar.gz -> mysqlclient-2.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/HISTORY.rst new/mysqlclient-2.1.0/HISTORY.rst --- old/mysqlclient-2.0.3/HISTORY.rst 2021-01-01 12:46:24.000000000 +0100 +++ new/mysqlclient-2.1.0/HISTORY.rst 2021-11-17 09:45:37.000000000 +0100 @@ -1,4 +1,23 @@ ====================== + What's new in 2.1.0 +====================== + +Release: 2021-11-17 + +* Add ``multistatement=True`` option. You can disable multi statement. (#500). +* Remove unnecessary bytes encoder which is remained for Django 1.11 + compatibility (#490). +* Deprecate ``passwd`` and ``db`` keyword. Use ``password`` and ``database`` + instead. (#488). +* Windows: Binary wheels are built with MariaDB Connector/C 3.2.4. (#508) +* ``set_character_set()`` sends ``SET NAMES`` query always. This means + all new connections send it too. This solves compatibility issues + when server and client library are different version. (#509) +* Remove ``escape()`` and ``escape_string()`` from ``MySQLdb`` package. + (#511) +* Add Python 3.10 support and drop Python 3.5 support. + +====================== What's new in 2.0.3 ====================== @@ -75,7 +94,7 @@ * ``--static`` build supports ``libmariadbclient.a`` * Try ``mariadb_config`` when ``mysql_config`` is not found -* Fixed warning happend in Python 3.8 (#359) +* Fixed warning happened in Python 3.8 (#359) * Fixed ``from MySQLdb import *``, while I don't recommend it. (#369) * Fixed SEGV ``MySQLdb.escape_string("1")`` when libmariadb is used and no connection is created. (#367) @@ -275,7 +294,7 @@ Fix calling .execute() method for closed cursor cause TypeError. (#37) -Improve peformance to parse date. (#43) +Improve performance to parse date. (#43) Support geometry types (#49) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/INSTALL.rst new/mysqlclient-2.1.0/INSTALL.rst --- old/mysqlclient-2.0.3/INSTALL.rst 2019-12-01 04:04:26.000000000 +0100 +++ new/mysqlclient-2.1.0/INSTALL.rst 1970-01-01 01:00:00.000000000 +0100 @@ -1,146 +0,0 @@ -==================== -MySQLdb Installation -==================== - -.. contents:: -.. - -Prerequisites -------------- - -+ Python 3.5 or higher - -+ setuptools - - * https://pypi.org/project/setuptools/ - -+ MySQL 5.5 or higher - - * https://www.mysql.com/downloads/ - - * MySQL 5.1 may work, but not supported. - -+ C compiler - - * Most free software-based systems already have this, usually gcc. - - * Most commercial UNIX platforms also come with a C compiler, or - you can also use gcc. - - * If you have some Windows flavor, you should use Windows SDK or - Visual C++. - - -Building and installing ------------------------ - -The setup.py script uses mysql_config to find all compiler and linker -options, and should work as is on any POSIX-like platform, so long as -mysql_config is in your path. - -Depending on which version of MySQL you have, you may have the option -of using three different client libraries. To select the client library, -edit the [options] section of site.cfg: - - static - if True, try to link against a static library; otherwise link - against dynamic libraries (default). - This option doesn't work for MySQL>5.6 since libmysqlclient - requires libstdc++. If you want to use, add `-lstdc++` to - mysql_config manually. - -If `<mysql prefix>/lib` is not added to `/etc/ld.so.conf`, `import _mysql` -doesn't work. To fix this, (1) set `LD_LIBRARY_PATH`, or (2) add -`-Wl,-rpath,<mysql prefix>/lib` to ldflags in your mysql_config. - -Finally, putting it together:: - - $ tar xz mysqlclient-1.3.6.tar.gz - $ cd mysqlclient-1.3.6 - $ # edit site.cfg if necessary - $ python setup.py build - $ sudo python setup.py install # or su first - - -Windows -....... - -I don't do Windows. However if someone provides me with a package for -Windows, I'll make it available. Don't ask me for help with Windows -because I can't help you. - -Generally, though, running setup.py is similar to above:: - - C:\...> python setup.py install - C:\...> python setup.py bdist_wininst - -The latter example should build a Windows installer package, if you -have the correct tools. In any event, you *must* have a C compiler. -Additionally, you have to set an environment variable (mysqlroot) -which is the path to your MySQL installation. In theory, it would be -possible to get this information out of the registry, but like I said, -I don't do Windows, but I'll accept a patch that does this. - -On Windows, you will definitely have to edit site.cfg since there is -no mysql_config in the MySQL package. - - -Binary Packages ---------------- - -I don't plan to make binary packages any more. However, if someone -contributes one, I will make it available. Several OS vendors have -their own packages available. - - -Red Hat Linux -............. - -MySQL-python is pre-packaged in Red Hat Linux 7.x and newer. This -includes Fedora Core and Red Hat Enterprise Linux. - - -Debian GNU/Linux -................ - -Packaged as `python-mysqldb`_:: - - # apt-get install python-mysqldb - -Or use Synaptic. - -.. _`python-mysqldb`: http://packages.debian.org/python-mysqldb - - -Ubuntu -...... - -Same as with Debian. - - -Gentoo Linux -............ - -Packaged as `mysql-python`_. :: - - # emerge sync - # emerge mysql-python - # emerge zmysqlda # if you use Zope - -.. _`mysql-python`: https://packages.gentoo.org/packages/search?q=mysql-python - - -BSD -... - -MySQL-python is a ported package in FreeBSD, NetBSD, and OpenBSD, -although the name may vary to match OS conventions. - - -License -------- - -GPL or the original license based on Python 1.5.2's license. - - -:Author: Andy Dustman <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/MANIFEST.in new/mysqlclient-2.1.0/MANIFEST.in --- old/mysqlclient-2.0.3/MANIFEST.in 2017-09-01 19:38:12.000000000 +0200 +++ new/mysqlclient-2.1.0/MANIFEST.in 2021-01-08 07:39:10.000000000 +0100 @@ -3,7 +3,6 @@ include doc/conf.py include MANIFEST.in include HISTORY.rst -include INSTALL.rst include README.md include LICENSE include metadata.cfg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/MySQLdb/__init__.py new/mysqlclient-2.1.0/MySQLdb/__init__.py --- old/mysqlclient-2.0.3/MySQLdb/__init__.py 2020-07-02 05:56:48.000000000 +0200 +++ new/mysqlclient-2.1.0/MySQLdb/__init__.py 2021-10-19 06:21:25.000000000 +0200 @@ -38,8 +38,6 @@ string_literal, MySQLError, DataError, - escape, - escape_string, DatabaseError, InternalError, Warning, @@ -54,11 +52,6 @@ TimestampFromTicks, ) -try: - frozenset -except NameError: - from sets import ImmutableSet as frozenset - threadsafety = 1 apilevel = "2.0" paramstyle = "format" @@ -169,8 +162,6 @@ "converters", "cursors", "debug", - "escape", - "escape_string", "get_client_info", "paramstyle", "string_literal", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/MySQLdb/_mysql.c new/mysqlclient-2.1.0/MySQLdb/_mysql.c --- old/mysqlclient-2.0.3/MySQLdb/_mysql.c 2020-12-08 10:36:05.000000000 +0100 +++ new/mysqlclient-2.1.0/MySQLdb/_mysql.c 2021-11-17 09:45:24.000000000 +0100 @@ -310,7 +310,7 @@ PyObject *fun2=NULL; int j, n2=PySequence_Size(fun); // BINARY_FLAG means ***_bin collation is used. - // To distinguish text and binary, we shoud use charsetnr==63 (binary). + // To distinguish text and binary, we should use charsetnr==63 (binary). // But we abuse BINARY_FLAG for historical reason. if (fields[i].charsetnr == 63) { flags |= BINARY_FLAG; @@ -414,7 +414,7 @@ *db = NULL, *unix_socket = NULL; unsigned int port = 0; unsigned int client_flag = 0; - static char *kwlist[] = { "host", "user", "passwd", "db", "port", + static char *kwlist[] = { "host", "user", "password", "database", "port", "unix_socket", "conv", "connect_timeout", "compress", "named_pipe", "init_command", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/MySQLdb/connections.py new/mysqlclient-2.1.0/MySQLdb/connections.py --- old/mysqlclient-2.0.3/MySQLdb/connections.py 2020-07-02 05:56:48.000000000 +0200 +++ new/mysqlclient-2.1.0/MySQLdb/connections.py 2021-10-20 06:25:54.000000000 +0200 @@ -62,9 +62,9 @@ :param str host: host to connect :param str user: user to connect as :param str password: password to use - :param str passwd: alias of password, for backward compatibility + :param str passwd: alias of password (deprecated) :param str database: database to use - :param str db: alias of database, for backward compatibility + :param str db: alias of database (deprecated) :param int port: TCP/IP port to connect to :param str unix_socket: location of unix_socket to use :param dict conv: conversion dictionary, see MySQLdb.converters @@ -110,6 +110,10 @@ :param int client_flag: flags to use or 0 (see MySQL docs or constants/CLIENTS.py) + :param bool multi_statements: + If True, enable multi statements for clients >= 4.1. + Defaults to True. + :param str ssl_mode: specify the security settings for connection to the server; see the MySQL documentation for more details @@ -144,10 +148,10 @@ kwargs2 = kwargs.copy() - if "database" in kwargs2: - kwargs2["db"] = kwargs2.pop("database") - if "password" in kwargs2: - kwargs2["passwd"] = kwargs2.pop("password") + if "db" in kwargs2: + kwargs2["database"] = kwargs2.pop("db") + if "passwd" in kwargs2: + kwargs2["password"] = kwargs2.pop("passwd") if "conv" in kwargs: conv = kwargs["conv"] @@ -169,14 +173,10 @@ self._binary_prefix = kwargs2.pop("binary_prefix", False) client_flag = kwargs.get("client_flag", 0) - client_version = tuple( - [numeric_part(n) for n in _mysql.get_client_info().split(".")[:2]] - ) - if client_version >= (4, 1): + client_flag |= CLIENT.MULTI_RESULTS + multi_statements = kwargs2.pop("multi_statements", True) + if multi_statements: client_flag |= CLIENT.MULTI_STATEMENTS - if client_version >= (5, 0): - client_flag |= CLIENT.MULTI_RESULTS - kwargs2["client_flag"] = client_flag # PEP-249 requires autocommit to be initially off @@ -186,22 +186,11 @@ self.cursorclass = cursorclass self.encoders = {k: v for k, v in conv.items() if type(k) is not int} - # XXX THIS IS GARBAGE: While this is just a garbage and undocumented, - # Django 1.11 depends on it. And they don't fix it because - # they are in security-only fix mode. - # So keep this garbage for now. This will be removed in 1.5. - # See PyMySQL/mysqlclient-python#306 - self.encoders[bytes] = bytes - self._server_version = tuple( [numeric_part(n) for n in self.get_server_info().split(".")[:2]] ) self.encoding = "ascii" # overridden in set_character_set() - db = proxy(self) - - def unicode_literal(u, dummy=None): - return db.string_literal(u.encode(db.encoding)) if not charset: charset = self.character_set_name() @@ -225,7 +214,13 @@ # MySQL may return JSON with charset==binary. self.converter[FIELD_TYPE.JSON] = str + db = proxy(self) + + def unicode_literal(u, dummy=None): + return db.string_literal(u.encode(db.encoding)) + self.encoders[str] = unicode_literal + self._transactional = self.server_capabilities & CLIENT.TRANSACTIONS if self._transactional: if autocommit is not None: @@ -298,32 +293,10 @@ """ self.query(b"BEGIN") - if not hasattr(_mysql.connection, "warning_count"): - - def warning_count(self): - """Return the number of warnings generated from the - last query. This is derived from the info() method.""" - info = self.info() - if info: - return int(info.split()[-1]) - else: - return 0 - def set_character_set(self, charset): - """Set the connection character set to charset. The character - set can only be changed in MySQL-4.1 and newer. If you try - to change the character set from the current value in an - older version, NotSupportedError will be raised.""" - py_charset = _charset_to_encoding.get(charset, charset) - if self.character_set_name() != charset: - try: - super().set_character_set(charset) - except AttributeError: - if self._server_version < (4, 1): - raise NotSupportedError("server is too old to set charset") - self.query("SET NAMES %s" % charset) - self.store_result() - self.encoding = py_charset + """Set the connection character set to charset.""" + super().set_character_set(charset) + self.encoding = _charset_to_encoding.get(charset, charset) def set_sql_mode(self, sql_mode): """Set the connection sql_mode. See MySQL documentation for diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/MySQLdb/cursors.py new/mysqlclient-2.1.0/MySQLdb/cursors.py --- old/mysqlclient-2.0.3/MySQLdb/cursors.py 2020-07-03 05:21:25.000000000 +0200 +++ new/mysqlclient-2.1.0/MySQLdb/cursors.py 2021-11-17 09:45:24.000000000 +0100 @@ -375,7 +375,7 @@ return result def fetchall(self): - """Fetchs all available rows from the cursor.""" + """Fetches all available rows from the cursor.""" self._check_executed() if self.rownumber: result = self._rows[self.rownumber :] @@ -437,7 +437,7 @@ return r def fetchall(self): - """Fetchs all available rows from the cursor.""" + """Fetches all available rows from the cursor.""" self._check_executed() r = self._fetch_row(0) self.rownumber = self.rownumber + len(r) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/MySQLdb/release.py new/mysqlclient-2.1.0/MySQLdb/release.py --- old/mysqlclient-2.0.3/MySQLdb/release.py 2021-01-01 14:11:18.000000000 +0100 +++ new/mysqlclient-2.1.0/MySQLdb/release.py 2021-11-18 06:51:01.000000000 +0100 @@ -1,4 +1,4 @@ __author__ = "Inada Naoki <[email protected]>" -version_info = (2,0,3,'final',0) -__version__ = "2.0.3" +version_info = (2,1,0,'final',0) +__version__ = "2.1.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/PKG-INFO new/mysqlclient-2.1.0/PKG-INFO --- old/mysqlclient-2.0.3/PKG-INFO 2021-01-01 14:11:18.919323200 +0100 +++ new/mysqlclient-2.1.0/PKG-INFO 2021-11-18 06:51:01.745577600 +0100 @@ -1,98 +1,11 @@ Metadata-Version: 2.1 Name: mysqlclient -Version: 2.0.3 +Version: 2.1.0 Summary: Python interface to MySQL Home-page: https://github.com/PyMySQL/mysqlclient Author: Inada Naoki Author-email: [email protected] License: GPL -Description: # mysqlclient - - [](http://travis-ci.org/PyMySQL/mysqlclient-python) - - This is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). - - This project adds Python 3 support and bug fixes. - I hope this fork is merged back to MySQLdb1 like distribute was merged back to setuptools. - - - ## Support - - **Do Not use Github Issue Tracker to ask help. OSS Maintainer is not free tech support** - - When your question looks relating to Python rather than MySQL: - - * Python mailing list [python-list](https://mail.python.org/mailman/listinfo/python-list) - * Slack [pythondev.slack.com](https://pyslackers.com/web/slack) - - Or when you have question about MySQL: - - * [MySQL Community on Slack](https://lefred.be/mysql-community-on-slack/) - - - ## Install - - ### Windows - - Building mysqlclient on Windows is very hard. - But there are some binary wheels you can install easily. - - ### macOS (Homebrew) - - Install MySQL and mysqlclient: - - ``` - # Assume you are activating Python 3 venv - $ brew install mysql - $ pip install mysqlclient - ``` - - If you don't want to install MySQL server, you can use mysql-client instead: - - ``` - # Assume you are activating Python 3 venv - $ brew install mysql-client - $ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile - $ export PATH="/usr/local/opt/mysql-client/bin:$PATH" - $ pip install mysqlclient - ``` - - ### Linux - - **Note that this is a basic step. I can not support complete step for build for all - environment. If you can see some error, you should fix it by yourself, or ask for - support in some user forum. Don't file a issue on the issue tracker.** - - You may need to install the Python 3 and MySQL development headers and libraries like so: - - * `$ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential` # Debian / Ubuntu - * `% sudo yum install python3-devel mysql-devel` # Red Hat / CentOS - - Then you can install mysqlclient via pip now: - - ``` - $ pip install mysqlclient - ``` - - ### Customize build (POSIX) - - mysqlclient uses `mysql_config` or `mariadb_config` by default for finding - compiler/linker flags. - - You can use `MYSQLCLIENT_CFLAGS` and `MYSQLCLIENT_LDFLAGS` environment - variables to customize compiler/linker options. - - ``` - $ export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags` - $ export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs` - $ pip install mysqlclient - ``` - - ### Documentation - - Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/) - - Platform: ALL Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Other Environment @@ -110,7 +23,112 @@ Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Database Classifier: Topic :: Database :: Database Engines/Servers Requires-Python: >=3.5 Description-Content-Type: text/markdown +License-File: LICENSE + +# mysqlclient + +This project is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). +This project adds Python 3 support and fixed many bugs. + +* PyPI: https://pypi.org/project/mysqlclient/ +* GitHub: https://github.com/PyMySQL/mysqlclient + + +## Support + +**Do Not use Github Issue Tracker to ask help. OSS Maintainer is not free tech support** + +When your question looks relating to Python rather than MySQL: + +* Python mailing list [python-list](https://mail.python.org/mailman/listinfo/python-list) +* Slack [pythondev.slack.com](https://pyslackers.com/web/slack) + +Or when you have question about MySQL: + +* [MySQL Community on Slack](https://lefred.be/mysql-community-on-slack/) + + +## Install + +### Windows + +Building mysqlclient on Windows is very hard. +But there are some binary wheels you can install easily. + +If binary wheels do not exist for your version of Python, it may be possible to +build from source, but if this does not work, **do not come asking for support.** +To build from source, download the +[MariaDB C Connector](https://mariadb.com/downloads/#connectors) and install +it. It must be installed in the default location +(usually "C:\Program Files\MariaDB\MariaDB Connector C" or +"C:\Program Files (x86)\MariaDB\MariaDB Connector C" for 32-bit). If you +build the connector yourself or install it in a different location, set the +environment variable `MYSQLCLIENT_CONNECTOR` before installing. Once you have +the connector installed and an appropriate version of Visual Studio for your +version of Python: + +``` +$ pip install mysqlclient +``` + +### macOS (Homebrew) + +Install MySQL and mysqlclient: + +``` +# Assume you are activating Python 3 venv +$ brew install mysql +$ pip install mysqlclient +``` + +If you don't want to install MySQL server, you can use mysql-client instead: + +``` +# Assume you are activating Python 3 venv +$ brew install mysql-client +$ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile +$ export PATH="/usr/local/opt/mysql-client/bin:$PATH" +$ pip install mysqlclient +``` + +### Linux + +**Note that this is a basic step. I can not support complete step for build for all +environment. If you can see some error, you should fix it by yourself, or ask for +support in some user forum. Don't file a issue on the issue tracker.** + +You may need to install the Python 3 and MySQL development headers and libraries like so: + +* `$ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential` # Debian / Ubuntu +* `% sudo yum install python3-devel mysql-devel` # Red Hat / CentOS + +Then you can install mysqlclient via pip now: + +``` +$ pip install mysqlclient +``` + +### Customize build (POSIX) + +mysqlclient uses `mysql_config` or `mariadb_config` by default for finding +compiler/linker flags. + +You can use `MYSQLCLIENT_CFLAGS` and `MYSQLCLIENT_LDFLAGS` environment +variables to customize compiler/linker options. + +``` +$ export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags` +$ export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs` +$ pip install mysqlclient +``` + +### Documentation + +Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/) + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/README.md new/mysqlclient-2.1.0/README.md --- old/mysqlclient-2.0.3/README.md 2021-01-01 12:41:57.000000000 +0100 +++ new/mysqlclient-2.1.0/README.md 2021-10-19 05:45:22.000000000 +0200 @@ -1,11 +1,10 @@ # mysqlclient -[](http://travis-ci.org/PyMySQL/mysqlclient-python) +This project is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). +This project adds Python 3 support and fixed many bugs. -This is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). - -This project adds Python 3 support and bug fixes. -I hope this fork is merged back to MySQLdb1 like distribute was merged back to setuptools. +* PyPI: https://pypi.org/project/mysqlclient/ +* GitHub: https://github.com/PyMySQL/mysqlclient ## Support @@ -29,6 +28,22 @@ Building mysqlclient on Windows is very hard. But there are some binary wheels you can install easily. +If binary wheels do not exist for your version of Python, it may be possible to +build from source, but if this does not work, **do not come asking for support.** +To build from source, download the +[MariaDB C Connector](https://mariadb.com/downloads/#connectors) and install +it. It must be installed in the default location +(usually "C:\Program Files\MariaDB\MariaDB Connector C" or +"C:\Program Files (x86)\MariaDB\MariaDB Connector C" for 32-bit). If you +build the connector yourself or install it in a different location, set the +environment variable `MYSQLCLIENT_CONNECTOR` before installing. Once you have +the connector installed and an appropriate version of Visual Studio for your +version of Python: + +``` +$ pip install mysqlclient +``` + ### macOS (Homebrew) Install MySQL and mysqlclient: @@ -83,4 +98,3 @@ ### Documentation Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/doc/user_guide.rst new/mysqlclient-2.1.0/doc/user_guide.rst --- old/mysqlclient-2.0.3/doc/user_guide.rst 2020-07-04 02:58:52.000000000 +0200 +++ new/mysqlclient-2.1.0/doc/user_guide.rst 2021-11-17 09:45:24.000000000 +0100 @@ -125,19 +125,19 @@ can take. For this reason, I prefer to use keyword parameters:: db=_mysql.connect(host="localhost",user="joebob", - passwd="moonpie",db="thangs") + password="moonpie",database="thangs") This does exactly what the last example did, but is arguably easier to read. But since the default host is "localhost", and if your login name really was "joebob", you could shorten it to this:: - db=_mysql.connect(passwd="moonpie",db="thangs") + db=_mysql.connect(password="moonpie",database="thangs") UNIX sockets and named pipes don't work over a network, so if you specify a host other than localhost, TCP will be used, and you can specify an odd port if you need to (the default port is 3306):: - db=_mysql.connect(host="outhouse",port=3307,passwd="moonpie",db="thangs") + db=_mysql.connect(host="outhouse",port=3307,password="moonpie",database="thangs") If you really had to, you could connect to the local host with TCP by specifying the full host name, or 127.0.0.1. @@ -145,7 +145,7 @@ Generally speaking, putting passwords in your code is not such a good idea:: - db=_mysql.connect(host="outhouse",db="thangs",read_default_file="~/.my.cnf") + db=_mysql.connect(host="outhouse",database="thangs",read_default_file="~/.my.cnf") This does what the previous example does, but gets the username and password and other parameters from ~/.my.cnf (UNIX-like systems). Read @@ -277,10 +277,10 @@ user user to authenticate as. Default: current effective user. - passwd + password password to authenticate with. Default: no password. - db + database database to use. Default: no default database. port @@ -511,7 +511,7 @@ can only be returned with a SELECT statement. Since a stored procedure may return zero or more result sets, it is impossible for MySQLdb to determine if there are result sets to fetch - before the modified parmeters are accessible. + before the modified parameters are accessible. The parameters are stored in the server as @_*procname*_*n*, where *n* is the position of the parameter. I.e., if you @@ -561,7 +561,7 @@ The ``connect()`` method works nearly the same as with `MySQLDB._mysql`_:: import MySQLdb - db=MySQLdb.connect(passwd="moonpie",db="thangs") + db=MySQLdb.connect(password="moonpie",database="thangs") To perform a query, you first need a cursor, and then you can execute queries on it:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/metadata.cfg new/mysqlclient-2.1.0/metadata.cfg --- old/mysqlclient-2.0.3/metadata.cfg 2021-01-01 12:46:33.000000000 +0100 +++ new/mysqlclient-2.1.0/metadata.cfg 2021-11-17 09:52:46.000000000 +0100 @@ -1,6 +1,6 @@ [metadata] -version: 2.0.3 -version_info: (2,0,3,'final',0) +version: 2.1.0 +version_info: (2,1,0,'final',0) description: Python interface to MySQL author: Inada Naoki author_email: [email protected] @@ -24,6 +24,7 @@ Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Topic :: Database Topic :: Database :: Database Engines/Servers py_modules: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/mysqlclient.egg-info/PKG-INFO new/mysqlclient-2.1.0/mysqlclient.egg-info/PKG-INFO --- old/mysqlclient-2.0.3/mysqlclient.egg-info/PKG-INFO 2021-01-01 14:11:18.000000000 +0100 +++ new/mysqlclient-2.1.0/mysqlclient.egg-info/PKG-INFO 2021-11-18 06:51:01.000000000 +0100 @@ -1,98 +1,11 @@ Metadata-Version: 2.1 Name: mysqlclient -Version: 2.0.3 +Version: 2.1.0 Summary: Python interface to MySQL Home-page: https://github.com/PyMySQL/mysqlclient Author: Inada Naoki Author-email: [email protected] License: GPL -Description: # mysqlclient - - [](http://travis-ci.org/PyMySQL/mysqlclient-python) - - This is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). - - This project adds Python 3 support and bug fixes. - I hope this fork is merged back to MySQLdb1 like distribute was merged back to setuptools. - - - ## Support - - **Do Not use Github Issue Tracker to ask help. OSS Maintainer is not free tech support** - - When your question looks relating to Python rather than MySQL: - - * Python mailing list [python-list](https://mail.python.org/mailman/listinfo/python-list) - * Slack [pythondev.slack.com](https://pyslackers.com/web/slack) - - Or when you have question about MySQL: - - * [MySQL Community on Slack](https://lefred.be/mysql-community-on-slack/) - - - ## Install - - ### Windows - - Building mysqlclient on Windows is very hard. - But there are some binary wheels you can install easily. - - ### macOS (Homebrew) - - Install MySQL and mysqlclient: - - ``` - # Assume you are activating Python 3 venv - $ brew install mysql - $ pip install mysqlclient - ``` - - If you don't want to install MySQL server, you can use mysql-client instead: - - ``` - # Assume you are activating Python 3 venv - $ brew install mysql-client - $ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile - $ export PATH="/usr/local/opt/mysql-client/bin:$PATH" - $ pip install mysqlclient - ``` - - ### Linux - - **Note that this is a basic step. I can not support complete step for build for all - environment. If you can see some error, you should fix it by yourself, or ask for - support in some user forum. Don't file a issue on the issue tracker.** - - You may need to install the Python 3 and MySQL development headers and libraries like so: - - * `$ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential` # Debian / Ubuntu - * `% sudo yum install python3-devel mysql-devel` # Red Hat / CentOS - - Then you can install mysqlclient via pip now: - - ``` - $ pip install mysqlclient - ``` - - ### Customize build (POSIX) - - mysqlclient uses `mysql_config` or `mariadb_config` by default for finding - compiler/linker flags. - - You can use `MYSQLCLIENT_CFLAGS` and `MYSQLCLIENT_LDFLAGS` environment - variables to customize compiler/linker options. - - ``` - $ export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags` - $ export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs` - $ pip install mysqlclient - ``` - - ### Documentation - - Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/) - - Platform: ALL Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Other Environment @@ -110,7 +23,112 @@ Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Database Classifier: Topic :: Database :: Database Engines/Servers Requires-Python: >=3.5 Description-Content-Type: text/markdown +License-File: LICENSE + +# mysqlclient + +This project is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). +This project adds Python 3 support and fixed many bugs. + +* PyPI: https://pypi.org/project/mysqlclient/ +* GitHub: https://github.com/PyMySQL/mysqlclient + + +## Support + +**Do Not use Github Issue Tracker to ask help. OSS Maintainer is not free tech support** + +When your question looks relating to Python rather than MySQL: + +* Python mailing list [python-list](https://mail.python.org/mailman/listinfo/python-list) +* Slack [pythondev.slack.com](https://pyslackers.com/web/slack) + +Or when you have question about MySQL: + +* [MySQL Community on Slack](https://lefred.be/mysql-community-on-slack/) + + +## Install + +### Windows + +Building mysqlclient on Windows is very hard. +But there are some binary wheels you can install easily. + +If binary wheels do not exist for your version of Python, it may be possible to +build from source, but if this does not work, **do not come asking for support.** +To build from source, download the +[MariaDB C Connector](https://mariadb.com/downloads/#connectors) and install +it. It must be installed in the default location +(usually "C:\Program Files\MariaDB\MariaDB Connector C" or +"C:\Program Files (x86)\MariaDB\MariaDB Connector C" for 32-bit). If you +build the connector yourself or install it in a different location, set the +environment variable `MYSQLCLIENT_CONNECTOR` before installing. Once you have +the connector installed and an appropriate version of Visual Studio for your +version of Python: + +``` +$ pip install mysqlclient +``` + +### macOS (Homebrew) + +Install MySQL and mysqlclient: + +``` +# Assume you are activating Python 3 venv +$ brew install mysql +$ pip install mysqlclient +``` + +If you don't want to install MySQL server, you can use mysql-client instead: + +``` +# Assume you are activating Python 3 venv +$ brew install mysql-client +$ echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile +$ export PATH="/usr/local/opt/mysql-client/bin:$PATH" +$ pip install mysqlclient +``` + +### Linux + +**Note that this is a basic step. I can not support complete step for build for all +environment. If you can see some error, you should fix it by yourself, or ask for +support in some user forum. Don't file a issue on the issue tracker.** + +You may need to install the Python 3 and MySQL development headers and libraries like so: + +* `$ sudo apt-get install python3-dev default-libmysqlclient-dev build-essential` # Debian / Ubuntu +* `% sudo yum install python3-devel mysql-devel` # Red Hat / CentOS + +Then you can install mysqlclient via pip now: + +``` +$ pip install mysqlclient +``` + +### Customize build (POSIX) + +mysqlclient uses `mysql_config` or `mariadb_config` by default for finding +compiler/linker flags. + +You can use `MYSQLCLIENT_CFLAGS` and `MYSQLCLIENT_LDFLAGS` environment +variables to customize compiler/linker options. + +``` +$ export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags` +$ export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs` +$ pip install mysqlclient +``` + +### Documentation + +Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/) + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/mysqlclient.egg-info/SOURCES.txt new/mysqlclient-2.1.0/mysqlclient.egg-info/SOURCES.txt --- old/mysqlclient-2.0.3/mysqlclient.egg-info/SOURCES.txt 2021-01-01 14:11:18.000000000 +0100 +++ new/mysqlclient-2.1.0/mysqlclient.egg-info/SOURCES.txt 2021-11-18 06:51:01.000000000 +0100 @@ -1,5 +1,4 @@ HISTORY.rst -INSTALL.rst LICENSE MANIFEST.in README.md @@ -41,4 +40,5 @@ tests/test_MySQLdb_nonstandard.py tests/test_MySQLdb_times.py tests/test__mysql.py +tests/test_connection.py tests/test_cursor.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/setup_common.py new/mysqlclient-2.1.0/setup_common.py --- old/mysqlclient-2.0.3/setup_common.py 2020-07-02 05:56:48.000000000 +0200 +++ new/mysqlclient-2.1.0/setup_common.py 2021-10-19 10:02:41.000000000 +0200 @@ -26,7 +26,7 @@ def create_release_file(metadata): - with open("MySQLdb/release.py", "w") as rel: + with open("MySQLdb/release.py", "w", encoding="utf-8") as rel: rel.write( """ __author__ = "%(author)s <%(author_email)s>" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/setup_posix.py new/mysqlclient-2.1.0/setup_posix.py --- old/mysqlclient-2.0.3/setup_posix.py 2021-01-01 07:12:40.000000000 +0100 +++ new/mysqlclient-2.1.0/setup_posix.py 2021-05-31 07:27:01.000000000 +0200 @@ -128,7 +128,7 @@ if use_mysqlconfig_cflags: # mysql_config may have "-lmysqlclient -lz -lssl -lcrypto", but zlib and # ssl is not used by _mysql. They are needed only for static build. - for L in ("crypto", "ssl", "z"): + for L in ("crypto", "ssl", "z", "zstd"): if L in libraries: libraries.remove(L) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/setup_windows.py new/mysqlclient-2.1.0/setup_windows.py --- old/mysqlclient-2.0.3/setup_windows.py 2020-12-07 07:58:57.000000000 +0100 +++ new/mysqlclient-2.1.0/setup_windows.py 2021-10-19 05:45:22.000000000 +0200 @@ -1,6 +1,5 @@ import os import sys -from distutils.msvccompiler import get_build_version def get_config(): @@ -8,35 +7,34 @@ metadata, options = get_metadata_and_options() - connector = options["connector"] + client = "mariadbclient" + connector = os.environ.get("MYSQLCLIENT_CONNECTOR", options.get("connector")) + if not connector: + connector = os.path.join( + os.environ["ProgramFiles"], "MariaDB", "MariaDB Connector C" + ) extra_objects = [] - # client = "mysqlclient" - client = "mariadbclient" - - vcversion = int(get_build_version()) - if client == "mariadbclient": - library_dirs = [os.path.join(connector, "lib", "mariadb")] - libraries = [ - "kernel32", - "advapi32", - "wsock32", - "shlwapi", - "Ws2_32", - "crypt32", - "secur32", - "bcrypt", - client, - ] - include_dirs = [os.path.join(connector, "include", "mariadb")] - else: - library_dirs = [ - os.path.join(connector, r"lib\vs%d" % vcversion), - os.path.join(connector, "lib"), - ] - libraries = ["kernel32", "advapi32", "wsock32", client] - include_dirs = [os.path.join(connector, r"include")] + library_dirs = [ + os.path.join(connector, "lib", "mariadb"), + os.path.join(connector, "lib"), + ] + libraries = [ + "kernel32", + "advapi32", + "wsock32", + "shlwapi", + "Ws2_32", + "crypt32", + "secur32", + "bcrypt", + client, + ] + include_dirs = [ + os.path.join(connector, "include", "mariadb"), + os.path.join(connector, "include"), + ] extra_link_args = ["/MANIFEST"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/site.cfg new/mysqlclient-2.1.0/site.cfg --- old/mysqlclient-2.0.3/site.cfg 2018-12-10 10:24:35.000000000 +0100 +++ new/mysqlclient-2.1.0/site.cfg 2021-10-19 05:45:22.000000000 +0200 @@ -9,4 +9,4 @@ # http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip # Windows connector libs for MySQL. You need a 32-bit connector for your 32-bit Python build. -connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.1 +connector = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/tests/dbapi20.py new/mysqlclient-2.1.0/tests/dbapi20.py --- old/mysqlclient-2.0.3/tests/dbapi20.py 2020-12-04 04:22:51.000000000 +0100 +++ new/mysqlclient-2.1.0/tests/dbapi20.py 2021-11-17 09:45:24.000000000 +0100 @@ -793,7 +793,7 @@ con.close() def test_setoutputsize(self): - # Real test for setoutputsize is driver dependant + # Real test for setoutputsize is driver dependent raise NotImplementedError("Driver need to override this test") def test_None(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/tests/test_MySQLdb_capabilities.py new/mysqlclient-2.1.0/tests/test_MySQLdb_capabilities.py --- old/mysqlclient-2.0.3/tests/test_MySQLdb_capabilities.py 2020-12-07 09:39:35.000000000 +0100 +++ new/mysqlclient-2.1.0/tests/test_MySQLdb_capabilities.py 2021-10-19 05:45:22.000000000 +0200 @@ -182,7 +182,7 @@ for binary_prefix in (True, False, None): kwargs = self.connect_kwargs.copy() # needs to be set to can guarantee CHARSET response for normal strings - kwargs["charset"] = "utf8" + kwargs["charset"] = "utf8mb4" if binary_prefix is not None: kwargs["binary_prefix"] = binary_prefix @@ -190,11 +190,11 @@ with closing(conn.cursor()) as c: c.execute("SELECT CHARSET(%s)", (MySQLdb.Binary(b"raw bytes"),)) self.assertEqual( - c.fetchall()[0][0], "binary" if binary_prefix else "utf8" + c.fetchall()[0][0], "binary" if binary_prefix else "utf8mb4" ) # normal strings should not get prefix c.execute("SELECT CHARSET(%s)", ("str",)) - self.assertEqual(c.fetchall()[0][0], "utf8") + self.assertEqual(c.fetchall()[0][0], "utf8mb4") if __name__ == "__main__": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/tests/test_MySQLdb_times.py new/mysqlclient-2.1.0/tests/test_MySQLdb_times.py --- old/mysqlclient-2.0.3/tests/test_MySQLdb_times.py 2020-07-02 07:19:25.000000000 +0200 +++ new/mysqlclient-2.1.0/tests/test_MySQLdb_times.py 2021-01-08 08:30:30.000000000 +0100 @@ -1,11 +1,11 @@ -import mock -import unittest -from time import gmtime from datetime import time, date, datetime, timedelta +from time import gmtime +import unittest +from unittest import mock +import warnings from MySQLdb import times -import warnings warnings.simplefilter("ignore") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-2.0.3/tests/test_connection.py new/mysqlclient-2.1.0/tests/test_connection.py --- old/mysqlclient-2.0.3/tests/test_connection.py 1970-01-01 01:00:00.000000000 +0100 +++ new/mysqlclient-2.1.0/tests/test_connection.py 2021-09-03 04:05:17.000000000 +0200 @@ -0,0 +1,26 @@ +import pytest + +from MySQLdb._exceptions import ProgrammingError + +from configdb import connection_factory + + +def test_multi_statements_default_true(): + conn = connection_factory() + cursor = conn.cursor() + + cursor.execute("select 17; select 2") + rows = cursor.fetchall() + assert rows == ((17,),) + + +def test_multi_statements_false(): + conn = connection_factory(multi_statements=False) + cursor = conn.cursor() + + with pytest.raises(ProgrammingError): + cursor.execute("select 17; select 2") + + cursor.execute("select 17") + rows = cursor.fetchall() + assert rows == ((17,),)
