Skip to content

Commit

Permalink
add giza as namespace package
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Martinez authored and Alejandro Martinez committed May 18, 2024
1 parent 3499804 commit 163eecf
Show file tree
Hide file tree
Showing 55 changed files with 214 additions and 209 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/onpush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
poetry run pre-commit run --all-files
- name: Testing
run: |
poetry run pytest --cov=giza --cov-report term-missing --cov-fail-under=60
poetry run pytest --cov=giza.cli--cov-report term-missing --cov-fail-under=60
2 changes: 1 addition & 1 deletion .github/workflows/onrelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
poetry run ruff giza
- name: Testing
run: |
poetry run pytest --cov=giza --cov-report term-missing --cov-fail-under=60
poetry run pytest --cov=giza.cli--cov-report term-missing --cov-fail-under=60
- name: Build dist
run: poetry build
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion giza/__main__.py → giza/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from giza.cli import entrypoint
from giza.cli.cli import entrypoint

if __name__ == "__main__":
entrypoint()
4 changes: 2 additions & 2 deletions giza/callbacks.py → giza/cli/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import typer

from giza import __version__
from giza.utils import echo
from giza.cli import __version__
from giza.cli.utils import echo


def version_callback(value: bool) -> None:
Expand Down
28 changes: 14 additions & 14 deletions giza/cli.py → giza/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import typer.rich_utils
from rich.traceback import install

from giza.commands.actions import app as actions_app
from giza.commands.agents import app as agents_app
from giza.commands.endpoints import app as deployments_app
from giza.commands.endpoints import deploy
from giza.commands.models import app as models_app
from giza.commands.prove import prove
from giza.commands.reset_password import request_reset_password_token, reset_password
from giza.commands.users import app as users_app
from giza.commands.verify import verify
from giza.commands.version import check_version
from giza.commands.versions import app as versions_app
from giza.commands.versions import transpile
from giza.commands.workspaces import app as workspaces_app
from giza.utils import echo
from giza.cli.commands.actions import app as actions_app
from giza.cli.commands.agents import app as agents_app
from giza.cli.commands.endpoints import app as deployments_app
from giza.cli.commands.endpoints import deploy
from giza.cli.commands.models import app as models_app
from giza.cli.commands.prove import prove
from giza.cli.commands.reset_password import request_reset_password_token, reset_password
from giza.cli.commands.users import app as users_app
from giza.cli.commands.verify import verify
from giza.cli.commands.version import check_version
from giza.cli.commands.versions import app as versions_app
from giza.cli.commands.versions import transpile
from giza.cli.commands.workspaces import app as workspaces_app
from giza.cli.utils import echo

install(suppress=[click])

Expand Down
28 changes: 14 additions & 14 deletions giza/client.py → giza/cli/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
from requests import HTTPError, Response, Session
from rich import print, print_json

from giza.schemas import users
from giza.schemas.agents import Agent, AgentCreate, AgentList, AgentUpdate
from giza.schemas.endpoints import Endpoint, EndpointCreate, EndpointsList
from giza.schemas.jobs import Job, JobCreate, JobList
from giza.schemas.message import Msg
from giza.schemas.models import Model, ModelCreate, ModelList, ModelUpdate
from giza.schemas.proofs import Proof, ProofList
from giza.schemas.token import TokenResponse
from giza.schemas.verify import VerifyResponse
from giza.schemas.versions import Version, VersionCreate, VersionList, VersionUpdate
from giza.schemas.workspaces import Workspace
from giza.utils import echo
from giza.utils.decorators import auth
from giza.utils.enums import VersionStatus
from giza.cli.schemas import users
from giza.cli.schemas.agents import Agent, AgentCreate, AgentList, AgentUpdate
from giza.cli.schemas.endpoints import Endpoint, EndpointCreate, EndpointsList
from giza.cli.schemas.jobs import Job, JobCreate, JobList
from giza.cli.schemas.message import Msg
from giza.cli.schemas.models import Model, ModelCreate, ModelList, ModelUpdate
from giza.cli.schemas.proofs import Proof, ProofList
from giza.cli.schemas.token import TokenResponse
from giza.cli.schemas.verify import VerifyResponse
from giza.cli.schemas.versions import Version, VersionCreate, VersionList, VersionUpdate
from giza.cli.schemas.workspaces import Workspace
from giza.cli.utils import echo
from giza.cli.utils.decorators import auth
from giza.cli.utils.enums import VersionStatus

DEFAULT_API_VERSION = "v1"
GIZA_TOKEN_VARIABLE = "GIZA_TOKEN"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion giza/commands/actions.py → giza/cli/commands/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from cookiecutter.main import cookiecutter # type: ignore
from slugify import slugify

from giza.utils import echo
from giza.cli.utils import echo

app = typer.Typer()

Expand Down
14 changes: 7 additions & 7 deletions giza/commands/agents.py → giza/cli/commands/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from rich.console import Console
from rich.table import Table

