Skip to content

Commit

Permalink
Reorg cli and client (file moves and import updates)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzm committed Nov 19, 2024
1 parent 6403310 commit f5fd2fb
Show file tree
Hide file tree
Showing 62 changed files with 304 additions and 327 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies = []
dynamic = ["version"]

[project.scripts]
cm-service = "lsst.cmservice.cli.commands:server"
cm-client = "lsst.cmservice.cli.commands:client_top"
cm-service = "lsst.cmservice.cli.service.commands:top"
cm-client = "lsst.cmservice.cli.client.commands:top"
cm-worker = "lsst.cmservice.daemon:main"

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
query: getting objects from the database
"""


from . import (
action,
campaign,
Expand All @@ -25,19 +24,19 @@
job,
load,
options,
pipetask_error,
pipetask_error_type,
pipetask_error,
product_set,
production,
queue,
script,
script_dependency,
script_error,
script_template,
script,
spec_block,
specificaiton,
step,
step_dependency,
step,
task_set,
wms_task_report,
wrappers,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Any

from .. import db
from ..client.client import CMClient
from ..common.enums import StatusEnum
from ... import db
from ...common.enums import StatusEnum
from . import options
from .commands import client_top
from .client import CMClient
from .commands import top
from .wrappers import output_dict, output_pydantic_list, output_pydantic_object


@client_top.group()
@top.group()
def action() -> None:
"""Do something"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""CLI to manage Campaign table"""

from .. import db
from ... import db
from . import options, wrappers
from .commands import client_top
from .commands import top


@client_top.group(name="campaign")
@top.group(name="campaign")
def campaign_group() -> None:
"""Manage Campaign table"""

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import httpx

from .. import models
from ..common.enums import StatusEnum
from .... import models
from ....common.enums import StatusEnum
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import httpx

from .. import db, models
from ..common.enums import StatusEnum
from .... import db, models
from ....common.enums import StatusEnum
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import httpx

from ..config import client_config
from .actions import CMActionClient
from .campaigns import CMCampaignClient
from .clientconfig import client_config
from .groups import CMGroupClient
from .jobs import CMJobClient
from .loaders import CMLoadClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import httpx

from .. import db, models
from ..common.enums import StatusEnum
from .... import db, models
from ....common.enums import StatusEnum
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import httpx

from .. import db, models
from ..common.enums import StatusEnum
from .... import db, models
from ....common.enums import StatusEnum
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import httpx
import yaml

from .. import models
from ..common.enums import ErrorActionEnum, ErrorFlavorEnum, ErrorSourceEnum
from ..common.errors import CMYamlParseError
from ..common.utils import update_include_dict
from .... import models
from ....common.enums import ErrorActionEnum, ErrorFlavorEnum, ErrorSourceEnum
from ....common.errors import CMYamlParseError
from ....common.utils import update_include_dict
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import pause
from pydantic import TypeAdapter, ValidationError

from .. import db, models
from ..common.errors import test_type_and_raise
from .... import db, models
from ....common.errors import test_type_and_raise
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import httpx

from .. import db, models
from ..common.enums import StatusEnum
from .... import db, models
from ....common.enums import StatusEnum
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import httpx

from .. import db, models
from ..common.enums import StatusEnum
from .... import db, models
from ....common.enums import StatusEnum
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import httpx

from .. import db, models
from .... import db, models
from . import wrappers

if TYPE_CHECKING:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pydantic import BaseModel, TypeAdapter

from .. import models
from .... import models

if TYPE_CHECKING:
from .client import CMClient
Expand Down
7 changes: 7 additions & 0 deletions src/lsst/cmservice/cli/client/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import click


@click.group(name="client")
@click.version_option(package_name="lsst-cm-service")
def top() -> None:
"""Command-line client for cm-service."""
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""CLI to manage Group table"""

from .. import db
from ..client.client import CMClient
from ... import db
from . import options, wrappers
from .commands import client_top
from .client import CMClient
from .commands import top


@client_top.group(name="group")
@top.group(name="group")
def group_group() -> None:
"""Manage Group table"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""CLI to manage Job table"""

from .. import db
from ..client.client import CMClient
from ... import db
from . import options, wrappers
from .commands import client_top
from .client import CMClient
from .commands import top


@client_top.group(name="job")
@top.group(name="job")
def job_group() -> None:
"""Manage Job table"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import Any

from .. import db
from ..client.client import CMClient
from ... import db
from . import options
from .commands import client_top
from .client import CMClient
from .commands import top
from .wrappers import output_pydantic_list, output_pydantic_object


@client_top.group()
@top.group()
def load() -> None:
"""Read a yaml file and add stuff to the DB"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import click
from click.decorators import FC

from ..client.client import CMClient
from ..common.enums import (
from ...common.enums import (
ErrorActionEnum,
ErrorFlavorEnum,
ErrorSourceEnum,
NodeTypeEnum,
StatusEnum,
)
from .client import CMClient

__all__ = [
"cmclient",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""CLI to manage PipetaskError table"""

from .. import db
from ... import db
from . import options, wrappers
from .commands import client_top
from .commands import top


@client_top.group(name="pipetask_error")
@top.group(name="pipetask_error")
def pipetask_error_group() -> None:
"""Manage PipetaskError table"""

Expand Down
Loading

0 comments on commit f5fd2fb

Please sign in to comment.