From 7c48ce31b6423e85aff4064da7426fb595766120 Mon Sep 17 00:00:00 2001 From: mmwinther Date: Tue, 14 Nov 2023 14:36:41 +0100 Subject: [PATCH] Structure repo into src and generated directories --- .github/workflows/publish.yml | 1 + README.md | 4 ++++ poetry.lock => generated/python/datadoc_model/poetry.lock | 0 .../python/datadoc_model/pyproject.toml | 5 +---- .../python/datadoc_model_legacy/.bumpversion.cfg | 0 .../python/datadoc_model_legacy/datadoc_model}/BaseModel.py | 0 .../python/datadoc_model_legacy/datadoc_model}/Enums.py | 0 .../datadoc_model_legacy/datadoc_model}/LanguageStrings.py | 0 .../datadoc_model}/LanguageStringsEnum.py | 0 .../python/datadoc_model_legacy/datadoc_model}/Model.py | 0 .../python/datadoc_model_legacy/datadoc_model}/__init__.py | 0 .../datadoc-json-schema}/datadoc-json-schema.json | 0 .../datadoc-json-schema}/no/languageStringType.json | 0 .../datadoc-json-schema}/no/temporalityTypeType.json | 0 .../datadoc-json-schema}/no/unitType.json | 0 15 files changed, 6 insertions(+), 4 deletions(-) rename poetry.lock => generated/python/datadoc_model/poetry.lock (100%) rename pyproject.toml => generated/python/datadoc_model/pyproject.toml (88%) rename .bumpversion.cfg => generated/python/datadoc_model_legacy/.bumpversion.cfg (100%) rename {datadoc_model => generated/python/datadoc_model_legacy/datadoc_model}/BaseModel.py (100%) rename {datadoc_model => generated/python/datadoc_model_legacy/datadoc_model}/Enums.py (100%) rename {datadoc_model => generated/python/datadoc_model_legacy/datadoc_model}/LanguageStrings.py (100%) rename {datadoc_model => generated/python/datadoc_model_legacy/datadoc_model}/LanguageStringsEnum.py (100%) rename {datadoc_model => generated/python/datadoc_model_legacy/datadoc_model}/Model.py (100%) rename {datadoc_model => generated/python/datadoc_model_legacy/datadoc_model}/__init__.py (100%) rename {datadoc-json-schema => src/datadoc-json-schema}/datadoc-json-schema.json (100%) rename {datadoc-json-schema => src/datadoc-json-schema}/no/languageStringType.json (100%) rename {datadoc-json-schema => src/datadoc-json-schema}/no/temporalityTypeType.json (100%) rename {datadoc-json-schema => src/datadoc-json-schema}/no/unitType.json (100%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 220648f4..03ef977f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,3 +13,4 @@ jobs: uses: JRubics/poetry-publish@v1.12 with: pypi_token: ${{ secrets.PYPI_TOKEN }} + package_directory: "generated/python/datadoc_model_legacy" diff --git a/README.md b/README.md index 436c1763..99cadea6 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,7 @@ This package contains pydantic models defining the fields and data types used in Fields and data types defined in models in this package are specified on internal Statistics Norway wiki pages: - + +## Code generation + +The models are defined as [JSON Schema](https://json-schema.org/) documents. These reside within the `src/` directory in this repo. Code for a range of languages is generated from the JSON Schema and will live inside the `generated/` directory, with a subdirectory for each language. diff --git a/poetry.lock b/generated/python/datadoc_model/poetry.lock similarity index 100% rename from poetry.lock rename to generated/python/datadoc_model/poetry.lock diff --git a/pyproject.toml b/generated/python/datadoc_model/pyproject.toml similarity index 88% rename from pyproject.toml rename to generated/python/datadoc_model/pyproject.toml index a94d5226..d1754e36 100644 --- a/pyproject.toml +++ b/generated/python/datadoc_model/pyproject.toml @@ -7,9 +7,7 @@ license = "MIT" readme = "README.md" repository = "https://github.com/statisticsnorway/ssb-datadoc-model" -packages = [ - { include = "datadoc_model" }, -] +packages = [{ include = "datadoc_model" }] [tool.poetry.dependencies] python = ">=3.8" @@ -18,7 +16,6 @@ pydantic = ">=2.4.0" [tool.poetry.dev-dependencies] black = "*" ipython = "*" -bump2version = "*" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/.bumpversion.cfg b/generated/python/datadoc_model_legacy/.bumpversion.cfg similarity index 100% rename from .bumpversion.cfg rename to generated/python/datadoc_model_legacy/.bumpversion.cfg diff --git a/datadoc_model/BaseModel.py b/generated/python/datadoc_model_legacy/datadoc_model/BaseModel.py similarity index 100% rename from datadoc_model/BaseModel.py rename to generated/python/datadoc_model_legacy/datadoc_model/BaseModel.py diff --git a/datadoc_model/Enums.py b/generated/python/datadoc_model_legacy/datadoc_model/Enums.py similarity index 100% rename from datadoc_model/Enums.py rename to generated/python/datadoc_model_legacy/datadoc_model/Enums.py diff --git a/datadoc_model/LanguageStrings.py b/generated/python/datadoc_model_legacy/datadoc_model/LanguageStrings.py similarity index 100% rename from datadoc_model/LanguageStrings.py rename to generated/python/datadoc_model_legacy/datadoc_model/LanguageStrings.py diff --git a/datadoc_model/LanguageStringsEnum.py b/generated/python/datadoc_model_legacy/datadoc_model/LanguageStringsEnum.py similarity index 100% rename from datadoc_model/LanguageStringsEnum.py rename to generated/python/datadoc_model_legacy/datadoc_model/LanguageStringsEnum.py diff --git a/datadoc_model/Model.py b/generated/python/datadoc_model_legacy/datadoc_model/Model.py similarity index 100% rename from datadoc_model/Model.py rename to generated/python/datadoc_model_legacy/datadoc_model/Model.py diff --git a/datadoc_model/__init__.py b/generated/python/datadoc_model_legacy/datadoc_model/__init__.py similarity index 100% rename from datadoc_model/__init__.py rename to generated/python/datadoc_model_legacy/datadoc_model/__init__.py diff --git a/datadoc-json-schema/datadoc-json-schema.json b/src/datadoc-json-schema/datadoc-json-schema.json similarity index 100% rename from datadoc-json-schema/datadoc-json-schema.json rename to src/datadoc-json-schema/datadoc-json-schema.json diff --git a/datadoc-json-schema/no/languageStringType.json b/src/datadoc-json-schema/no/languageStringType.json similarity index 100% rename from datadoc-json-schema/no/languageStringType.json rename to src/datadoc-json-schema/no/languageStringType.json diff --git a/datadoc-json-schema/no/temporalityTypeType.json b/src/datadoc-json-schema/no/temporalityTypeType.json similarity index 100% rename from datadoc-json-schema/no/temporalityTypeType.json rename to src/datadoc-json-schema/no/temporalityTypeType.json diff --git a/datadoc-json-schema/no/unitType.json b/src/datadoc-json-schema/no/unitType.json similarity index 100% rename from datadoc-json-schema/no/unitType.json rename to src/datadoc-json-schema/no/unitType.json