Skip to content

Commit

Permalink
🤖 Update dependencies (#102)
Browse files Browse the repository at this point in the history
* 🤖 Update dependencies

* Fixes lockfile versions

* Adds documentation link

* Fixes new ruff errors: UP006, UP035

---------

Co-authored-by: afred <afred@users.noreply.github.com>
Co-authored-by: Harpo Harbert <ryan_harbert@wgbh.org>
  • Loading branch information
3 people authored Nov 14, 2023
1 parent 5f1a25c commit 5fee679
Show file tree
Hide file tree
Showing 14 changed files with 181 additions and 92 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# ov-wag

![CI](https://github.com/WGBH-MLA/ov-wag/actions/workflows/CI.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/WGBH-MLA/ov-wag/badge.svg)](https://coveralls.io/github/WGBH-MLA/ov-wag)

# Open Vault: Wagtail
#### From GBH
Wagtail CMS for [Open Vault](https://openvault.wgbh.org/)

## Documentation

### [User Documentation](https://wgbh-mla.github.io/ov-wag/)

## Usage
### Install
The published version can be installed using pip:
Expand Down
10 changes: 5 additions & 5 deletions authors/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from django.db import models
from modelcluster.fields import ParentalKey
Expand All @@ -21,7 +21,7 @@ class AuthorsOrderable(Orderable):
on_delete=models.CASCADE,
)

panels: ClassVar[List[FieldPanel]] = [FieldPanel('author')]
panels: ClassVar[list[FieldPanel]] = [FieldPanel('author')]

@property
def name(self):
Expand All @@ -31,7 +31,7 @@ def name(self):
def image(self):
return self.author.image

api_fields: ClassVar[List[APIField]] = [
api_fields: ClassVar[list[APIField]] = [
APIField('author_id'),
APIField('name'),
APIField('image', serializer=ImageRenditionField('fill-100x100')),
Expand All @@ -53,11 +53,11 @@ class Author(models.Model):

bio = RichTextField(blank=True, help_text='Brief author bio')

panels: ClassVar[List[FieldPanel]] = [
panels: ClassVar[list[FieldPanel]] = [
MultiFieldPanel([FieldPanel('name'), FieldPanel('image'), FieldPanel('bio')])
]

api_fields: ClassVar[List[APIField]] = [
api_fields: ClassVar[list[APIField]] = [
APIField('id'),
APIField('name'),
APIField('image'),
Expand Down
4 changes: 2 additions & 2 deletions authors/serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from rest_framework.serializers import ModelSerializer, PrimaryKeyRelatedField
from wagtail.images.api.fields import ImageRenditionField
Expand All @@ -12,7 +12,7 @@ class AuthorSerializer(ModelSerializer):

class Meta:
model = Author
fields: ClassVar[List[str]] = [
fields: ClassVar[list[str]] = [
'author_id',
'name',
'image',
Expand Down
4 changes: 2 additions & 2 deletions authors/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from wagtail.api.v2.views import BaseAPIViewSet

Expand All @@ -7,7 +7,7 @@

class AuthorsAPIViewSet(BaseAPIViewSet):
model = Author
listing_default_fields: ClassVar[List[str]] = [
listing_default_fields: ClassVar[list[str]] = [
'id',
'detail_url',
'name',
Expand Down
12 changes: 6 additions & 6 deletions cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import List, Optional
from typing import Optional

from loguru import logger as log
from trogon import Trogon
from typer import Argument, Context, Option, Typer
from typer.main import get_group
from typing_extensions import Annotated
from typing import Annotated

from .utils import AliasGroup, run, version_callback

Expand All @@ -19,7 +19,7 @@
@app.command('d | dev')
def dev(
args: Annotated[
Optional[List[str]],
Optional[list[str]],
Option(help='Additional arguments to pass to the build step'),
] = None
):
Expand All @@ -32,7 +32,7 @@ def dev(
@app.command('b | build')
def build(
args: Annotated[
Optional[List[str]],
Optional[list[str]],
Option(help='Additional arguments to pass to the build step'),
] = None,
):
Expand All @@ -47,14 +47,14 @@ def shell():


@app.command('m | manage')
def manage(cmd: Annotated[List[str], Argument(help='The manage.py command to run')]):
def manage(cmd: Annotated[list[str], Argument(help='The manage.py command to run')]):
"""Run a manage.py function"""
run(f'{COMPOSE} {DEV} {MANAGE} {" ".join(cmd)}')


@app.command('c | cmd')
def cmd(
cmd: Annotated[List[str], Argument(help='The command to run')],
cmd: Annotated[list[str], Argument(help='The command to run')],
entrypoint: Annotated[
str, Option('--entrypoint', '-e', help='The entrypoint to use')
] = '"bash -c"',
Expand Down
12 changes: 6 additions & 6 deletions exhibits/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from django.db import models
from modelcluster.fields import ParentalKey
Expand All @@ -23,7 +23,7 @@ class ExhibitsOrderable(Orderable):
on_delete=models.CASCADE,
)

panels: ClassVar[List[FieldPanel]] = [FieldPanel('exhibit')]
panels: ClassVar[list[FieldPanel]] = [FieldPanel('exhibit')]

@property
def title(self):
Expand All @@ -37,7 +37,7 @@ def cover_image(self):
def authors(self):
return self.exhibit.authors

api_fields: ClassVar[List[APIField]] = [
api_fields: ClassVar[list[APIField]] = [
APIField('exhibit_id'),
APIField('title'),
APIField(
Expand Down Expand Up @@ -83,12 +83,12 @@ class ExhibitPage(Page):
related_name='+',
)

search_fields: ClassVar[List[index.SearchField]] = [
search_fields: ClassVar[list[index.SearchField]] = [
*Page.search_fields,
index.SearchField('body'),
]

content_panels: ClassVar[List[FieldPanel]] = [
content_panels: ClassVar[list[FieldPanel]] = [
*Page.content_panels,
MultiFieldPanel(
[FieldPanel('cover_image'), FieldPanel('hero_image')], heading='Images'
Expand All @@ -98,7 +98,7 @@ class ExhibitPage(Page):
InlinePanel('other_exhibits', heading='Other Exhibits', max_num=3),
]

api_fields: ClassVar[List[APIField]] = [
api_fields: ClassVar[list[APIField]] = [
APIField('title'),
APIField('body', serializer=RichTextSerializer()),
APIField(
Expand Down
4 changes: 2 additions & 2 deletions exhibits/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from wagtail.api.v2.views import BaseAPIViewSet

Expand All @@ -8,7 +8,7 @@
class ExhibitsAPIViewSet(BaseAPIViewSet):
model = ExhibitPage

listing_default_fields: ClassVar[List[str]] = [
listing_default_fields: ClassVar[list[str]] = [
*BaseAPIViewSet.listing_default_fields,
'title',
'body',
Expand Down
6 changes: 3 additions & 3 deletions home/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from wagtail.admin.panels import FieldPanel
from wagtail.api import APIField
Expand All @@ -9,9 +9,9 @@
class HomePage(Page):
body = RichTextField(blank=True)

content_panels: ClassVar[List[FieldPanel]] = [
content_panels: ClassVar[list[FieldPanel]] = [
*Page.content_panels,
FieldPanel('body', classname='full'),
]

api_fields: ClassVar[List[APIField]] = [APIField('body')]
api_fields: ClassVar[list[APIField]] = [APIField('body')]
8 changes: 4 additions & 4 deletions ov_collections/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from django.db import models
from wagtail.admin.panels import FieldPanel
Expand Down Expand Up @@ -71,19 +71,19 @@ class Collection(Page):
related_name='+',
)

search_fields: ClassVar[List[index.SearchField]] = [
search_fields: ClassVar[list[index.SearchField]] = [
*Page.search_fields,
index.SearchField('introduction'),
]

content_panels: ClassVar[List[FieldPanel]] = [
content_panels: ClassVar[list[FieldPanel]] = [
*Page.content_panels,
FieldPanel('introduction'),
FieldPanel('cover_image'),
FieldPanel('content'),
]

api_fields: ClassVar[List[APIField]] = [
api_fields: ClassVar[list[APIField]] = [
APIField('title'),
APIField('introduction'),
APIField(
Expand Down
4 changes: 2 additions & 2 deletions ov_collections/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import ClassVar, List
from typing import ClassVar

from wagtail.api.v2.views import BaseAPIViewSet

Expand All @@ -8,7 +8,7 @@
class CollectionAPIViewSet(BaseAPIViewSet):
model = Collection

listing_default_fields: ClassVar[List[str]] = [
listing_default_fields: ClassVar[list[str]] = [
*BaseAPIViewSet.listing_default_fields,
'title',
'introduction',
Expand Down
Loading

0 comments on commit 5fee679

Please sign in to comment.