from giza import API_HOST
from giza.client import AgentsClient, EndpointsClient
from giza.options import DEBUG_OPTION
from giza.schemas.agents import AgentCreate, AgentList, AgentUpdate
from giza.utils import echo
from giza.utils.exception_handling import ExceptionHandler
from giza.utils.misc import get_ape_accounts, get_parameters_from_str, load_json_file
from giza.cli import API_HOST
from giza.cli.client import AgentsClient, EndpointsClient
from giza.cli.options import DEBUG_OPTION
from giza.cli.schemas.agents import AgentCreate, AgentList, AgentUpdate
from giza.cli.utils import echo
from giza.cli.utils.exception_handling import ExceptionHandler
from giza.cli.utils.misc import get_ape_accounts, get_parameters_from_str, load_json_file

app = typer.Typer()

Expand Down
18 changes: 9 additions & 9 deletions giza/commands/endpoints.py → giza/cli/commands/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from requests import HTTPError
from rich import print_json

from giza import API_HOST
from giza.client import EndpointsClient
from giza.frameworks import cairo, ezkl
from giza.options import DEBUG_OPTION
from giza.schemas.endpoints import EndpointsList
from giza.schemas.proofs import Proof, ProofList
from giza.utils import echo, get_response_info
from giza.utils.enums import Framework, ServiceSize
from giza.utils.exception_handling import ExceptionHandler
from giza.cli import API_HOST
from giza.cli.client import EndpointsClient
from giza.cli.frameworks import cairo, ezkl
from giza.cli.options import DEBUG_OPTION
from giza.cli.schemas.endpoints import EndpointsList
from giza.cli.schemas.proofs import Proof, ProofList
from giza.cli.utils import echo, get_response_info
from giza.cli.utils.enums import Framework, ServiceSize
from giza.cli.utils.exception_handling import ExceptionHandler

app = typer.Typer()

Expand Down
10 changes: 5 additions & 5 deletions giza/commands/models.py → giza/cli/commands/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from requests import HTTPError
from rich import print_json

from giza import API_HOST
from giza.client import ModelsClient
from giza.options import DEBUG_OPTION
from giza.schemas.models import ModelCreate
from giza.utils import echo, get_response_info
from giza.cli import API_HOST
from giza.cli.client import ModelsClient
from giza.cli.options import DEBUG_OPTION
from giza.cli.schemas.models import ModelCreate
from giza.cli.utils import echo, get_response_info

app = typer.Typer()

Expand Down
6 changes: 3 additions & 3 deletions giza/commands/prove.py → giza/cli/commands/prove.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import typer

from giza.frameworks import cairo, ezkl
from giza.options import DEBUG_OPTION
from giza.utils.enums import Framework, JobSize
from giza.cli.frameworks import cairo, ezkl
from giza.cli.options import DEBUG_OPTION
from giza.cli.utils.enums import Framework, JobSize

app = typer.Typer()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import typer
from requests import HTTPError

from giza import API_HOST
from giza.client import UsersClient
from giza.exceptions import PasswordError
from giza.options import DEBUG_OPTION
from giza.utils import echo, get_response_info
from giza.utils.misc import _check_password_strength
from giza.cli import API_HOST
from giza.cli.client import UsersClient
from giza.cli.exceptions import PasswordError
from giza.cli.options import DEBUG_OPTION
from giza.cli.utils import echo, get_response_info
from giza.cli.utils.misc import _check_password_strength


