From db0b347abdaa16281b3bc685a0edfdb5a21223ea Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 23 Mar 2020 18:13:21 -0500 Subject: [PATCH 01/14] Add dependency on trove-classifiers=1.0.0 --- requirements/main.in | 1 + requirements/main.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/requirements/main.in b/requirements/main.in index f39a8dd9b5cb..5909c1630099 100644 --- a/requirements/main.in +++ b/requirements/main.in @@ -53,6 +53,7 @@ sqlalchemy-citext stdlib-list structlog transaction +trove-classifiers typeguard webauthn whitenoise diff --git a/requirements/main.txt b/requirements/main.txt index f33964e53f2d..4497017698b9 100644 --- a/requirements/main.txt +++ b/requirements/main.txt @@ -569,6 +569,9 @@ transaction==3.0.0 \ translationstring==1.3 \ --hash=sha256:4ee44cfa58c52ade8910ea0ebc3d2d84bdcad9fa0422405b1801ec9b9a65b72d \ --hash=sha256:e26c7bf383413234ed442e0980a2ebe192b95e3745288a8fd2805156d27515b4 +trove-classifiers==1.0.0 \ + --hash=sha256:22a935078ca8e81ad19cfdb16c70ed6a0138799ff19ff889ed8f93f62d507716 \ + --hash=sha256:930e50d6eb0766a56780d3c991e4b4ace95f47b060c68c9b78dea034f84ffc4d typeguard==2.7.1 \ --hash=sha256:1d3710251d3d3d6c64e0c49f45edec2e88ddc386a51e89c3ec0703efeb8b3b81 \ --hash=sha256:2d545c71e9439c21bcd7c28f5f55b3606e6106f7031ab58375656a1aed483ef2 From b980db9a9b8f1a78f720f232115c386b4a30c4ac Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 23 Mar 2020 18:14:44 -0500 Subject: [PATCH 02/14] Remove a random comment --- warehouse/views.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/warehouse/views.py b/warehouse/views.py index ceca604f6e9f..90664984f7b5 100644 --- a/warehouse/views.py +++ b/warehouse/views.py @@ -54,8 +54,6 @@ from warehouse.utils.paginate import ElasticsearchPage, paginate_url_factory from warehouse.utils.row_counter import RowCount -# 403, 404, 410, 500, - @view_config(context=HTTPException) @notfound_view_config(append_slash=HTTPMovedPermanently) From 48dd4bd84e3836372a567d91b915c5dec58965d3 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 23 Mar 2020 18:16:16 -0500 Subject: [PATCH 03/14] Update list classifiers HTML view --- tests/unit/test_views.py | 10 +++------- warehouse/templates/pages/classifiers.html | 4 ++-- warehouse/views.py | 12 +++--------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/tests/unit/test_views.py b/tests/unit/test_views.py index f03729e88eaf..ff0a9af04e1e 100644 --- a/tests/unit/test_views.py +++ b/tests/unit/test_views.py @@ -22,11 +22,11 @@ HTTPSeeOther, HTTPServiceUnavailable, ) +from trove_classifiers import classifiers from webob.multidict import MultiDict from warehouse import views from warehouse.views import ( - classifiers, current_user_indicator, flash_messages, forbidden, @@ -35,6 +35,7 @@ health, httpexception_view, index, + list_classifiers, locale, opensearchxml, robotstxt, @@ -424,12 +425,7 @@ def raiser(*args, **kwargs): def test_classifiers(db_request): - classifier_a = ClassifierFactory(classifier="I am first") - classifier_b = ClassifierFactory(classifier="I am last") - - assert classifiers(db_request) == { - "classifiers": [(classifier_a.classifier,), (classifier_b.classifier,)] - } + assert list_classifiers(db_request) == {"classifiers": sorted(classifiers)} def test_stats(db_request): diff --git a/warehouse/templates/pages/classifiers.html b/warehouse/templates/pages/classifiers.html index f762a1c5699f..07b37fda92c1 100644 --- a/warehouse/templates/pages/classifiers.html +++ b/warehouse/templates/pages/classifiers.html @@ -32,9 +32,9 @@

{% trans %}List of classifiers{% endtrans %}