Skip to content

Commit

Permalink
[PYG-210]šŸ‚ Cleanup Test Data (#298)
Browse files Browse the repository at this point in the history
* refactor: removed unused nodes

* refactor: removed use of overwrite

* build: not deploy all models

* build; upgrade toolkit

* refactor: remove unused property
  • Loading branch information
doctrino authored Sep 29, 2024
1 parent c264363 commit e52ebc1
Show file tree
Hide file tree
Showing 56 changed files with 3 additions and 8,077 deletions.
24 changes: 2 additions & 22 deletions dev.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""
This is a small CLI used for development of Pygen.
"""
"""This is a small CLI used for Pygen development."""

import re
from collections import defaultdict
Expand Down Expand Up @@ -38,9 +35,6 @@

@app.command("generate", help=f"Generate all example SDKs in directory '{EXAMPLES_DIR.relative_to(REPO_ROOT)}/'")
def generate_sdks(
overwrite: bool = typer.Option(
False, help="Whether to overwrite the files expected to be manually maintained in the examples"
),
sdk_name: str = typer.Option(None, "--sdk", help="Generate only the specified SDK"),
):
for example_sdk in EXAMPLE_SDKS:
Expand Down Expand Up @@ -68,15 +62,6 @@ def generate_sdks(
)

sdk = sdk_generator.generate_sdk()
manual_files = []
if overwrite is not True:
for manual_file in example_sdk.manual_files:
manual_path = manual_file.relative_to(EXAMPLES_DIR)
popped = sdk.pop(manual_path, None)
if popped is None:
typer.echo(f"Could not find {manual_path} in generated SDK", err=True, color=True)
else:
manual_files.append(manual_path)
write_sdk_to_disk(
sdk,
EXAMPLES_DIR,
Expand All @@ -86,12 +71,7 @@ def generate_sdks(
top_level_package=example_sdk.top_level_package,
)
typer.echo(f"{example_sdk.client_name} SDK Created in {example_sdk.client_dir}")
if manual_files:
typer.echo(
f"The following files were not updated, as they are expected to be changed manually: {manual_files}"
)
else:
typer.echo("All files updated! Including files assumed to be manually maintained.")
typer.echo("All files updated! Including files assumed to be manually maintained.")
typer.echo("\n")

typer.echo("All SDKs Created!")
Expand Down
1 change: 0 additions & 1 deletion tests/config.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ environment:
type: dev
selected:
- models
- data_testing

variables:
modules:
Expand Down
36 changes: 1 addition & 35 deletions tests/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def load_write_model(self, data_model_id: dm.DataModelId) -> dm.DataModelApply:
return dm.DataModelApply(
space=data_model_id.space,
external_id=data_model_id.external_id,
version=data_model_id.version,
version=data_model_id.version or "v1",
description="",
name=data_model_id.external_id,
views=views,
Expand Down Expand Up @@ -222,23 +222,6 @@ def load_read_nodes(self, data_model_id: dm.DataModelId) -> dm.NodeList:
)


# This uses connections that are not supported by the UI, so it will not be shown there.
OMNIUM_CONNECTION_SDK = ExampleSDK(
data_model_ids=[DataModelId("pygen-models", "OmniConnection", "1")],
_top_level_package="omni_connection",
client_name="OmniConnectionClient",
generate_sdk=False,
instance_space="omni-instances",
)

APM_SDK = ExampleSDK(
data_model_ids=[DataModelId("tutorial_apm_simple", "ApmSimple", "6")],
_top_level_package="tutorial_apm_simple.client",
client_name="ApmSimpleClient",
generate_sdk=False,
instance_space=None,
)

PUMP_SDK = ExampleSDK(
data_model_ids=[DataModelId("IntegrationTestsImmutable", "Pumps", "1")],
_top_level_package="pump.client",
Expand All @@ -255,23 +238,6 @@ def load_read_nodes(self, data_model_id: dm.DataModelId) -> dm.NodeList:
instance_space="IntegrationTestsImmutable",
)


APM_APP_DATA_SOURCE = ExampleSDK(
data_model_ids=[DataModelId("APM_AppData_4", "APM_AppData_4", "7")],
_top_level_package="apm_domain.client",
client_name="ApmClient",
generate_sdk=False,
instance_space=None,
)

APM_APP_DATA_SINK = ExampleSDK(
data_model_ids=[DataModelId("IntegrationTestsImmutable", "ApmAppData", "v3")],
_top_level_package="sysdm_domain.client",
client_name="SysDMClient",
generate_sdk=False,
instance_space=None,
)

EQUIPMENT_UNIT_SDK = ExampleSDK(
data_model_ids=[DataModelId("IntegrationTestsImmutable", "EquipmentUnit", "2")],
_top_level_package="equipment_unit",
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit e52ebc1

Please sign in to comment.