diff options
author | Elizabeth Fischer <rpf2116@columbia.edu> | 2019-03-12 21:52:43 -0400 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-03-12 20:52:43 -0500 |
commit | 82e9c01b5cebbaee1cbdf47969e0067de44b371e (patch) | |
tree | 04d01a61cf076d690f131bdd32367d46640acba0 | |
parent | c3662492deed98557df9ba1e155124be7f08feb2 (diff) | |
download | spack-82e9c01b5cebbaee1cbdf47969e0067de44b371e.tar.gz spack-82e9c01b5cebbaee1cbdf47969e0067de44b371e.tar.bz2 spack-82e9c01b5cebbaee1cbdf47969e0067de44b371e.tar.xz spack-82e9c01b5cebbaee1cbdf47969e0067de44b371e.zip |
New package: py-mysql-connector (#10327)
* New package: py-mysql-connector
* Fixed docstring
* 1. Determined that py-setuptools was not needed at all, so removed.
2. Added py-protobuf. Docs seem to imply that only C protobuf library is required; however, the Python setup.py says differently, and some Python code seems to reference protobuf too. I don't know why this worked for me, but it looks like including py-protobuf is the right thing to do.
* Applied solution detailed in:
https://github.com/mysql/mysql-connector-python/pull/9
Uncommenting this patch will make `error: option --single-version-externally-managed not recognized` reappear.
* Clean up / reorder lines
* flake8
-rw-r--r-- | var/spack/repos/builtin/packages/py-mysql-connector/package.py | 26 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/py-mysql-connector/single-version.patch | 22 |
2 files changed, 48 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-mysql-connector/package.py b/var/spack/repos/builtin/packages/py-mysql-connector/package.py new file mode 100644 index 0000000000..e3e04280c4 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-mysql-connector/package.py @@ -0,0 +1,26 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class PyMysqlConnector(PythonPackage): + """MySQL Connector/Python is implementing the MySQL Client/Server + protocol completely in Python. No MySQL libraries are needed, and + no compilation is necessary to run this Python DB API v2.0 + compliant driver.""" + + homepage = "https://github.com/mysql/mysql-connector-python" + url = "https://github.com/mysql/mysql-connector-python/archive/8.0.13.tar.gz" + git = "https://github.com/mysql/mysql-connector-python.git" + + version('8.0.13', sha256='d4c0834c583cdb90c0aeae90b1917d58355a4bf9b0266c16fd58874a5607f9d4') + + # Fix `error: option --single-version-externally-managed not recognized` + # https://github.com/mysql/mysql-connector-python/pull/9 + patch('single-version.patch') + + depends_on('py-setuptools', type=('build', 'run')) + depends_on('py-protobuf@3.0.0:', type=('build', 'run')) diff --git a/var/spack/repos/builtin/packages/py-mysql-connector/single-version.patch b/var/spack/repos/builtin/packages/py-mysql-connector/single-version.patch new file mode 100644 index 0000000000..27cf5e5d22 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-mysql-connector/single-version.patch @@ -0,0 +1,22 @@ +diff --git a/lib/cpy_distutils.py b/lib/cpy_distutils.py +index a9132e5..3cffee6 100644 +--- a/lib/cpy_distutils.py ++++ b/lib/cpy_distutils.py +@@ -29,9 +29,14 @@ + """Implements the DistUtils command 'build_ext' + """ + +-from distutils.command.build_ext import build_ext +-from distutils.command.install import install +-from distutils.command.install_lib import install_lib ++try: ++ from setuptools.command.build_ext import build_ext ++ from setuptools.command.install import install ++ from setuptools.command.install_lib import install_lib ++except ImportError: ++ from distutils.command.build_ext import build_ext ++ from distutils.command.install import install ++ from distutils.command.install_lib import install_lib + from distutils.errors import DistutilsExecError + from distutils.util import get_platform + from distutils.version import LooseVersion |