Skip to content

Commit

Permalink
Tokay Gecko models (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mephenor committed Jul 19, 2023
1 parent 16ab616 commit ad5d0b4
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pypi_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ jobs:
pytest .
- name: Publish distribution package to PyPI (test)
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Publish distribution package to PyPI (production)
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .static_files
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
scripts/script_utils/__init__.py
scripts/script_utils/cli.py

scripts/__init__.py
scripts/license_checker.py
scripts/get_package_name.py
scripts/update_config_docs.py
Expand Down
2 changes: 1 addition & 1 deletion ghga_event_schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

"""A package that collects schemas used for events exchanges between GHGA service."""

__version__ = "0.13.2"
__version__ = "0.13.3"
23 changes: 20 additions & 3 deletions ghga_event_schemas/pydantic_.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""

from enum import Enum
from typing import Optional
from typing import Any, Optional

from pydantic import BaseModel, EmailStr, Field, validator

Expand Down Expand Up @@ -53,13 +53,30 @@ class Config:
extra = "allow"


class MetadataDatasetOverview(BaseModel):
class MetadataDatasetID(BaseModel):
"""Simplified model to pass artifact/dataset ID to claims repository for deletion"""

accession: str = Field(..., description="The dataset accession.")


class MetadataDataset(MetadataDatasetID):
"""Model to populate MASS from metldata artifacts"""

class_name: str = Field(
...,
description="The name of the class this dataset/artifact resource corresponds to.",
)
content: dict[str, Any] = Field(
..., description="The metadata content of this dataset/artifact resource."
)


class MetadataDatasetOverview(MetadataDatasetID):
"""
Overview of files contained in a dataset.
Only fields relevant to the WPS are included for now. May be extended.
"""

accession: str = Field(..., description="The dataset accession.")
title: str = Field(..., description="The title of the dataset.")
stage: MetadataDatasetStage = Field(
..., description="The current stage of this dataset."
Expand Down
17 changes: 17 additions & 0 deletions scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
# for the German Human Genome-Phenome Archive (GHGA)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

"""Scripts and utils used during development or in CI pipelines."""
2 changes: 1 addition & 1 deletion scripts/update_template_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
try:
from script_utils.cli import echo_failure, echo_success, run
except ImportError:
echo_failure = echo_success = print # type: ignore
echo_failure = echo_success = print

def run(main_fn):
"""Run main function without cli tools (typer)."""
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ packages = find:
install_requires =
jsonschema>=4.17.3,<5.0.0
pydantic[email]>=1.0.0,<2.0.0
dnspython<2.4.0

python_requires = >= 3.9

Expand Down

0 comments on commit ad5d0b4

Please sign in to comment.