From patchwork Sun Jun 24 19:55:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933971 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNP46RCjz9ry1 for ; Mon, 25 Jun 2018 05:56:56 +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="FLOSoiw7"; 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 41DNP44tnbzF18l for ; Mon, 25 Jun 2018 05:56:56 +1000 (AEST) 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="FLOSoiw7"; dkim-atps=neutral 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=23.83.214.30; helo=caracal.maple.relay.mailchannels.net; 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="FLOSoiw7"; dkim-atps=neutral Received: from caracal.maple.relay.mailchannels.net (caracal.maple.relay.mailchannels.net [23.83.214.30]) (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 41DNNG3839zF14h for ; Mon, 25 Jun 2018 05:56:14 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id D5FC83E2128 for ; Sun, 24 Jun 2018 19:56:10 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.33.46]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 2AA623E24AE for ; Sun, 24 Jun 2018 19:56:04 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.49.137]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Rock-Dime: 670138295e5f3dc1_1529870164426_608539419 X-MC-Loop-Signature: 1529870164425:442397348 X-MC-Ingress-Time: 1529870164425 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=hgIY+3Q4Vrd3WxZ/ajMebWPHp0v5yvWBZvVt1xeSpn8=; b=FLOSoiw7evkakFHMQ3BTEpohIx Uicti8tinHQ6pD00+SV5+JNbvVG2ylkjSEfAlYZaRlxjZkWgwZdzdKbK1G9O9hFYPjTsRGV7eqT2q Sv7VhSo3uwRtfcmOu7tBydF7FySbSVLq8cBBLSKNY7lZIFnST3ANl5mk3pv5wwcPLFrNpi3bqSrOo XWhyFSs72e0CZusICBtABufa4vg/MxIk3b6XEVj2X3QP9W2Pgulcs77Yv6+0H/8RkHwznbzGJ1yBs LL28zizCtIqJvTLRK4DU+xKqzhbCFJmdBUQIe8LZHkIToaDClaHmvaWUP4L+QyF/980GOIKkLAtRZ Bptj97uA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 01/11] REST: Check.user is not read-only Date: Sun, 24 Jun 2018 20:55:47 +0100 Message-Id: <20180624195557.19909-1-stephen@that.guru> X-Mailer: git-send-email 2.17.1 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" We only support 'Check' creation - not check updating. As a result, there's no real reason that the 'Check.user' field should be read-only and this is causing an issue with Django REST Framework 3.7. Simply remove the attribute and extend the tests to validate things are working as expected. Signed-off-by: Stephen Finucane Reviewed-by: Daniel Axtens --- patchwork/api/check.py | 2 +- patchwork/tests/api/test_check.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/patchwork/api/check.py b/patchwork/api/check.py index 8753c7de..5e461de6 100644 --- a/patchwork/api/check.py +++ b/patchwork/api/check.py @@ -44,7 +44,7 @@ class CheckSerializer(HyperlinkedModelSerializer): url = CheckHyperlinkedIdentityField('api-check-detail') patch = HiddenField(default=CurrentPatchDefault()) - user = UserSerializer(read_only=True, default=CurrentUserDefault()) + user = UserSerializer(default=CurrentUserDefault()) def run_validation(self, data): for val, label in Check.STATE_CHOICES: diff --git a/patchwork/tests/api/test_check.py b/patchwork/tests/api/test_check.py index 43181af3..0e7e0cfc 100644 --- a/patchwork/tests/api/test_check.py +++ b/patchwork/tests/api/test_check.py @@ -67,6 +67,7 @@ class TestCheckAPI(APITestCase): self.assertEqual(check_obj.target_url, check_json['target_url']) self.assertEqual(check_obj.context, check_json['context']) self.assertEqual(check_obj.description, check_json['description']) + self.assertEqual(check_obj.user.id, check_json['user']['id']) def test_list(self): """Validate we can list checks on a patch.""" From patchwork Sun Jun 24 19:55:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933972 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNPS4TYZz9ry1 for ; Mon, 25 Jun 2018 05:57:16 +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="iU5Sr1+1"; 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 41DNPS31D4zF189 for ; Mon, 25 Jun 2018 05:57:16 +1000 (AEST) 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="iU5Sr1+1"; dkim-atps=neutral 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=23.83.209.66; helo=gecko.birch.relay.mailchannels.net; 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="iU5Sr1+1"; dkim-atps=neutral Received: from gecko.birch.relay.mailchannels.net (gecko.birch.relay.mailchannels.net [23.83.209.66]) (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 41DNNG4VVwzF14j for ; Mon, 25 Jun 2018 05:56:14 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CA7833E252C for ; Sun, 24 Jun 2018 19:56:10 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.18.110]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 2E1193E2501 for ; Sun, 24 Jun 2018 19:56:06 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.55.125]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Reaction-Fearful: 1a8766de59b15db4_1529870166361_4001605071 X-MC-Loop-Signature: 1529870166361:3888056560 X-MC-Ingress-Time: 1529870166360 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=EidPfBjMMD525SfKjfb30l0XHNEmlBd+gQTXxSqINDE=; b=iU5Sr1+1vcyicwYdFVGAeqy3CL 9AeJksT2xFQHya89IaTXAhmYgXHtjS7BN9bfB6likF9UuHIbmi8IEG/HNrJWnlDineHBxE2II1NKr QNmdinhkkTT2HaVIZvMbJfj6zY83bWwGz8VVbxR086zbENfp6IFxbGqOOsoMy21sa3LYoMtvI0WiH OyyyZyenJT7vFPoq1kQaRUe09X4LeENBXvbF1QzJV9siVG9sf1T1364nGeJhjZq9NKd8lFdoBnVNx z2NjqnK6mb6eOggo63f9u0UiEUXQRCWVEEPi2DBwEIFQtWV/T08Kn4GrGDczAOgUuGueYCD/WjwA5 8TZdgbVQ==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 02/11] Add support for Django REST Framework 3.7, 3.8 Date: Sun, 24 Jun 2018 20:55:48 +0100 Message-Id: <20180624195557.19909-2-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" No breaking changes that concern us here. Signed-off-by: Stephen Finucane Reviewed-by: Daniel Axtens --- README.rst | 2 +- .../notes/django-rest-framework-3-7-bc6ad5df8bc54afc.yaml | 6 ++++++ .../notes/django-rest-framework-3-8-23865db833b4d188.yaml | 6 ++++++ requirements-dev.txt | 2 +- requirements-prod.txt | 2 +- tox.ini | 5 +++-- 6 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/django-rest-framework-3-7-bc6ad5df8bc54afc.yaml create mode 100644 releasenotes/notes/django-rest-framework-3-8-23865db833b4d188.yaml diff --git a/README.rst b/README.rst index 4a970ec5..ddc4b981 100644 --- a/README.rst +++ b/README.rst @@ -45,7 +45,7 @@ Requirements - Django (1.8 - 1.11) -- Django REST Framework (3.2 - 3.6) +- Django REST Framework (3.4 - 3.8) - Django Filters (1.0) diff --git a/releasenotes/notes/django-rest-framework-3-7-bc6ad5df8bc54afc.yaml b/releasenotes/notes/django-rest-framework-3-7-bc6ad5df8bc54afc.yaml new file mode 100644 index 00000000..4bf92c99 --- /dev/null +++ b/releasenotes/notes/django-rest-framework-3-7-bc6ad5df8bc54afc.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + `Django REST Framework 3.7 + `_ is now + supported. diff --git a/releasenotes/notes/django-rest-framework-3-8-23865db833b4d188.yaml b/releasenotes/notes/django-rest-framework-3-8-23865db833b4d188.yaml new file mode 100644 index 00000000..dc2d2c8f --- /dev/null +++ b/releasenotes/notes/django-rest-framework-3-8-23865db833b4d188.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + `Django REST Framework 3.8 + `_ is now + supported. diff --git a/requirements-dev.txt b/requirements-dev.txt index 7a8fdb9c..b12246dd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ Django>=1.8,<2.0 -djangorestframework>=3.4,<3.7 +djangorestframework>=3.4,<3.9 django-filter>=1.0,<1.1 -r requirements-test.txt diff --git a/requirements-prod.txt b/requirements-prod.txt index d249ad84..42ff8ecd 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1,5 +1,5 @@ Django>=1.8,<2.0 -djangorestframework>=3.4,<3.7 +djangorestframework>=3.4,<3.9 django-filter>=1.0,<1.1 psycopg2>=2.7,<2.8 sqlparse==0.2.4 diff --git a/tox.ini b/tox.ini index a64d9587..c1bc64e3 100644 --- a/tox.ini +++ b/tox.ini @@ -10,8 +10,9 @@ deps = django19: django>=1.9,<1.10 django110: django>=1.10,<1.11 django111: django>=1.11,<2.0 - django{18,19,110}: djangorestframework>=3.4,<3.7 - django111: djangorestframework>=3.6,<3.7 + django{18,19}: djangorestframework>=3.4,<3.7 + django110: djangorestframework>=3.4,<3.9 + django111: djangorestframework>=3.6,<3.9 django{18,19,110,111}: django-filter>=1.0,<1.1 setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev From patchwork Sun Jun 24 19:55:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933969 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNNK1VxQz9ry1 for ; Mon, 25 Jun 2018 05:56:17 +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="eMcA6Q2r"; 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 41DNNJ6kZ9zF14s for ; Mon, 25 Jun 2018 05:56:16 +1000 (AEST) 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="eMcA6Q2r"; dkim-atps=neutral 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=23.83.209.62; helo=fossa.birch.relay.mailchannels.net; 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="eMcA6Q2r"; dkim-atps=neutral Received: from fossa.birch.relay.mailchannels.net (fossa.birch.relay.mailchannels.net [23.83.209.62]) (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 41DNND4wXwzF14g for ; Mon, 25 Jun 2018 05:56:11 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7A87E5E1391 for ; Sun, 24 Jun 2018 19:56:08 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.26.53]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 6DEAF5E133F for ; Sun, 24 Jun 2018 19:56:06 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.19.51.240]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Duck-Cure: 3bbd64fe0fa19296_1529870166656_1926436379 X-MC-Loop-Signature: 1529870166656:4262772492 X-MC-Ingress-Time: 1529870166656 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=m2vkttr/PuCTQJDs2nSSQ52PCyt+bxMMHTCgAgCW5T0=; b=eMcA6Q2rZf3rDEJMUJgbOmUuOH TgWrI3fphEZmPyk2HQ1MWpm3Jxhp+K6/492Y3YYF2pUncbLVc2luOoVMZ617q9p7ghDvoA0bhZbs1 TiViZQXLnif6cgUSh9zmV0hF/PZBOrEL39AHjeWhU11FNbJJvjOiyXq6Tqi/ySNC3f6bOIw7g97TY ad9lF/izArY+e3W4BANjIltdFC2A9idu7pkIpZbMTVVBFUweb8ZnUOU4T+N+k7eB78p+ew2WcPwRh IfDhJgpIIsuEvmptELWiVtHyBEdRpPIaL0Wh7x4jxDW9u8ym9o9bJQ5STeILHtO0j9wgnDsLf3N+l iC7ZIkCQ==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 03/11] Add support for django-filter 1.1 Date: Sun, 24 Jun 2018 20:55:49 +0100 Message-Id: <20180624195557.19909-3-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" There's one warning to handle here. Signed-off-by: Stephen Finucane --- README.rst | 2 +- patchwork/api/filters.py | 5 +++-- patchwork/compat.py | 17 +++++++++++++++++ .../django-filter-1-1-6a6b0ab8cbe0faca.yaml | 6 ++++++ requirements-dev.txt | 2 +- requirements-prod.txt | 2 +- tox.ini | 3 ++- 7 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/django-filter-1-1-6a6b0ab8cbe0faca.yaml diff --git a/README.rst b/README.rst index ddc4b981..94ac32c3 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ Requirements - Django REST Framework (3.4 - 3.8) -- Django Filters (1.0) +- Django Filters (1.0 - 1.1) Development Installation ------------------------ diff --git a/patchwork/api/filters.py b/patchwork/api/filters.py index 73353d90..ddf527fd 100644 --- a/patchwork/api/filters.py +++ b/patchwork/api/filters.py @@ -26,6 +26,7 @@ from django_filters import ModelMultipleChoiceFilter from django.forms import ModelMultipleChoiceField as BaseMultipleChoiceField from django.forms.widgets import MultipleHiddenInput +from patchwork.compat import NAME_FIELD from patchwork.models import Bundle from patchwork.models import Check from patchwork.models import CoverLetter @@ -151,8 +152,8 @@ class UserFilter(ModelMultipleChoiceFilter): class TimestampMixin(FilterSet): # TODO(stephenfin): These should filter on a 'updated_at' field instead - before = IsoDateTimeFilter(name='date', lookup_expr='lt') - since = IsoDateTimeFilter(name='date', lookup_expr='gte') + before = IsoDateTimeFilter(lookup_expr='lt', **{NAME_FIELD: 'date'}) + since = IsoDateTimeFilter(lookup_expr='gte', **{NAME_FIELD: 'date'}) class SeriesFilterSet(TimestampMixin, FilterSet): diff --git a/patchwork/compat.py b/patchwork/compat.py index 38caa4e8..e74e9264 100644 --- a/patchwork/compat.py +++ b/patchwork/compat.py @@ -41,6 +41,23 @@ if settings.ENABLE_REST_API: from rest_framework.filters import DjangoFilterBackend # noqa +# NAME_FIELD +# +# The django-filter library renamed 'Filter.name' to 'Filter.field_name' in +# 1.1. +# +# https://django-filter.readthedocs.io/en/master/guide/migration.html\ +# #migrating-to-2-0 + +if settings.ENABLE_REST_API: + import django_filters # noqa + + if django_filters.VERSION >= (1, 1): + NAME_FIELD = 'field_name' + else: + NAME_FIELD = 'name' + + # reverse, reverse_lazy # # The reverse and reverse_lazy functions have been moved to django.urls in diff --git a/releasenotes/notes/django-filter-1-1-6a6b0ab8cbe0faca.yaml b/releasenotes/notes/django-filter-1-1-6a6b0ab8cbe0faca.yaml new file mode 100644 index 00000000..3beb9c08 --- /dev/null +++ b/releasenotes/notes/django-filter-1-1-6a6b0ab8cbe0faca.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + `django-filter 1.1 + `_ is + now supported. diff --git a/requirements-dev.txt b/requirements-dev.txt index b12246dd..1d58df71 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ Django>=1.8,<2.0 djangorestframework>=3.4,<3.9 -django-filter>=1.0,<1.1 +django-filter>=1.0,<1.2 -r requirements-test.txt diff --git a/requirements-prod.txt b/requirements-prod.txt index 42ff8ecd..59e2c1e6 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1,5 +1,5 @@ Django>=1.8,<2.0 djangorestframework>=3.4,<3.9 -django-filter>=1.0,<1.1 +django-filter>=1.0,<1.2 psycopg2>=2.7,<2.8 sqlparse==0.2.4 diff --git a/tox.ini b/tox.ini index c1bc64e3..9aac8247 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,8 @@ deps = django{18,19}: djangorestframework>=3.4,<3.7 django110: djangorestframework>=3.4,<3.9 django111: djangorestframework>=3.6,<3.9 - django{18,19,110,111}: django-filter>=1.0,<1.1 + django18: django-filter>=1.0,<1.1 + django{19,110,111}: django-filter>=1.0,<1.2 setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev PYTHONDONTWRITEBYTECODE = 1 From patchwork Sun Jun 24 19:55:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNPr09cMz9ry1 for ; Mon, 25 Jun 2018 05:57:36 +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="gVOQ7IaN"; 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 41DNPq5jDDzF14j for ; Mon, 25 Jun 2018 05:57:35 +1000 (AEST) 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="gVOQ7IaN"; dkim-atps=neutral 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=23.83.214.38; helo=common.maple.relay.mailchannels.net; 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="gVOQ7IaN"; dkim-atps=neutral Received: from common.maple.relay.mailchannels.net (common.maple.relay.mailchannels.net [23.83.214.38]) (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 41DNNH6LKszF14s for ; Mon, 25 Jun 2018 05:56:15 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 4218C12228D for ; Sun, 24 Jun 2018 19:56:13 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.18.110]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id E7D18121F5F for ; Sun, 24 Jun 2018 19:56:08 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.36.240]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Chemical-Supply: 4b5c011063c95572_1529870169158_846868064 X-MC-Loop-Signature: 1529870169158:4223968879 X-MC-Ingress-Time: 1529870169157 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=qcp+thuQ7Q26kiUVAEot9CxZsG2LB3fwgU3DnpiYtls=; b=gVOQ7IaNxkcsAgwlSicZARzhYg OcnxQgdo19yd8YtayvxJTxS65qeG2auFhOFkPB0zP7JjV75NRGAufHL1Ree4a4ogvHrdvR0gtcbg5 7rWKfMF8ogV/pmow8/mVrjZU/MuBNh+lbXml3RTBupNOv+m876t+xrB52VQwSvzk8bCbv2yrwqghC CV92aE18u7Wc7uyuUxyDSW8rvKiYCSfoJUphu1q2qxqiyU6ftgM6AZrNyBYXAzj4zl/UZEifsi10q DYpUZEYx+0A7JT0Mth+HHNHN0AWI9a51JuvmxsJPlpR7NnSfoiyabRIEnKPh8QEWtDfjmEiV7cvct Fjj1H8dQ==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 04/11] Remove support for Django 1.8, 1.9, 1.10 Date: Sun, 24 Jun 2018 20:55:50 +0100 Message-Id: <20180624195557.19909-4-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" These are now all EOL and Debian Testing supports Django 1.11 (LTS). We can and should drop them. This change does not remove the many compat wrappers. These will be removed separately (there are a lot of them). This leaves 1.11 as the only supported version. This will be remedied shortly with the inclusion of Django 2.0 support. Signed-off-by: Stephen Finucane --- README.rst | 4 ++-- .../migrations/0021_django_1_10_fixes.py | 13 ++++++------- patchwork/models.py | 8 +------- patchwork/settings/base.py | 17 +++++------------ patchwork/settings/dev.py | 19 ++++++------------- patchwork/settings/production.example.py | 8 ++++---- requirements-dev.txt | 2 +- requirements-prod.txt | 2 +- tox.ini | 10 ++-------- 9 files changed, 28 insertions(+), 55 deletions(-) diff --git a/README.rst b/README.rst index 94ac32c3..062166e9 100644 --- a/README.rst +++ b/README.rst @@ -43,9 +43,9 @@ Requirements - Python (2.7, 3.4 - 3.6) -- Django (1.8 - 1.11) +- Django (1.11 - 2.0) -- Django REST Framework (3.4 - 3.8) +- Django REST Framework (3.6 - 3.8) - Django Filters (1.0 - 1.1) diff --git a/patchwork/migrations/0021_django_1_10_fixes.py b/patchwork/migrations/0021_django_1_10_fixes.py index 55aedbec..ff1d8875 100644 --- a/patchwork/migrations/0021_django_1_10_fixes.py +++ b/patchwork/migrations/0021_django_1_10_fixes.py @@ -18,10 +18,9 @@ class Migration(migrations.Migration): ), ] - if django.VERSION >= (1, 10): - operations += [ - migrations.AlterModelOptions( - name='patch', - options={'base_manager_name': 'objects', 'verbose_name_plural': 'Patches'}, - ), - ] + operations += [ + migrations.AlterModelOptions( + name='patch', + options={'base_manager_name': 'objects', 'verbose_name_plural': 'Patches'}, + ), + ] diff --git a/patchwork/models.py b/patchwork/models.py index 6268f5b7..71a07c94 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -26,7 +26,6 @@ import datetime import random import re -import django from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError @@ -309,10 +308,6 @@ class PatchQuerySet(models.query.QuerySet): class PatchManager(models.Manager): - use_for_related_fields = True - # NOTE(stephenfin): This is necessary to silence a warning with Django >= - # 1.10. Remove when 1.10 is the minimum supported version. - silence_use_for_related_fields_deprecation = True def get_queryset(self): return PatchQuerySet(self.model, using=self.db) @@ -595,8 +590,7 @@ class Patch(SeriesMixin, Submission): class Meta: verbose_name_plural = 'Patches' - if django.VERSION >= (1, 10): - base_manager_name = 'objects' + base_manager_name = 'objects' class Comment(EmailMixin, models.Model): diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index 4b0d5513..f96f3694 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -4,14 +4,12 @@ Base settings for patchwork project. import os -import django - ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir) # # Core settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings +# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings # INSTALLED_APPS = [ @@ -26,7 +24,7 @@ INSTALLED_APPS = [ 'patchwork', ] -_MIDDLEWARE_CLASSES = [ +MIDDLEWARE = [ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -37,11 +35,6 @@ _MIDDLEWARE_CLASSES = [ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', ] -if django.VERSION >= (1, 10): - MIDDLEWARE = _MIDDLEWARE_CLASSES -else: - MIDDLEWARE_CLASSES = _MIDDLEWARE_CLASSES - TIME_ZONE = 'Australia/Canberra' LANGUAGE_CODE = 'en-au' @@ -83,7 +76,7 @@ SERVER_EMAIL = DEFAULT_FROM_EMAIL # # Auth settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#auth +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth # LOGIN_URL = 'auth_login' @@ -93,7 +86,7 @@ LOGIN_REDIRECT_URL = 'user-profile' # # Sites settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#sites +# https://docs.djangoproject.com/en/1.11/ref/settings/#sites # SITE_ID = 1 @@ -101,7 +94,7 @@ SITE_ID = 1 # # Static files settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files +# https://docs.djangoproject.com/en/1.11/ref/settings/#static-files # STATIC_URL = '/static/' diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py index 7bdfdffa..62d98929 100644 --- a/patchwork/settings/dev.py +++ b/patchwork/settings/dev.py @@ -9,13 +9,11 @@ Design based on: from __future__ import absolute_import -import django - from .base import * # noqa # # Core settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings +# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings # @@ -46,11 +44,11 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # # Auth settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#auth +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth # # Use a faster, though less secure, password hasher for faster tests -# https://docs.djangoproject.com/es/1.9/topics/testing/overview/#password-hashing +# https://docs.djangoproject.com/es/1.11/topics/testing/overview/#password-hashing PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher'] # @@ -66,14 +64,9 @@ INSTALLED_APPS += [ DEBUG_TOOLBAR_PATCH_SETTINGS = False # This should go first in the middleware classes -if django.VERSION >= (1, 10): - MIDDLEWARE = [ - 'debug_toolbar.middleware.DebugToolbarMiddleware', - ] + MIDDLEWARE -else: - MIDDLEWARE_CLASSES = [ - 'debug_toolbar.middleware.DebugToolbarMiddleware', - ] + MIDDLEWARE_CLASSES +MIDDLEWARE = [ + 'debug_toolbar.middleware.DebugToolbarMiddleware', +] + MIDDLEWARE INTERNAL_IPS = [ '127.0.0.1', '::1', diff --git a/patchwork/settings/production.example.py b/patchwork/settings/production.example.py index e97ba578..0c7a88c0 100644 --- a/patchwork/settings/production.example.py +++ b/patchwork/settings/production.example.py @@ -15,7 +15,7 @@ from .base import * # noqa # # Core settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings +# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings # # Security @@ -51,7 +51,7 @@ ADMINS = ( # # If you're using a postgres database, connecting over a local unix-domain # socket, then the following setting should work for you. Otherwise, -# see https://docs.djangoproject.com/en/1.8/ref/settings/#databases +# see https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { 'default': { @@ -66,8 +66,8 @@ DATABASES = { # # Static files settings -# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files -# https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#manifeststaticfilesstorage +# https://docs.djangoproject.com/en/1.11/ref/settings/#static-files +# https://docs.djangoproject.com/en/1.11/ref/contrib/staticfiles/#manifeststaticfilesstorage # STATIC_ROOT = os.environ.get('STATIC_ROOT', '/srv/patchwork/htdocs/static') diff --git a/requirements-dev.txt b/requirements-dev.txt index 1d58df71..8bad8f07 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -Django>=1.8,<2.0 +Django>=1.11,<2.0 djangorestframework>=3.4,<3.9 django-filter>=1.0,<1.2 -r requirements-test.txt diff --git a/requirements-prod.txt b/requirements-prod.txt index 59e2c1e6..c30688cc 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1,4 +1,4 @@ -Django>=1.8,<2.0 +Django>=1.11,<2.0 djangorestframework>=3.4,<3.9 django-filter>=1.0,<1.2 psycopg2>=2.7,<2.8 diff --git a/tox.ini b/tox.ini index 9aac8247..5f3d7e72 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,14 @@ [tox] minversion = 2.0 -envlist = pep8,docs,py{27,34,35}-django{18,19,110,111},py36-django111 +envlist = pep8,docs,py{27,34,35,36}-django111 skipsdist = True [testenv] deps = -r{toxinidir}/requirements-test.txt - django18: django>=1.8,<1.9 - django19: django>=1.9,<1.10 - django110: django>=1.10,<1.11 django111: django>=1.11,<2.0 - django{18,19}: djangorestframework>=3.4,<3.7 - django110: djangorestframework>=3.4,<3.9 django111: djangorestframework>=3.6,<3.9 - django18: django-filter>=1.0,<1.1 - django{19,110,111}: django-filter>=1.0,<1.2 + django111: django-filter>=1.0,<1.2 setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev PYTHONDONTWRITEBYTECODE = 1 From patchwork Sun Jun 24 19:55:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNNj2rYNz9ry1 for ; Mon, 25 Jun 2018 05:56:37 +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="GSkD8Ezn"; 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 41DNNj1KhRzF1Cl for ; Mon, 25 Jun 2018 05:56:37 +1000 (AEST) 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="GSkD8Ezn"; dkim-atps=neutral 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=23.83.214.39; helo=coral.maple.relay.mailchannels.net; 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="GSkD8Ezn"; dkim-atps=neutral Received: from coral.maple.relay.mailchannels.net (coral.maple.relay.mailchannels.net [23.83.214.39]) (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 41DNNG00g2zF14g for ; Mon, 25 Jun 2018 05:56:13 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CAC7F281C51 for ; Sun, 24 Jun 2018 19:56:10 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.31.16]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id D3175281AE2 for ; Sun, 24 Jun 2018 19:56:08 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.19.42.59]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Dime-Sponge: 5b9cbe863d5082ed_1529870169232_1874239398 X-MC-Loop-Signature: 1529870169232:3030210557 X-MC-Ingress-Time: 1529870169232 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=Aey/B7U24smchb+KnYpFtvvnS6phMv16AP2aaD4cpfw=; b=GSkD8Ezn0F33WUbdPCM7lHKJtZ ozUA7slNxHOWF86f3rwliO66zNgS/TAfwGVdue7uSjl5eFy75dbduhtP5BbLkPExtr1mi5q8mYZxV Y3guWTVAL2acX/VJY3naGDBpEGEzMrq+PZ+pCfK8t89i1ru87P3+1d5T6wiBUCMIUvDqxl1jMDtsI 8+eKGk8LLxj6JzYu2r7zkY/E0ziZUBPsUZzf/xFli7MNdNXCwBp1TFtzFXUTlRDoTp1+KxQuP1w3H 8qle8n17c8DEqcHMZ1/niyan4EgAWGi/4PQrwn+NWi0hCQ21qYg6y9kYelK/4bGNFB9NyhJFlUb3X lsDR60QA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 05/11] Remove compat wrapper for Django < 1.11 Date: Sun, 24 Jun 2018 20:55:51 +0100 Message-Id: <20180624195557.19909-5-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Deleting code is fun. We no longer need to carry these so don't. Signed-off-by: Stephen Finucane --- patchwork/api/bundle.py | 3 +- patchwork/compat.py | 50 +-------------------------- patchwork/models.py | 7 ++-- patchwork/paginator.py | 4 +-- patchwork/settings/base.py | 2 +- patchwork/templatetags/listurl.py | 4 +-- patchwork/templatetags/person.py | 2 +- patchwork/tests/api/test_bundle.py | 2 +- patchwork/tests/api/test_check.py | 2 +- patchwork/tests/api/test_comment.py | 4 +-- patchwork/tests/api/test_cover.py | 2 +- patchwork/tests/api/test_patch.py | 2 +- patchwork/tests/api/test_person.py | 2 +- patchwork/tests/api/test_project.py | 2 +- patchwork/tests/api/test_series.py | 2 +- patchwork/tests/api/test_user.py | 2 +- patchwork/tests/test_about.py | 3 +- patchwork/tests/test_bundles.py | 2 +- patchwork/tests/test_completion.py | 2 +- patchwork/tests/test_confirm.py | 2 +- patchwork/tests/test_detail.py | 2 +- patchwork/tests/test_encodings.py | 2 +- patchwork/tests/test_filters.py | 2 +- patchwork/tests/test_list.py | 2 +- patchwork/tests/test_mail_settings.py | 2 +- patchwork/tests/test_mboxviews.py | 2 +- patchwork/tests/test_paginator.py | 2 +- patchwork/tests/test_projects.py | 2 +- patchwork/tests/test_registration.py | 2 +- patchwork/tests/test_updates.py | 2 +- patchwork/tests/test_user.py | 2 +- patchwork/tests/test_xmlrpc.py | 2 +- patchwork/urls.py | 2 +- patchwork/views/__init__.py | 3 +- patchwork/views/about.py | 3 +- patchwork/views/bundle.py | 2 +- patchwork/views/comment.py | 2 +- patchwork/views/cover.py | 2 +- patchwork/views/mail.py | 2 +- patchwork/views/patch.py | 9 +++-- patchwork/views/project.py | 2 +- patchwork/views/user.py | 2 +- patchwork/views/xmlrpc.py | 2 +- 43 files changed, 50 insertions(+), 106 deletions(-) diff --git a/patchwork/api/bundle.py b/patchwork/api/bundle.py index b0005daa..7b147e1d 100644 --- a/patchwork/api/bundle.py +++ b/patchwork/api/bundle.py @@ -28,7 +28,6 @@ from patchwork.api.filters import BundleFilterSet from patchwork.api.embedded import PatchSerializer from patchwork.api.embedded import ProjectSerializer from patchwork.api.embedded import UserSerializer -from patchwork.compat import is_authenticated from patchwork.models import Bundle @@ -67,7 +66,7 @@ class BundleMixin(object): serializer_class = BundleSerializer def get_queryset(self): - if is_authenticated(self.request.user): + if self.request.user.is_authenticated: bundle_filter = Q(owner=self.request.user) | Q(public=True) else: bundle_filter = Q(public=True) diff --git a/patchwork/compat.py b/patchwork/compat.py index e74e9264..9383143c 100644 --- a/patchwork/compat.py +++ b/patchwork/compat.py @@ -17,30 +17,11 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -"""Compatibility wrappers for various Django versions.""" +"""Compatibility wrappers for various library versions.""" -import django from django.conf import settings -# DjangoFilterBackend -# -# The DjangoFilterBackend was provided in Django REST Framework from 3.0 to -# 3.4, was marked as pending deprecation in 3.5, was deprecated in 3.6 and will -# be removed in 3.7. However, the equivalent DjangoFilterBackend found in -# django-filter is only available since 1.0 of that package. -# -# http://www.django-rest-framework.org/topics/3.6-announcement/ - -if settings.ENABLE_REST_API: - import rest_framework # noqa - - if rest_framework.VERSION >= '3.5': - from django_filters.rest_framework import DjangoFilterBackend # noqa - else: - from rest_framework.filters import DjangoFilterBackend # noqa - - # NAME_FIELD # # The django-filter library renamed 'Filter.name' to 'Filter.field_name' in @@ -56,32 +37,3 @@ if settings.ENABLE_REST_API: NAME_FIELD = 'field_name' else: NAME_FIELD = 'name' - - -# reverse, reverse_lazy -# -# The reverse and reverse_lazy functions have been moved to django.urls in -# Django 1.10 and backwards compatible imports will be removed in Django 2.0 - -if django.VERSION >= (1, 10): - from django.urls import NoReverseMatch # noqa - from django.urls import reverse # noqa - from django.urls import reverse_lazy # noqa -else: - from django.core.urlresolvers import NoReverseMatch # noqa - from django.core.urlresolvers import reverse # noqa - from django.core.urlresolvers import reverse_lazy # noqa - - -# is_authenticated -# -# models.User.is_authenticated is now an attribute in Django 1.10 instead of a -# function -# -# https://docs.djangoproject.com/en/dev/releases/1.10/ - -def is_authenticated(user): - if django.VERSION >= (1, 10): - return user.is_authenticated - else: - return user.is_authenticated() diff --git a/patchwork/models.py b/patchwork/models.py index 71a07c94..0409d4bf 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -30,11 +30,10 @@ from django.conf import settings from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.db import models +from django.urls import reverse from django.utils.encoding import python_2_unicode_compatible from django.utils.functional import cached_property -from patchwork.compat import is_authenticated -from patchwork.compat import reverse from patchwork.fields import HashField from patchwork.hasher import hash_diff @@ -101,7 +100,7 @@ class Project(models.Model): use_tags = models.BooleanField(default=True) def is_editable(self, user): - if not is_authenticated(user): + if not user.is_authenticated: return False return self in user.profile.maintainer_projects.all() @@ -481,7 +480,7 @@ class Patch(SeriesMixin, Submission): self.refresh_tag_counts() def is_editable(self, user): - if not is_authenticated(user): + if not user.is_authenticated: return False if user in [self.submitter.user, self.delegate]: diff --git a/patchwork/paginator.py b/patchwork/paginator.py index 359ec867..f565c420 100644 --- a/patchwork/paginator.py +++ b/patchwork/paginator.py @@ -22,8 +22,6 @@ from __future__ import absolute_import from django.conf import settings from django.core import paginator -from patchwork.compat import is_authenticated - DEFAULT_ITEMS_PER_PAGE = 100 LONG_PAGE_THRESHOLD = 30 @@ -44,7 +42,7 @@ class Paginator(paginator.Paginator): items_per_page = settings.DEFAULT_ITEMS_PER_PAGE - if is_authenticated(request.user): + if request.user.is_authenticated: items_per_page = request.user.profile.items_per_page super(Paginator, self).__init__(objects, items_per_page) diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index f96f3694..99eb3c06 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -128,7 +128,7 @@ REST_FRAMEWORK = { 'rest_framework.versioning.URLPathVersioning', 'DEFAULT_PAGINATION_CLASS': 'patchwork.api.base.LinkHeaderPagination', 'DEFAULT_FILTER_BACKENDS': ( - 'patchwork.compat.DjangoFilterBackend', + 'django_filters.rest_framework.DjangoFilterBackend', 'rest_framework.filters.SearchFilter', 'rest_framework.filters.OrderingFilter', ), diff --git a/patchwork/templatetags/listurl.py b/patchwork/templatetags/listurl.py index 6b9106e9..76dae797 100644 --- a/patchwork/templatetags/listurl.py +++ b/patchwork/templatetags/listurl.py @@ -21,11 +21,11 @@ from __future__ import absolute_import from django.conf import settings from django import template +from django.urls import reverse +from django.urls import NoReverseMatch from django.utils.encoding import smart_str from django.utils.html import escape -from patchwork.compat import reverse -from patchwork.compat import NoReverseMatch from patchwork.filters import filterclasses diff --git a/patchwork/templatetags/person.py b/patchwork/templatetags/person.py index a6f23e91..09c8d103 100644 --- a/patchwork/templatetags/person.py +++ b/patchwork/templatetags/person.py @@ -20,10 +20,10 @@ from __future__ import absolute_import from django import template +from django.urls import reverse from django.utils.html import escape from django.utils.safestring import mark_safe -from patchwork.compat import reverse from patchwork.filters import SubmitterFilter diff --git a/patchwork/tests/api/test_bundle.py b/patchwork/tests/api/test_bundle.py index 7c48d344..e0dd8098 100644 --- a/patchwork/tests/api/test_bundle.py +++ b/patchwork/tests/api/test_bundle.py @@ -20,8 +20,8 @@ import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_bundle from patchwork.tests.utils import create_maintainer from patchwork.tests.utils import create_project diff --git a/patchwork/tests/api/test_check.py b/patchwork/tests/api/test_check.py index 0e7e0cfc..6f4aa5de 100644 --- a/patchwork/tests/api/test_check.py +++ b/patchwork/tests/api/test_check.py @@ -20,8 +20,8 @@ import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import Check from patchwork.tests.utils import create_check from patchwork.tests.utils import create_patch diff --git a/patchwork/tests/api/test_comment.py b/patchwork/tests/api/test_comment.py index f79ea469..f82c881a 100644 --- a/patchwork/tests/api/test_comment.py +++ b/patchwork/tests/api/test_comment.py @@ -20,9 +20,9 @@ import unittest from django.conf import settings +from django.urls import NoReverseMatch +from django.urls import reverse -from patchwork.compat import NoReverseMatch -from patchwork.compat import reverse from patchwork.tests.utils import create_comment from patchwork.tests.utils import create_cover from patchwork.tests.utils import create_patch diff --git a/patchwork/tests/api/test_cover.py b/patchwork/tests/api/test_cover.py index e4d814e4..5061d651 100644 --- a/patchwork/tests/api/test_cover.py +++ b/patchwork/tests/api/test_cover.py @@ -21,8 +21,8 @@ import email.parser import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_cover from patchwork.tests.utils import create_maintainer from patchwork.tests.utils import create_person diff --git a/patchwork/tests/api/test_patch.py b/patchwork/tests/api/test_patch.py index 27b99248..104f7c8a 100644 --- a/patchwork/tests/api/test_patch.py +++ b/patchwork/tests/api/test_patch.py @@ -22,8 +22,8 @@ from email.utils import make_msgid import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import Patch from patchwork.tests.utils import create_maintainer from patchwork.tests.utils import create_patch diff --git a/patchwork/tests/api/test_person.py b/patchwork/tests/api/test_person.py index 22b12813..688a00e9 100644 --- a/patchwork/tests/api/test_person.py +++ b/patchwork/tests/api/test_person.py @@ -20,8 +20,8 @@ import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_maintainer from patchwork.tests.utils import create_person from patchwork.tests.utils import create_user diff --git a/patchwork/tests/api/test_project.py b/patchwork/tests/api/test_project.py index 129cedb7..6c5c9c6d 100644 --- a/patchwork/tests/api/test_project.py +++ b/patchwork/tests/api/test_project.py @@ -20,8 +20,8 @@ import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import Project from patchwork.tests.utils import create_maintainer from patchwork.tests.utils import create_project diff --git a/patchwork/tests/api/test_series.py b/patchwork/tests/api/test_series.py index 11324bc3..13872575 100644 --- a/patchwork/tests/api/test_series.py +++ b/patchwork/tests/api/test_series.py @@ -20,8 +20,8 @@ import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_cover from patchwork.tests.utils import create_maintainer from patchwork.tests.utils import create_project diff --git a/patchwork/tests/api/test_user.py b/patchwork/tests/api/test_user.py index 873312df..4b4171ea 100644 --- a/patchwork/tests/api/test_user.py +++ b/patchwork/tests/api/test_user.py @@ -20,8 +20,8 @@ import unittest from django.conf import settings +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_maintainer from patchwork.tests.utils import create_user diff --git a/patchwork/tests/test_about.py b/patchwork/tests/test_about.py index f4059682..956d0324 100644 --- a/patchwork/tests/test_about.py +++ b/patchwork/tests/test_about.py @@ -18,8 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from django.test import TestCase - -from patchwork.compat import reverse +from django.urls import reverse class AboutViewTest(TestCase): diff --git a/patchwork/tests/test_bundles.py b/patchwork/tests/test_bundles.py index 4461e32f..3fa556b0 100644 --- a/patchwork/tests/test_bundles.py +++ b/patchwork/tests/test_bundles.py @@ -25,12 +25,12 @@ import unittest from django.conf import settings from django.test import TestCase +from django.urls import reverse from django.utils.http import urlencode from django.utils import six from django.utils.six.moves import range from django.utils.six.moves import zip -from patchwork.compat import reverse from patchwork.models import Bundle from patchwork.models import BundlePatch from patchwork.tests.utils import create_bundle diff --git a/patchwork/tests/test_completion.py b/patchwork/tests/test_completion.py index 8297e571..8e769d4b 100644 --- a/patchwork/tests/test_completion.py +++ b/patchwork/tests/test_completion.py @@ -22,9 +22,9 @@ from __future__ import absolute_import import json from django.test import TestCase +from django.urls import reverse from django.utils.six.moves import range -from patchwork.compat import reverse from patchwork.tests.utils import create_person diff --git a/patchwork/tests/test_confirm.py b/patchwork/tests/test_confirm.py index ed264313..7d805300 100644 --- a/patchwork/tests/test_confirm.py +++ b/patchwork/tests/test_confirm.py @@ -18,8 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import EmailConfirmation from patchwork.tests.utils import create_user diff --git a/patchwork/tests/test_detail.py b/patchwork/tests/test_detail.py index 5d8534ea..f119da05 100644 --- a/patchwork/tests/test_detail.py +++ b/patchwork/tests/test_detail.py @@ -20,8 +20,8 @@ from __future__ import absolute_import from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_comment from patchwork.tests.utils import create_cover from patchwork.tests.utils import create_patch diff --git a/patchwork/tests/test_encodings.py b/patchwork/tests/test_encodings.py index 794d67ac..5a56d4b1 100644 --- a/patchwork/tests/test_encodings.py +++ b/patchwork/tests/test_encodings.py @@ -18,8 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_person from patchwork.tests.utils import create_patch from patchwork.tests.utils import read_patch diff --git a/patchwork/tests/test_filters.py b/patchwork/tests/test_filters.py index 23cf0ff0..44180f90 100644 --- a/patchwork/tests/test_filters.py +++ b/patchwork/tests/test_filters.py @@ -18,8 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_project diff --git a/patchwork/tests/test_list.py b/patchwork/tests/test_list.py index 2a023ac6..867d77f6 100644 --- a/patchwork/tests/test_list.py +++ b/patchwork/tests/test_list.py @@ -23,9 +23,9 @@ from datetime import datetime as dt import re from django.test import TestCase +from django.urls import reverse from django.utils.six.moves import zip -from patchwork.compat import reverse from patchwork.models import Patch from patchwork.tests.utils import create_patch from patchwork.tests.utils import create_person diff --git a/patchwork/tests/test_mail_settings.py b/patchwork/tests/test_mail_settings.py index d38149d8..a6f49645 100644 --- a/patchwork/tests/test_mail_settings.py +++ b/patchwork/tests/test_mail_settings.py @@ -21,8 +21,8 @@ import re from django.core import mail from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import EmailOptout from patchwork.models import EmailConfirmation from patchwork.tests.utils import create_person diff --git a/patchwork/tests/test_mboxviews.py b/patchwork/tests/test_mboxviews.py index 8eb3581a..b7af746b 100644 --- a/patchwork/tests/test_mboxviews.py +++ b/patchwork/tests/test_mboxviews.py @@ -25,8 +25,8 @@ import dateutil.tz import email from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_comment from patchwork.tests.utils import create_patch from patchwork.tests.utils import create_project diff --git a/patchwork/tests/test_paginator.py b/patchwork/tests/test_paginator.py index b2191bbb..2f2b6e13 100644 --- a/patchwork/tests/test_paginator.py +++ b/patchwork/tests/test_paginator.py @@ -18,8 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests.utils import create_patches from patchwork.tests.utils import create_project from patchwork.tests.utils import create_user diff --git a/patchwork/tests/test_projects.py b/patchwork/tests/test_projects.py index 804bdda2..67ac1250 100644 --- a/patchwork/tests/test_projects.py +++ b/patchwork/tests/test_projects.py @@ -18,8 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.tests import utils diff --git a/patchwork/tests/test_registration.py b/patchwork/tests/test_registration.py index 28581eb5..2158dcf5 100644 --- a/patchwork/tests/test_registration.py +++ b/patchwork/tests/test_registration.py @@ -21,8 +21,8 @@ from django.contrib.auth.models import User from django.core import mail from django.test.client import Client from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import EmailConfirmation, Person from patchwork.tests.utils import create_user diff --git a/patchwork/tests/test_updates.py b/patchwork/tests/test_updates.py index 80367f45..89f2091a 100644 --- a/patchwork/tests/test_updates.py +++ b/patchwork/tests/test_updates.py @@ -18,8 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import Patch from patchwork.models import State from patchwork.tests.utils import create_patches diff --git a/patchwork/tests/test_user.py b/patchwork/tests/test_user.py index 6dd41e1f..05fe6d5e 100644 --- a/patchwork/tests/test_user.py +++ b/patchwork/tests/test_user.py @@ -20,8 +20,8 @@ from django.contrib.auth.models import User from django.core import mail from django.test import TestCase +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import EmailConfirmation from patchwork.models import Person from patchwork.models import UserProfile diff --git a/patchwork/tests/test_xmlrpc.py b/patchwork/tests/test_xmlrpc.py index 8edc07ac..a31cdde0 100644 --- a/patchwork/tests/test_xmlrpc.py +++ b/patchwork/tests/test_xmlrpc.py @@ -21,9 +21,9 @@ import unittest from django.conf import settings from django.test import LiveServerTestCase +from django.urls import reverse from django.utils.six.moves import xmlrpc_client -from patchwork.compat import reverse from patchwork.tests import utils diff --git a/patchwork/urls.py b/patchwork/urls.py index e90de6b2..6b1ef511 100644 --- a/patchwork/urls.py +++ b/patchwork/urls.py @@ -22,8 +22,8 @@ from django.conf import settings from django.conf.urls import url, include from django.contrib import admin from django.contrib.auth import views as auth_views +from django.urls import reverse_lazy -from patchwork.compat import reverse_lazy from patchwork.views import about as about_views from patchwork.views import api as api_views from patchwork.views import bundle as bundle_views diff --git a/patchwork/views/__init__.py b/patchwork/views/__init__.py index f8d23a38..a30b3a61 100644 --- a/patchwork/views/__init__.py +++ b/patchwork/views/__init__.py @@ -20,7 +20,6 @@ from django.contrib import messages from django.shortcuts import get_object_or_404 -from patchwork.compat import is_authenticated from patchwork.filters import Filters from patchwork.forms import MultiplePatchForm from patchwork.models import Bundle @@ -230,7 +229,7 @@ def generic_list(request, project, view, view_args=None, filter_settings=None, user = request.user properties_form = None - if is_authenticated(user): + if user.is_authenticated: # we only pass the post data to the MultiplePatchForm if that was # the actual form submitted data_tmp = None diff --git a/patchwork/views/about.py b/patchwork/views/about.py index 24a0845e..508dec37 100644 --- a/patchwork/views/about.py +++ b/patchwork/views/about.py @@ -21,8 +21,7 @@ from django.conf import settings from django.http import HttpResponsePermanentRedirect from django.shortcuts import render - -from patchwork.compat import reverse +from django.urls import reverse def about(request): diff --git a/patchwork/views/bundle.py b/patchwork/views/bundle.py index 5aa63fba..714062c3 100644 --- a/patchwork/views/bundle.py +++ b/patchwork/views/bundle.py @@ -24,8 +24,8 @@ from django.http import HttpResponseRedirect from django.http import HttpResponseNotFound from django.shortcuts import get_object_or_404 from django.shortcuts import render +from django.urls import reverse -from patchwork.compat import reverse from patchwork.filters import DelegateFilter from patchwork.forms import BundleForm from patchwork.forms import DeleteBundleForm diff --git a/patchwork/views/comment.py b/patchwork/views/comment.py index 987f76c5..c9763227 100644 --- a/patchwork/views/comment.py +++ b/patchwork/views/comment.py @@ -19,8 +19,8 @@ from django import http from django import shortcuts +from django.urls import reverse -from patchwork.compat import reverse from patchwork import models diff --git a/patchwork/views/cover.py b/patchwork/views/cover.py index 73f83cb9..f18a262f 100644 --- a/patchwork/views/cover.py +++ b/patchwork/views/cover.py @@ -22,8 +22,8 @@ from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render_to_response +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import CoverLetter from patchwork.models import Submission from patchwork.views.utils import cover_to_mbox diff --git a/patchwork/views/mail.py b/patchwork/views/mail.py index 8afd83b3..aca7ab15 100644 --- a/patchwork/views/mail.py +++ b/patchwork/views/mail.py @@ -24,8 +24,8 @@ from django.core.mail import send_mail from django.http import HttpResponseRedirect from django.shortcuts import render from django.template.loader import render_to_string +from django.urls import reverse -from patchwork.compat import reverse from patchwork.forms import EmailForm from patchwork.models import EmailConfirmation from patchwork.models import EmailOptout diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index cbd4ec39..6921882e 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -24,9 +24,8 @@ from django.http import HttpResponseForbidden from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render +from django.urls import reverse -from patchwork.compat import reverse -from patchwork.compat import is_authenticated from patchwork.forms import CreateBundleForm from patchwork.forms import PatchForm from patchwork.models import Bundle @@ -43,7 +42,7 @@ def patch_list(request, project_id): context = generic_list(request, project, 'patch-list', view_args={'project_id': project.linkname}) - if is_authenticated(request.user): + if request.user.is_authenticated: context['bundles'] = request.user.bundles.all() return render(request, 'patchwork/list.html', context) @@ -70,7 +69,7 @@ def patch_detail(request, patch_id): if editable: form = PatchForm(instance=patch) - if is_authenticated(request.user): + if request.user.is_authenticated: createbundleform = CreateBundleForm() if request.method == 'POST': @@ -111,7 +110,7 @@ def patch_detail(request, patch_id): form.save() messages.success(request, 'Patch updated') - if is_authenticated(request.user): + if request.user.is_authenticated: context['bundles'] = request.user.bundles.all() context['submission'] = patch diff --git a/patchwork/views/project.py b/patchwork/views/project.py index 484455c0..a2e5b2da 100644 --- a/patchwork/views/project.py +++ b/patchwork/views/project.py @@ -22,8 +22,8 @@ from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render +from django.urls import reverse -from patchwork.compat import reverse from patchwork.models import Patch from patchwork.models import Project diff --git a/patchwork/views/user.py b/patchwork/views/user.py index 4a4958ab..8dcb407b 100644 --- a/patchwork/views/user.py +++ b/patchwork/views/user.py @@ -28,8 +28,8 @@ from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.shortcuts import render from django.template.loader import render_to_string +from django.urls import reverse -from patchwork.compat import reverse from patchwork.filters import DelegateFilter from patchwork.forms import EmailForm from patchwork.forms import RegistrationForm diff --git a/patchwork/views/xmlrpc.py b/patchwork/views/xmlrpc.py index 93f6035e..b02a65b6 100644 --- a/patchwork/views/xmlrpc.py +++ b/patchwork/views/xmlrpc.py @@ -35,11 +35,11 @@ from django.http import HttpResponse from django.http import HttpResponseRedirect from django.http import HttpResponseServerError from django.views.decorators.csrf import csrf_exempt +from django.urls import reverse from django.utils import six from django.utils.six.moves import xmlrpc_client from django.utils.six.moves.xmlrpc_server import SimpleXMLRPCDispatcher -from patchwork.compat import reverse from patchwork.models import Check from patchwork.models import Patch from patchwork.models import Person From patchwork Sun Jun 24 19:55:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933975 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNQb0qdmz9ry1 for ; Mon, 25 Jun 2018 05:58:15 +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="AifODIC9"; 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 41DNQZ6QSnzF14l for ; Mon, 25 Jun 2018 05:58:14 +1000 (AEST) 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="AifODIC9"; dkim-atps=neutral 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=23.83.214.30; helo=caracal.maple.relay.mailchannels.net; 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="AifODIC9"; dkim-atps=neutral Received: from caracal.maple.relay.mailchannels.net (caracal.maple.relay.mailchannels.net [23.83.214.30]) (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 41DNNJ1x34zF15H for ; Mon, 25 Jun 2018 05:56:15 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 55466281B3F for ; Sun, 24 Jun 2018 19:56:13 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.28.18]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id BD9FC281B31 for ; Sun, 24 Jun 2018 19:56:11 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.19.36.153]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Zesty-Tank: 4f847e69398a60dd_1529870171971_1013656076 X-MC-Loop-Signature: 1529870171971:3736124603 X-MC-Ingress-Time: 1529870171971 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=tYZNfotUcYPUVTTYEvyQP8J3u/OwFMsuk2XKYkR0U6U=; b=AifODIC9yo510SUPLvnuPLCbW6 2hPqm7DF7NlkQ2l9nHUgjtkY4gWbUvTV3W63F06YgYqHXbK56tncsmdH0WNncKXjCOHzfb3VRWfWO wMaNMpinwl8FQMaEOjzGbo5xy4IQr+FJwSm3e6IqQOy2LDE5MOwVkhxHdPtx4v2ZR1pXL2zXCVn7t CdK32xQS3ZeZ9nISeQWmZu2XTHxSSWi125urvCN0Izz5g8jRWanP9NtP5X5uhMhC3snx2KblJHybG JiYmPeSXTY0MjGuAtUtoV3UAw7b8sg++RaSt4mlv7VBfOxffWleQ1h1aEY7yfSbW4PpEtQTDcH5N6 cz9BbwKQ==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 06/11] Prepare for Django 2.0 Date: Sun, 24 Jun 2018 20:55:52 +0100 Message-Id: <20180624195557.19909-6-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Two changes necessary. - Remove 'SessionAuthenticationMiddleware' from settings https://docs.djangoproject.com/en/2.0/releases/2.0/#miscellaneous - Replace 'render_to_response' with 'render' https://docs.djangoproject.com/en/2.0/releases/2.0/#miscellaneous Both of these are supported by Django 1.11 so there's no need for compat wrappers. Signed-off-by: Stephen Finucane --- patchwork/settings/base.py | 1 - patchwork/views/cover.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py index 99eb3c06..acfb0164 100644 --- a/patchwork/settings/base.py +++ b/patchwork/settings/base.py @@ -32,7 +32,6 @@ MIDDLEWARE = [ 'django.contrib.admindocs.middleware.XViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', ] TIME_ZONE = 'Australia/Canberra' diff --git a/patchwork/views/cover.py b/patchwork/views/cover.py index f18a262f..aada6834 100644 --- a/patchwork/views/cover.py +++ b/patchwork/views/cover.py @@ -21,7 +21,7 @@ from django.http import Http404 from django.http import HttpResponse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 -from django.shortcuts import render_to_response +from django.shortcuts import render from django.urls import reverse from patchwork.models import CoverLetter @@ -45,7 +45,7 @@ def cover_detail(request, cover_id): 'project': cover.project, } - return render_to_response('patchwork/submission.html', context) + return render(request, 'patchwork/submission.html', context) def cover_mbox(request, cover_id): From patchwork Sun Jun 24 19:55:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933974 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNQB62RFz9ry1 for ; Mon, 25 Jun 2018 05:57:54 +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="D6gfq4PW"; 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 41DNQB4S2FzF15L for ; Mon, 25 Jun 2018 05:57:54 +1000 (AEST) 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="D6gfq4PW"; dkim-atps=neutral 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=23.83.209.62; helo=fossa.birch.relay.mailchannels.net; 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="D6gfq4PW"; dkim-atps=neutral Received: from fossa.birch.relay.mailchannels.net (fossa.birch.relay.mailchannels.net [23.83.209.62]) (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 41DNNJ0W1KzF153 for ; Mon, 25 Jun 2018 05:56:15 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 4862B412D8 for ; Sun, 24 Jun 2018 19:56:13 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.31.16]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 00BE241849 for ; Sun, 24 Jun 2018 19:56:11 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.19.51.240]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Inform-Versed: 65244cd81d919453_1529870172180_846933244 X-MC-Loop-Signature: 1529870172180:4096205795 X-MC-Ingress-Time: 1529870172180 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=e4uCUP7J2WxCitaFPmWkiEgVRg/uarnfaMByN3VCSps=; b=D6gfq4PWefwx9BKE+Ofn1+zX9Z cqn73PezPbfSb656nsOArCgurOKhir2ccdXH3sTXEsK2M+0vqAhdbmLlQijzxrhs00ENI8jxO8Ozf BUPBiTubZFPWfHM/J2+mXEefmuI3vzpoOB3CoI+piGxfz1TKTiFEEsv1Vkr8maFu96BTlgmDWmNsm RsRrZGNtQYSz5/ESZmOSMfeIsku1QNkFBRgqxD29oieFB4foyXyEE5aHrNRdpU+lwDTjNzgqh7QpC m2jE/33SHCv3mquuxUSrWH+4f+vm+A8yUfIk6nrw3mVif6IXBcy9W9j2vk7YuPA2+B4Xh1OVEseFo Cmqm/mXg==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 07/11] Add support for Django 2.0 Date: Sun, 24 Jun 2018 20:55:53 +0100 Message-Id: <20180624195557.19909-7-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Nothing too complicated here except for the addition of a new compat wrapper, which will be removed again shortly. According to the Django release notes, Django should function with Python 3.4. However, it was not possible to get this functioning due to the below error: Traceback (most recent call last): File ".../patchwork/manage.py", line 11, in ... File ".../django/db/models/fields/related.py", line 313, in contribute_to_class 'app_label': cls._meta.app_label.lower(), TypeError: unsupported operand type(s) for %: 'bytes' and 'dict' This does not appear to be an issue with Patchwork but the exact root cause has not been identified. As a result, only Python 3.5 and 3.6 are marked as supported for this Django version. As this is the first Python 3-only dependency we have, we need to start making use of the 'python_version' environment marker. Signed-off-by: Stephen Finucane --- releasenotes/notes/django-2-0-support-807980866ca16b77.yaml | 5 +++++ requirements-dev.txt | 3 ++- requirements-prod.txt | 3 ++- tox.ini | 5 ++++- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/django-2-0-support-807980866ca16b77.yaml diff --git a/releasenotes/notes/django-2-0-support-807980866ca16b77.yaml b/releasenotes/notes/django-2-0-support-807980866ca16b77.yaml new file mode 100644 index 00000000..5c206739 --- /dev/null +++ b/releasenotes/notes/django-2-0-support-807980866ca16b77.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + `Django 2.0 `_ is now + supported. diff --git a/requirements-dev.txt b/requirements-dev.txt index 8bad8f07..f4ad751a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ -Django>=1.11,<2.0 +Django>=1.11,<2.1; python_version >= '3.4' +Django>=1.11,<2.0; python_version < '3.0' djangorestframework>=3.4,<3.9 django-filter>=1.0,<1.2 -r requirements-test.txt diff --git a/requirements-prod.txt b/requirements-prod.txt index c30688cc..e7a75354 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1,4 +1,5 @@ -Django>=1.11,<2.0 +Django>=1.11,<2.1; python_version >= '3.4' +Django>=1.11,<2.0; python_version < '3.0' djangorestframework>=3.4,<3.9 django-filter>=1.0,<1.2 psycopg2>=2.7,<2.8 diff --git a/tox.ini b/tox.ini index 5f3d7e72..4eef4c44 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = pep8,docs,py{27,34,35,36}-django111 +envlist = pep8,docs,py{27,34}-django111,py{35,36}-django{111,20} skipsdist = True [testenv] @@ -9,6 +9,9 @@ deps = django111: django>=1.11,<2.0 django111: djangorestframework>=3.6,<3.9 django111: django-filter>=1.0,<1.2 + django20: django>=2.0,<2.1 + django20: djangorestframework>=3.7,<3.9 + django20: django-filter>=1.1,<1.2 setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev PYTHONDONTWRITEBYTECODE = 1 From patchwork Sun Jun 24 19:55:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933978 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNRh1rVHz9ry1 for ; Mon, 25 Jun 2018 05:59:12 +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="LrYX5EfD"; 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 41DNRh0NHCzF14g for ; Mon, 25 Jun 2018 05:59:12 +1000 (AEST) 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="LrYX5EfD"; dkim-atps=neutral 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=23.83.209.75; helo=gorilla.birch.relay.mailchannels.net; 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="LrYX5EfD"; dkim-atps=neutral Received: from gorilla.birch.relay.mailchannels.net (gorilla.birch.relay.mailchannels.net [23.83.209.75]) (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 41DNNK0sqtzF153 for ; Mon, 25 Jun 2018 05:56:16 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 4B2C1681AA5 for ; Sun, 24 Jun 2018 19:56:13 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.29.38]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 02B036816FF for ; Sun, 24 Jun 2018 19:56:11 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [23.92.70.115]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.3); Sun, 24 Jun 2018 19:56:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Continue-Illustrious: 30221700503708ef_1529870172183_1855512766 X-MC-Loop-Signature: 1529870172183:481851069 X-MC-Ingress-Time: 1529870172183 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=TVINvugOm1soU6iZI4MowjHsxBKHKDH7ZhNkAzuxgUk=; b=LrYX5EfDGbOb0AozK+xt5LTjc7 xjD8NMG3bOazj4iPCwm5vpItnLGiWBxh7f4MbQtfr9/8UU+/6bzu2HD4X8mO913K94UoEWX9O2YjK uT0kqv2OkPP+IqkimbFe4vZUoR1+m6ofRqGWd9VUAAItOGKM+cyGGzNpC3zdF888RmUhe6quQvMn8 Lm6EtddamFeI1nOtzFjM9YWCOFK14i8JLGmFWGK7H4muGiZQKR4j34hyI3/POr7xowmoTsnqSuG+q MfBzgW7f9sS/IXIC0yw3RVw64c+WSIIfcyri6VWzxmPjEAGuQBbaGdNkGEozhI8hJQ04Y2pUljiDy Lzqv4Tcg==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 08/11] requirements: Start using fixed versions Date: Sun, 24 Jun 2018 20:55:54 +0100 Message-Id: <20180624195557.19909-8-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Given that 'tox' doesn't actually read any of these, there's no reason to use ranges of requirements. Instead, use the latest and greatest for live instances and rely on tox to validate behavior with older versions. Signed-off-by: Stephen Finucane --- requirements-dev.txt | 5 +---- requirements-prod.txt | 10 +++++----- requirements-test.txt | 6 ++---- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f4ad751a..47465a3e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,2 @@ -Django>=1.11,<2.1; python_version >= '3.4' -Django>=1.11,<2.0; python_version < '3.0' -djangorestframework>=3.4,<3.9 -django-filter>=1.0,<1.2 +-r requirements-prod.txt -r requirements-test.txt diff --git a/requirements-prod.txt b/requirements-prod.txt index e7a75354..1e075629 100644 --- a/requirements-prod.txt +++ b/requirements-prod.txt @@ -1,6 +1,6 @@ -Django>=1.11,<2.1; python_version >= '3.4' -Django>=1.11,<2.0; python_version < '3.0' -djangorestframework>=3.4,<3.9 -django-filter>=1.0,<1.2 -psycopg2>=2.7,<2.8 +Django==2.0.6; python_version >= '3.4' +Django==1.11.13; python_version < '3.0' +djangorestframework==3.8.2 +django-filter==1.1.0 +psycopg2-binary==2.7.5 sqlparse==0.2.4 diff --git a/requirements-test.txt b/requirements-test.txt index 94dc3db7..759db77b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,3 @@ -mysqlclient>=1.3,<1.4 -psycopg2-binary>=2.7,<2.8 +mysqlclient==1.3.12 django-debug-toolbar==1.9.1 -python-dateutil>2.0,<3.0 -selenium>=3.0,<4.0 +python-dateutil==2.7.3 From patchwork Sun Jun 24 19:55:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933976 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNQx6W6bz9ry1 for ; Mon, 25 Jun 2018 05:58:33 +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="Hw6EZ1UB"; 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 41DNQx4yQXzF15H for ; Mon, 25 Jun 2018 05:58:33 +1000 (AEST) 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="Hw6EZ1UB"; dkim-atps=neutral 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=23.83.214.30; helo=caracal.maple.relay.mailchannels.net; 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="Hw6EZ1UB"; dkim-atps=neutral Received: from caracal.maple.relay.mailchannels.net (caracal.maple.relay.mailchannels.net [23.83.214.30]) (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 41DNNJ4ZXVzF164 for ; Mon, 25 Jun 2018 05:56:16 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B0510681B20 for ; Sun, 24 Jun 2018 19:56:13 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.29.38]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 668DC6819BC for ; Sun, 24 Jun 2018 19:56:13 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [23.92.70.115]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.3); Sun, 24 Jun 2018 19:56:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Occur-Hysterical: 1d74b6b77e140ef1_1529870173589_84837690 X-MC-Loop-Signature: 1529870173589:1713249589 X-MC-Ingress-Time: 1529870173589 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=bsUWO0CXKpYWwas9huuCgnqcw5ZUpJuRnMiAnN34iDY=; b=Hw6EZ1UBqdHwfiYwb0Hcc07CcI LzGo95is9QOL854YSWq54mkNALsFgJfI75T5AzXGxLP+Pbm2KUK0hF9gGFCcyPCT/MdkfhQaYn9tm 5RCTRYi/uNVKQsy/W6fzvtSrCj4QxK9y62p0c9vBz0q50GIZvnAfnDkh3LMxy/z/k8yTzfo67Xo8+ hljssvrblcM3Ay8G6RzJ6frKbtrDa62khBrk/1m97Qw1iO7eqY0J7HQB6cSClfgFK3B23u6N8GPQZ DK6FowRKgxLszSMuYh7e7GvhWWC/PxVnDbWbmVcfeTcXe9wry+5NJ6JVzA5gTBMbWpSQ8QBKCT18y /qNGl3rA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 09/11] Resolve Python 3.6 warnings Date: Sun, 24 Jun 2018 20:55:55 +0100 Message-Id: <20180624195557.19909-9-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" DeprecationWarning: invalid escape sequence \d Signed-off-by: Stephen Finucane Reviewed-by: Daniel Axtens --- patchwork/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchwork/parser.py b/patchwork/parser.py index a40f9314..2a31c140 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -486,7 +486,7 @@ def parse_version(subject, subject_prefixes): Returns: version if found, else 1 """ - regex = re.compile('^[vV](\d+)$') + regex = re.compile(r'^[vV](\d+)$') m = _find_matching_prefix(subject_prefixes, regex) if m: return int(m.group(1)) From patchwork Sun Jun 24 19:55:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933977 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNRK47Tzz9ry1 for ; Mon, 25 Jun 2018 05:58:53 +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="NGCR1UgG"; 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 41DNRK2cBxzF14g for ; Mon, 25 Jun 2018 05:58:53 +1000 (AEST) 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="NGCR1UgG"; dkim-atps=neutral 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=23.83.214.39; helo=coral.maple.relay.mailchannels.net; 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="NGCR1UgG"; dkim-atps=neutral Received: from coral.maple.relay.mailchannels.net (coral.maple.relay.mailchannels.net [23.83.214.39]) (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 41DNNJ6mMGzF16W for ; Mon, 25 Jun 2018 05:56:16 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1286D12235B for ; Sun, 24 Jun 2018 19:56:14 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.18.110]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 8F8421222AF for ; Sun, 24 Jun 2018 19:56:13 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.58.245]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:14 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Hysterical-Oafish: 7715b92a04a22f1d_1529870173781_2060119369 X-MC-Loop-Signature: 1529870173781:1986730986 X-MC-Ingress-Time: 1529870173781 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=TQRqB5+VBayitqmdBCzxq8vEpQdZTuG/XTjTIuLhfmo=; b=NGCR1UgG4wtWYcib8o1du+NdVb QG4orPJ8CZj18Xuddt1QRJ0AxGYdGFM6HDAcby/+UsEypY895/W+VVHAtu4sE3wKF5air8t77ImeC t+K12dqkJaDmpwICeLcIyU1CtWCjmAIhLX8k8pehZ+oWo+gGqrlD1cANP/EJlK50cQ/ED3/WzQSPZ Zsjghzr32fsx0Nzs5/94vyFrdddGvQN3LQ2XXBXp5PJOYWB+TrH3R7HtQKQlz2lw1TeNbxaXv8ipO /ptMaeRBvOYkzabuPxzRpeKCwLqdHg8hsviMl2rogN9WCvVXH1lvoQmrUdEQEgp/v9wUbeMms6bpa Rk+TMWMw==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 10/11] tox: Rework warning infrastructure Date: Sun, 24 Jun 2018 20:55:56 +0100 Message-Id: <20180624195557.19909-10-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Python 3.5 and 3.5 introduce raise some warnings for libraries included in stdlib. Silence these to keep the output clean. Signed-off-by: Stephen Finucane --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4eef4c44..a190fa6f 100644 --- a/tox.ini +++ b/tox.ini @@ -16,12 +16,14 @@ setenv = DJANGO_SETTINGS_MODULE = patchwork.settings.dev PYTHONDONTWRITEBYTECODE = 1 DJANGO_LIVE_TEST_SERVER_ADDRESS = localhost:9000-9200 + py27: PYTHONWARNINGS = once,ignore::DeprecationWarning:distutils,ignore::PendingDeprecationWarning:distutils,ignore::ImportWarning:backports + py{34,35,36}:PYTHONWARNINGS = once,ignore::ResourceWarning:unittest.suite,ignore::DeprecationWarning:distutils,ignore::PendingDeprecationWarning:distutils,ignore::ImportWarning:backports passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY PW_TEST_DB_TYPE PW_TEST_DB_USER PW_TEST_DB_PASS PW_TEST_DB_HOST PW_TEST_DB_PORT commands = - python -Wonce {toxinidir}/manage.py test --noinput '{posargs:patchwork}' + python {toxinidir}/manage.py test --noinput '{posargs:patchwork}' [testenv:bashate] deps = bashate>=0.5,<0.6 From patchwork Sun Jun 24 19:55:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 933979 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41DNS83vGZz9ry1 for ; Mon, 25 Jun 2018 05:59:36 +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="WdoITtc2"; 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 41DNS82LZZzF1Cr for ; Mon, 25 Jun 2018 05:59:36 +1000 (AEST) 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="WdoITtc2"; dkim-atps=neutral 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=23.83.214.19; helo=black.maple.relay.mailchannels.net; 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="WdoITtc2"; dkim-atps=neutral Received: from black.maple.relay.mailchannels.net (black.maple.relay.mailchannels.net [23.83.214.19]) (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 41DNNL3h7gzF189 for ; Mon, 25 Jun 2018 05:56:18 +1000 (AEST) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B4EA85C16D1; Sun, 24 Jun 2018 19:56:15 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.16.125]) (Authenticated sender: 5xi41l16bi) by relay.mailchannels.net (Postfix) with ESMTPA id 2B4A35C1736; Sun, 24 Jun 2018 19:56:15 +0000 (UTC) X-Sender-Id: 5xi41l16bi|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.18.54.155]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.15.2); Sun, 24 Jun 2018 19:56:15 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: 5xi41l16bi|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: 5xi41l16bi X-Trail-Coil: 27e0a89363a47fed_1529870175506_2661087604 X-MC-Loop-Signature: 1529870175506:1596056846 X-MC-Ingress-Time: 1529870175505 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=s22A1yoUD9WtFnq5Jnuc6IFGPN6/tkv3FTPsJlfU9vI=; b=WdoITtc2WY0nHFnpU6Dno5x8yN /AQu2U8VO0S2ibqk96EkZOKOY0CKjtHTQRd7W+9crd+sxJMuwLa/gMUcX+6hteB7hcVxixN8RV9xZ VxGNfpcNNPjPg6bp683OZX4RAsXBQEPgcexm6HgwCdiME/uWvRefJHnbDHljE4YBgrQumvkIolCAh KSQpEGWC3S00DHxfjyML9WpsOv4U/Iib4VNDRX6644dgbra3cYrFFCKLwOsGlaOgDIXgfkUvq9Rnl VSHy75aispLR7N9gE3swsbd4yPTBm7xe2HbK0YSmpjxNktQkt5/2T3HTntLqy7ieTYmCL8LOSDuBe H7XkjFNA==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 11/11] docker: Don't require rebuilding if unnecessary Date: Sun, 24 Jun 2018 20:55:57 +0100 Message-Id: <20180624195557.19909-11-stephen@that.guru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180624195557.19909-1-stephen@that.guru> References: <20180624195557.19909-1-stephen@that.guru> X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Now that we're pinning versions, we're going to see more frequent dependency version changes. Requiring a rebuild after every one of these is tiresome so don't force it and instead display a helpful message merely suggesting that a rebuild may be necessary. Signed-off-by: Stephen Finucane Cc: Daniel Axtens Acked-by: Daniel Axtens --- This is a modified version of an earlier patch I submitted to the list. The original was rejected as there were concerns that it would lead to some confusion. However, I think the warning it prints is explicit enough that someone can make their own mind up about this. --- tools/docker/entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/docker/entrypoint.sh b/tools/docker/entrypoint.sh index 997b8763..afa85333 100755 --- a/tools/docker/entrypoint.sh +++ b/tools/docker/entrypoint.sh @@ -69,9 +69,10 @@ fi for x in /tmp/requirements-*.txt; do if ! cmp $x ~/patchwork/$(basename $x); then echo "A requirements file has changed." - echo "Please rebuild the patchwork image:" + echo "You may need to rebuild the patchwork image:" echo " docker-compose build web" - exit 1 + echo "" + diff -u $x ~/patchwork/$(basename $x) fi done