Skip to content

Commit

Permalink
Added lock file and attempt first github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
djspstfc committed Jul 18, 2024
1 parent da80a77 commit 132123e
Show file tree
Hide file tree
Showing 6 changed files with 651 additions and 9 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/esgf-playground-utils-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: esgf-playground-utils

on:
push:
paths:
- 'esgf-playground-utils/**'
pull_request:
paths:
- 'esgf-playground-utils/**'

defaults:
run:
working-directory: ./esgf-playground-utils

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check --verbose"
use_pyproject: true
9 changes: 8 additions & 1 deletion esgf-playground-utils/esgf_playground_utils/config/kafka.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Configuration for kafka
Configuration module for the ESGF-Playground.
"""

from re import compile
Expand All @@ -10,6 +10,13 @@


class Settings(BaseSettings):
"""
Container for configuration of the ESGF-Playground.
By default, this configuration is valid for running the consumer on localhost, with a Kafka broker on localhost,
provided it is given a `consumer_group` value. It will subscribe the consumer to all topics.
"""

model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")

bootstrap_servers: List[str] = ["localhost"]
Expand Down
5 changes: 2 additions & 3 deletions esgf-playground-utils/esgf_playground_utils/models/item.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""
Models for esgf_consumer app.
Models relating to STAC Items for the ESGF-Playground.
"""

from pydantic import AnyUrl
from stac_pydantic import ItemProperties
from stac_pydantic.api import Item
from stac_pydantic.item import Item, ItemProperties


class ESGFItem(Item):
Expand Down
6 changes: 3 additions & 3 deletions esgf-playground-utils/esgf_playground_utils/models/kafka.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
Models for esgf_consumer app.
Models relating to Kakfa payloads for the ESGF-Playground.
"""

from datetime import datetime
from enum import Enum
from typing import Literal

from pydantic import BaseModel
from stac_pydantic.api import Item
from stac_pydantic.item import Item


class Payload(BaseModel):
Expand All @@ -24,7 +24,7 @@ class RevokePayload(BaseModel):


class UpdatePayload(BaseModel):
item: Item | dict
item: Item


class Data(BaseModel):
Expand Down
Loading

0 comments on commit 132123e

Please sign in to comment.