diff --git a/.github/workflows/pypi_publish.yaml b/.github/workflows/pypi_publish.yaml index 07d9f65..029e60f 100644 --- a/.github/workflows/pypi_publish.yaml +++ b/.github/workflows/pypi_publish.yaml @@ -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 }} diff --git a/.static_files b/.static_files index a2f8ff5..3b17170 100644 --- a/.static_files +++ b/.static_files @@ -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 diff --git a/ghga_event_schemas/__init__.py b/ghga_event_schemas/__init__.py index 54a8e99..2dc1375 100644 --- a/ghga_event_schemas/__init__.py +++ b/ghga_event_schemas/__init__.py @@ -15,4 +15,4 @@ """A package that collects schemas used for events exchanges between GHGA service.""" -__version__ = "0.13.2" +__version__ = "0.13.3" diff --git a/ghga_event_schemas/pydantic_.py b/ghga_event_schemas/pydantic_.py index eacfa08..70c5375 100644 --- a/ghga_event_schemas/pydantic_.py +++ b/ghga_event_schemas/pydantic_.py @@ -20,7 +20,7 @@ """ from enum import Enum -from typing import Optional +from typing import Any, Optional from pydantic import BaseModel, EmailStr, Field, validator @@ -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." diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000..6222ab0 --- /dev/null +++ b/scripts/__init__.py @@ -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.""" diff --git a/scripts/update_template_files.py b/scripts/update_template_files.py index 7ff6e22..952fe2c 100755 --- a/scripts/update_template_files.py +++ b/scripts/update_template_files.py @@ -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).""" diff --git a/setup.cfg b/setup.cfg index fdf52df..7633425 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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