From 20d89a16ff885ec83d9253f40336bf0f0f87e872 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Wed, 23 Feb 2022 20:00:43 -0500 Subject: [PATCH 01/11] update base image to Python 3.10 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a0d685a9..2859e991 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.6 +FROM python:3.10 ENV PYTHONUNBUFFERED 1 RUN mkdir /code From 837f705b829060929129c0527fd98b2f7234db94 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Wed, 23 Feb 2022 20:03:03 -0500 Subject: [PATCH 02/11] update pre-commit versions and urls --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 648d0208..a6d52b07 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,20 @@ repos: - repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v1.5 + rev: v1.6.0 hooks: - id: autopep8 args: - --in-place - --aggressive -- repo: https://gitlab.com/pycqa/flake8 - rev: 3.7.9 +- repo: https://github.com/pycqa/flake8 + rev: 4.0.1 hooks: - id: flake8 -- repo: git://github.com/doublify/pre-commit-isort - rev: v4.3.0 +- repo: https://github.com/pycqa/isort + rev: 5.10.1 hooks: - id: isort - repo: https://github.com/jazzband/pip-tools - rev: 6.2.0 + rev: 6.5.1 hooks: - id: pip-compile From 55a1f5a31b9121045166ee132caa7f201b55fa2b Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Wed, 23 Feb 2022 20:03:52 -0500 Subject: [PATCH 03/11] update travis dist and python version --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 62d1d9b7..d881c642 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ +dist: bionic language: python +python: "3.10" cache: directories: - $HOME/.cache/pip From 1ba0ab0ba997587b8c9b0876d3b6d0f411ada500 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Wed, 23 Feb 2022 20:06:02 -0500 Subject: [PATCH 04/11] update requirements --- requirements.in | 22 +++++++++++----------- requirements.txt | 38 +++++++++++++------------------------- 2 files changed, 24 insertions(+), 36 deletions(-) diff --git a/requirements.in b/requirements.in index c72012e9..8b8bcf15 100644 --- a/requirements.in +++ b/requirements.in @@ -1,14 +1,14 @@ -Django==3.2.11 -django-cors-headers==3.10.0 -django-elasticsearch-dsl==7.2.1 -django-elasticsearch-dsl-drf==0.22.2 -djangorestframework==3.12.4 -elasticsearch==7.15.2 +Django==4.0.2 +django-cors-headers==3.11.0 +django-elasticsearch-dsl==7.2.2 +django-elasticsearch-dsl-drf==0.22.4 +djangorestframework==3.13.1 +elasticsearch==7.17.0 elasticsearch-dsl==7.4.0 -jsonschema==3.2.0 -psycopg2-binary==2.9.1 +jsonschema==4.4.0 +psycopg2-binary==2.9.3 PyYAML==6.0 -rac-schemas==0.29 -rac_es==0.17.3 -shortuuid==1.0.1 +rac-schemas==0.30 +rac_es==0.18 +shortuuid==1.0.8 uritemplate==4.1.1 diff --git a/requirements.txt b/requirements.txt index cdbe1a0c..ac5d99fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with python 3.6 +# This file is autogenerated by pip-compile with python 3.10 # To update, run: # # pip-compile @@ -10,27 +10,27 @@ attrs==21.2.0 # via jsonschema certifi==2021.10.8 # via elasticsearch -django==3.2.11 +django==4.0.2 # via # -r requirements.in # django-cors-headers # django-nine # djangorestframework -django-cors-headers==3.10.0 +django-cors-headers==3.11.0 # via -r requirements.in -django-elasticsearch-dsl==7.2.1 +django-elasticsearch-dsl==7.2.2 # via # -r requirements.in # django-elasticsearch-dsl-drf -django-elasticsearch-dsl-drf==0.22.2 +django-elasticsearch-dsl-drf==0.22.4 # via -r requirements.in django-nine==0.2.5 # via django-elasticsearch-dsl-drf -djangorestframework==3.12.4 +djangorestframework==3.13.1 # via # -r requirements.in # django-elasticsearch-dsl-drf -elasticsearch==7.15.2 +elasticsearch==7.17.0 # via # -r requirements.in # django-elasticsearch-dsl-drf @@ -42,47 +42,35 @@ elasticsearch-dsl==7.4.0 # django-elasticsearch-dsl # django-elasticsearch-dsl-drf # rac-es -importlib-metadata==4.8.2 - # via jsonschema -jsonschema==3.2.0 +jsonschema==4.4.0 # via # -r requirements.in # rac-schemas -psycopg2-binary==2.9.1 +psycopg2-binary==2.9.3 # via -r requirements.in pyrsistent==0.18.0 # via jsonschema python-dateutil==2.8.2 # via elasticsearch-dsl pytz==2021.3 - # via django + # via djangorestframework pyyaml==6.0 # via -r requirements.in -rac_es==0.17.3 +rac-es==0.18 # via -r requirements.in -rac-schemas==0.29 +rac-schemas==0.30 # via -r requirements.in -shortuuid==1.0.1 +shortuuid==1.0.8 # via -r requirements.in six==1.16.0 # via # django-elasticsearch-dsl # django-elasticsearch-dsl-drf # elasticsearch-dsl - # jsonschema # python-dateutil sqlparse==0.4.2 # via django -typing-extensions==4.0.1 - # via - # asgiref - # importlib-metadata uritemplate==4.1.1 # via -r requirements.in urllib3==1.26.7 # via elasticsearch -zipp==3.6.0 - # via importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# setuptools From 1eb8a8dd25b186a9153bffdd2c60aeadae778d93 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Wed, 23 Feb 2022 20:07:15 -0500 Subject: [PATCH 05/11] update import in urlconfig --- api_formatter/urls.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api_formatter/urls.py b/api_formatter/urls.py index 123c1f35..968fab53 100644 --- a/api_formatter/urls.py +++ b/api_formatter/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import include, url +from django.urls import include, re_path from rest_framework.schemas import get_schema_view from .routers import RACRouter @@ -20,7 +20,7 @@ ) urlpatterns = [ - url(r'^', include(router.urls)), - url(r'facets', FacetView.as_view({'get': 'retrieve'}), name='facets'), - url(r'^schema', schema_view, name='schema'), + re_path(r'^', include(router.urls)), + re_path(r'facets', FacetView.as_view({'get': 'retrieve'}), name='facets'), + re_path(r'^schema', schema_view, name='schema'), ] From c7aae614f2581212f85d511d80461ebec88dd151 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Wed, 23 Feb 2022 20:07:34 -0500 Subject: [PATCH 06/11] linting --- api_formatter/tests.py | 3 ++- api_formatter/view_helpers.py | 12 ++++++------ api_formatter/views.py | 3 ++- argo/urls.py | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/api_formatter/tests.py b/api_formatter/tests.py index 1e02e5f4..f3e5ce3a 100644 --- a/api_formatter/tests.py +++ b/api_formatter/tests.py @@ -3,7 +3,6 @@ import os import random -from argo import settings from django.test import TestCase from django.urls import reverse from elasticsearch.helpers import streaming_bulk @@ -13,6 +12,8 @@ from rac_schemas import is_valid from rest_framework.test import APIRequestFactory +from argo import settings + from .view_helpers import date_string from .views import (AgentViewSet, CollectionViewSet, MyListView, ObjectViewSet, SearchView, TermViewSet) diff --git a/api_formatter/view_helpers.py b/api_formatter/view_helpers.py index 3be7e0e3..fd880d96 100644 --- a/api_formatter/view_helpers.py +++ b/api_formatter/view_helpers.py @@ -1,4 +1,3 @@ -from argo import settings from django.http import Http404 from django_elasticsearch_dsl_drf.constants import (LOOKUP_FILTER_PREFIX, LOOKUP_FILTER_RANGE, @@ -10,15 +9,16 @@ LOOKUP_QUERY_IN, LOOKUP_QUERY_LT, LOOKUP_QUERY_LTE) -from django_elasticsearch_dsl_drf.filter_backends import (DefaultOrderingFilterBackend, - FilteringFilterBackend, - NestedFilteringFilterBackend, - OrderingFilterBackend, - SuggesterFilterBackend) +from django_elasticsearch_dsl_drf.filter_backends import ( + DefaultOrderingFilterBackend, FilteringFilterBackend, + NestedFilteringFilterBackend, OrderingFilterBackend, + SuggesterFilterBackend) from django_elasticsearch_dsl_drf.pagination import LimitOffsetPagination from elasticsearch_dsl import Index, Search, connections from rest_framework.viewsets import ReadOnlyModelViewSet +from argo import settings + STRING_LOOKUPS = [ LOOKUP_FILTER_TERMS, LOOKUP_FILTER_PREFIX, diff --git a/api_formatter/views.py b/api_formatter/views.py index 31cb40f0..ff513268 100644 --- a/api_formatter/views.py +++ b/api_formatter/views.py @@ -1,4 +1,3 @@ -from argo import settings from django.http import Http404 from django_elasticsearch_dsl_drf.constants import SUGGESTER_TERM from django_elasticsearch_dsl_drf.pagination import LimitOffsetPagination @@ -11,6 +10,8 @@ from rest_framework.views import APIView from rest_framework.viewsets import ReadOnlyModelViewSet +from argo import settings + from .pagination import CollapseLimitOffsetPagination from .serializers import (AgentListSerializer, AgentSerializer, AncestorsSerializer, CollectionHitSerializer, diff --git a/argo/urls.py b/argo/urls.py index d6a2fa32..fedbd49c 100644 --- a/argo/urls.py +++ b/argo/urls.py @@ -13,10 +13,11 @@ 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ -from api_formatter.views import MyListView from django.contrib import admin from django.urls import include, path +from api_formatter.views import MyListView + urlpatterns = [ path('admin/', admin.site.urls), path('mylist', MyListView.as_view(), name='mylist'), From c1950ca3eb17e51d549cbc427699f977caf7e1bd Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 3 Mar 2022 17:19:54 -0500 Subject: [PATCH 07/11] add link to docs --- api_formatter/templates/rest_framework/api.html | 1 + 1 file changed, 1 insertion(+) diff --git a/api_formatter/templates/rest_framework/api.html b/api_formatter/templates/rest_framework/api.html index af49e22e..83013ea9 100644 --- a/api_formatter/templates/rest_framework/api.html +++ b/api_formatter/templates/rest_framework/api.html @@ -22,6 +22,7 @@ + From 834137c934ba88a6a45a992e777305fb56b18070 Mon Sep 17 00:00:00 2001 From: Hannah Date: Thu, 3 Mar 2022 18:15:56 -0500 Subject: [PATCH 08/11] improve color contrast --- api_formatter/static/css/styles.css | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/api_formatter/static/css/styles.css b/api_formatter/static/css/styles.css index 72fbb040..e21ae750 100644 --- a/api_formatter/static/css/styles.css +++ b/api_formatter/static/css/styles.css @@ -7,3 +7,35 @@ html { background-color: #f7f7f9; border: 1px solid #e1e1e8; } + +/* improve color contrast */ +a { + color: #0069d9; +} + +.breadcrumb-item.active { + color: #616A70; +} + +.page-link { + color: #0069d9; +} + +.btn-primary, .page-item.active { + background-color: #0069d9; + border-color: #0069d9; +} + +.btn-primary:hover, .btn-outline-primary:hover { + background-color: #004FA3; + border-color: #004FA3; +} + +.btn-outline-primary { + border-color: #0069d9; + color: #0069d9; +} + +.nav-link:hover, .page-link:hover { + text-decoration: underline; +} \ No newline at end of file From 1def9df0cc48550d19770ba1f01ae589c267ed36 Mon Sep 17 00:00:00 2001 From: Hannah Date: Fri, 4 Mar 2022 12:02:10 -0500 Subject: [PATCH 09/11] make nav responsive --- .../templates/rest_framework/api.html | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/api_formatter/templates/rest_framework/api.html b/api_formatter/templates/rest_framework/api.html index 83013ea9..6c384f75 100644 --- a/api_formatter/templates/rest_framework/api.html +++ b/api_formatter/templates/rest_framework/api.html @@ -12,20 +12,26 @@ {% block title %}{% if name %}{{ name }} – {% endif %}RAC API{% endblock %} {% block navbar %} - +
+ +
{% endblock %} {% block breadcrumbs %} From c3e6d6d76744377e3c4ae22896f5f7dabf4b18aa Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Fri, 4 Mar 2022 14:30:58 -0500 Subject: [PATCH 10/11] update dependencies --- requirements.in | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.in b/requirements.in index 8b8bcf15..364381e5 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,4 @@ -Django==4.0.2 +Django==4.0.3 django-cors-headers==3.11.0 django-elasticsearch-dsl==7.2.2 django-elasticsearch-dsl-drf==0.22.4 diff --git a/requirements.txt b/requirements.txt index ac5d99fb..de8a2552 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,7 +10,7 @@ attrs==21.2.0 # via jsonschema certifi==2021.10.8 # via elasticsearch -django==4.0.2 +django==4.0.3 # via # -r requirements.in # django-cors-headers From 3f2304024a31e40fc05eefca8f507fb516caf4cc Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Mon, 13 Jun 2022 15:36:16 -0400 Subject: [PATCH 11/11] update dependencies --- requirements.in | 6 +++--- requirements.txt | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/requirements.in b/requirements.in index 364381e5..a6152a38 100644 --- a/requirements.in +++ b/requirements.in @@ -1,5 +1,5 @@ -Django==4.0.3 -django-cors-headers==3.11.0 +Django==4.0.5 +django-cors-headers==3.12.0 django-elasticsearch-dsl==7.2.2 django-elasticsearch-dsl-drf==0.22.4 djangorestframework==3.13.1 @@ -10,5 +10,5 @@ psycopg2-binary==2.9.3 PyYAML==6.0 rac-schemas==0.30 rac_es==0.18 -shortuuid==1.0.8 +shortuuid==1.0.9 uritemplate==4.1.1 diff --git a/requirements.txt b/requirements.txt index de8a2552..cc7a856e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,19 +4,19 @@ # # pip-compile # -asgiref==3.4.1 +asgiref==3.5.2 # via django -attrs==21.2.0 +attrs==21.4.0 # via jsonschema -certifi==2021.10.8 +certifi==2022.5.18.1 # via elasticsearch -django==4.0.3 +django==4.0.5 # via # -r requirements.in # django-cors-headers # django-nine # djangorestframework -django-cors-headers==3.11.0 +django-cors-headers==3.12.0 # via -r requirements.in django-elasticsearch-dsl==7.2.2 # via @@ -48,11 +48,11 @@ jsonschema==4.4.0 # rac-schemas psycopg2-binary==2.9.3 # via -r requirements.in -pyrsistent==0.18.0 +pyrsistent==0.18.1 # via jsonschema python-dateutil==2.8.2 # via elasticsearch-dsl -pytz==2021.3 +pytz==2022.1 # via djangorestframework pyyaml==6.0 # via -r requirements.in @@ -60,7 +60,7 @@ rac-es==0.18 # via -r requirements.in rac-schemas==0.30 # via -r requirements.in -shortuuid==1.0.8 +shortuuid==1.0.9 # via -r requirements.in six==1.16.0 # via @@ -72,5 +72,5 @@ sqlparse==0.4.2 # via django uritemplate==4.1.1 # via -r requirements.in -urllib3==1.26.7 +urllib3==1.26.9 # via elasticsearch