From patchwork Fri May 3 22:21:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 1095065 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44wmpF0sWpz9sD4 for ; Sat, 4 May 2019 08:22:13 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="tC6bDAkw"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44wmpD73fczDqYX for ; Sat, 4 May 2019 08:22:12 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=199.181.239.147; helo=relay0147.mxlogin.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="tC6bDAkw"; dkim-atps=neutral Received: from relay0147.mxlogin.com (relay0147.mxlogin.com [199.181.239.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44wmnm3m7jzDqY2 for ; Sat, 4 May 2019 08:21:48 +1000 (AEST) Received: from filter002.mxroute.com (unknown [94.130.183.33]) by relay0147.mxlogin.com (Postfix) with ESMTP id 8CF57CC3032C; Fri, 3 May 2019 17:21:21 -0500 (CDT) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter002.mxroute.com (Postfix) with ESMTPS id 89BB73F0B9; Fri, 3 May 2019 22:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=W3kxe2HAQMy4/aLJUzgUL2JxBPEkV/cer0RXS6fx+js=; b=tC6bDAkw5vk3AOxVdRAMZEp4m9 g2LKSH3s+V5IbuGyvfq4eQD1pj0h/A2WMu2dpTdHPU4fxSodsMii2IVjldEaAA7q71O5P9JUFBhpa qRDD2cOkBXLPPkIGd+rVXHusMfTVUDjVQHjzHNU7C99kE2O+b0GhVy3bqg4/zyzEb4pq5eoAZNVG4 bc3PUeOLXRzyjkKtp456w6IvHYKGfISpaXY+e30kCQt0CIlKZzrclY9yRIodK8rinVs+ceWZc/NRo M8O2MnCa+DKfDOIeIhLHdGx2wAmE04zecSD+eNX0XkGaiMShj57W5QpUJaqPV1439EVfJoAD6yy/f yegZ1gbA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 3/4] requirements: Switch to PyMySQL Date: Fri, 3 May 2019 16:21:09 -0600 Message-Id: <20190503222110.562-4-stephen@that.guru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190503222110.562-1-stephen@that.guru> References: <20190503222110.562-1-stephen@that.guru> MIME-Version: 1.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" This is pure Python, which means there's no need for those pesky MySQL development libs. Signed-off-by: Stephen Finucane --- manage.py | 12 ++++++++++-- requirements-dev.txt | 2 +- tox.ini | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/manage.py b/manage.py index fe6189ee..86bd67e9 100755 --- a/manage.py +++ b/manage.py @@ -2,9 +2,17 @@ import os import sys +try: + # From https://github.com/PyMySQL/PyMySQL/wiki/WhyPyMySQL + import pymysql + pymysql.install_as_MySQLdb() +except ImportError: + pass + + if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", - "patchwork.settings.production") + os.environ.setdefault( + "DJANGO_SETTINGS_MODULE", "patchwork.settings.production") from django.core.management import execute_from_command_line diff --git a/requirements-dev.txt b/requirements-dev.txt index 0efdf886..06eefd99 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,5 +6,5 @@ django-filter==1.1.0; python_version < '3.0' # pyup: ignore django-debug-toolbar==1.11 django-dbbackup==3.2.0 psycopg2-binary==2.8.2 -mysqlclient==1.3.14 +PyMySQL==0.9.3 -r requirements-test.txt diff --git a/tox.ini b/tox.ini index ba5d5104..86fb62e1 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ deps = django{20,21}: djangorestframework>=3.7,<3.10 django{20,21}: django-filter>=2.0,<3.0 postgres: psycopg2-binary==2.7.7 - mysql: mysqlclient==1.3.14 + mysql: PyMySQL==0.9.3 docker = postgres: postgres:9.6 mysql: mysql:5.7