def prompt_for_input(
Expand Down
14 changes: 7 additions & 7 deletions giza/commands/users.py → giza/cli/commands/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from requests import HTTPError
from rich import print_json

from giza import API_HOST
from giza.client import UsersClient
from giza.exceptions import PasswordError
from giza.options import DEBUG_OPTION
from giza.schemas import users
from giza.utils import echo, get_response_info
from giza.utils.misc import _check_password_strength
from giza.cli import API_HOST
from giza.cli.client import UsersClient
from giza.cli.exceptions import PasswordError
from giza.cli.options import DEBUG_OPTION
from giza.cli.schemas import users
from giza.cli.utils import echo, get_response_info
from giza.cli.utils.misc import _check_password_strength

app = typer.Typer()

Expand Down
6 changes: 3 additions & 3 deletions giza/commands/verify.py → giza/cli/commands/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import typer

from giza.frameworks import cairo, ezkl
from giza.options import DEBUG_OPTION
from giza.utils.enums import Framework, JobSize
from giza.cli.frameworks import cairo, ezkl
from giza.cli.options import DEBUG_OPTION
from giza.cli.utils.enums import Framework, JobSize

app = typer.Typer()

Expand Down
4 changes: 2 additions & 2 deletions giza/commands/version.py → giza/cli/commands/version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import requests
import semver

from giza import __version__
from giza.utils.echo import Echo
from giza.cli import __version__
from giza.cli.utils.echo import Echo


# TODO: Make sure that this works offline, currently it doesn't
Expand Down
18 changes: 9 additions & 9 deletions giza/commands/versions.py → giza/cli/commands/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import typer
from rich import print_json

from giza import API_HOST
from giza.client import TranspileClient, VersionsClient
from giza.frameworks import cairo, ezkl
from giza.options import DEBUG_OPTION
from giza.schemas.versions import Version, VersionList
from giza.utils import echo
from giza.utils.enums import Framework, VersionStatus
from giza.utils.exception_handling import ExceptionHandler
from giza.utils.misc import download_model_or_sierra, scarb_build, zip_folder
from giza.cli import API_HOST
from giza.cli.client import TranspileClient, VersionsClient
from giza.cli.frameworks import cairo, ezkl
from giza.cli.options import DEBUG_OPTION
from giza.cli.schemas.versions import Version, VersionList
from giza.cli.utils import echo
from giza.cli.utils.enums import Framework, VersionStatus
from giza.cli.utils.exception_handling import ExceptionHandler
from giza.cli.utils.misc import download_model_or_sierra, scarb_build, zip_folder

app = typer.Typer()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from rich import print_json
from rich.live import Live

from giza import API_HOST
from giza.client import WorkspaceClient
from giza.options import DEBUG_OPTION
from giza.utils import echo, get_response_info
from giza.cli import API_HOST
from giza.cli.client import WorkspaceClient
from giza.cli.options import DEBUG_OPTION
from giza.cli.utils import echo, get_response_info

app = typer.Typer()

Expand Down
File renamed without changes.
File renamed without changes.
22 changes: 11 additions & 11 deletions giza/frameworks/cairo.py → giza/cli/frameworks/cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@
from rich.progress import Progress, SpinnerColumn, TextColumn
from rich.spinner import Spinner

from giza import API_HOST
from giza.client import (
from giza.cli import API_HOST
from giza.cli.client import (
EndpointsClient,
JobsClient,
ModelsClient,
ProofsClient,
VersionsClient,
)
from giza.options import DEBUG_OPTION
from giza.schemas.endpoints import Endpoint, EndpointCreate, EndpointsList
from giza.schemas.jobs import Job, JobCreate
from giza.schemas.models import ModelCreate
from giza.schemas.proofs import Proof
from giza.schemas.versions import VersionCreate, VersionUpdate
from giza.utils import Echo, echo, get_response_info
from giza.utils.enums import (
from giza.cli.options import DEBUG_OPTION
from giza.cli.schemas.endpoints import Endpoint, EndpointCreate, EndpointsList
from giza.cli.schemas.jobs import Job, JobCreate
from giza.cli.schemas.models import ModelCreate
from giza.cli.schemas.proofs import Proof
from giza.cli.schemas.versions import VersionCreate, VersionUpdate
from giza.cli.utils import Echo, echo, get_response_info
from giza.cli.utils.enums import (
Framework,
JobKind,
JobSize,
JobStatus,
ServiceSize,
VersionStatus,
)
from giza.utils.misc import download_model_or_sierra
from giza.cli.utils.misc import download_model_or_sierra

app = typer.Typer()

Expand Down
20 changes: 10 additions & 10 deletions giza/frameworks/ezkl.py → giza/cli/frameworks/ezkl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
from rich.live import Live
from rich.progress import Progress, Spinner, SpinnerColumn, TextColumn

from giza import API_HOST
from giza.client import (
from giza.cli import API_HOST
from giza.cli.client import (
EndpointsClient,
JobsClient,
ModelsClient,
ProofsClient,
VersionJobsClient,
VersionsClient,
)
from giza.options import DEBUG_OPTION
from giza.schemas.endpoints import EndpointCreate, EndpointsList
from giza.schemas.jobs import Job, JobCreate
from giza.schemas.models import ModelCreate
from giza.schemas.proofs import Proof
from giza.schemas.versions import VersionCreate, VersionStatus, VersionUpdate
from giza.utils import Echo, get_response_info
from giza.utils.enums import Framework, JobKind, JobSize, JobStatus, ServiceSize
from giza.cli.options import DEBUG_OPTION
from giza.cli.schemas.endpoints import EndpointCreate, EndpointsList
from giza.cli.schemas.jobs import Job, JobCreate
from giza.cli.schemas.models import ModelCreate
from giza.cli.schemas.proofs import Proof
from giza.cli.schemas.versions import VersionCreate, VersionStatus, VersionUpdate
from giza.cli.utils import Echo, get_response_info
from giza.cli.utils.enums import Framework, JobKind, JobSize, JobStatus, ServiceSize


def setup(
Expand Down
2 changes: 1 addition & 1 deletion giza/options.py → giza/cli/options.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typer

from giza.callbacks import debug_callback
from giza.cli.callbacks import debug_callback

DEBUG_OPTION = typer.Option(
False,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pydantic import BaseModel, ConfigDict, RootModel

from giza.utils.enums import Framework, ServiceSize
from giza.cli.utils.enums import Framework, ServiceSize


class EndpointCreate(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion giza/schemas/jobs.py → giza/cli/schemas/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pydantic import BaseModel, ConfigDict, RootModel

from giza.utils.enums import Framework, JobKind, JobSize, JobStatus
from giza.cli.utils.enums import Framework, JobKind, JobSize, JobStatus


class Job(BaseModel):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 163eecf

Please sign in to comment.