Skip to content

Commit

Permalink
Merge pull request #58 from gizatechxyz/feature/giza_namespace
Browse files Browse the repository at this point in the history
add giza as a namespace package
  • Loading branch information
Gonmeso authored May 22, 2024
2 parents acf7657 + 1500b97 commit 505bdeb
Show file tree
Hide file tree
Showing 61 changed files with 247 additions and 218 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
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Giza CLI 0.16.0
description: Giza CLI 0.17.0
---

# Giza CLI
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/full_transpilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pip install -r requirements.txt
Or:

```bash
pip install giza-cli==0.16.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
pip install giza-cli==0.17.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0
```

We will use the libraries for the following purposes:
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/mnist_pytorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"Or:\n",
"\n",
"```bash\n",
"pip install giza-cli==0.16.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0\n",
"pip install giza-cli==0.17.0 onnx==1.14.1 torch==2.1.0 torchvision==0.16.0\n",
"```\n",
"\n",
"We will use the libraries for the following purposes:\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/mnist/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
giza-cli==0.16.0
giza-cli==0.17.0
onnx>=1.16.0
tf2onnx==1.15.1
torch==2.1.0
Expand Down
2 changes: 1 addition & 1 deletion giza/__init__.py → giza/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os

__version__ = "0.16.0"
__version__ = "0.17.0"
# Until DNS is fixed
API_HOST = os.environ.get("GIZA_API_HOST", "https://api.gizatech.xyz")
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
31 changes: 17 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,23 @@
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
30 changes: 15 additions & 15 deletions giza/client.py → giza/cli/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
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.logs import Logs
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.logs import Logs
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
18 changes: 11 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,9 +7,9 @@
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 (
from giza.cli import API_HOST
from giza.cli.client import AgentsClient, EndpointsClient
from giza.cli.options import (
AGENT_OPTION,
DEBUG_OPTION,
DESCRIPTION_OPTION,
Expand All @@ -18,10 +18,14 @@
NAME_OPTION,
VERSION_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.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,21 +6,21 @@
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 (
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,
ENDPOINT_OPTION,
FRAMEWORK_OPTION,
MODEL_OPTION,
VERSION_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.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, DESCRIPTION_OPTION, MODEL_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, DESCRIPTION_OPTION, MODEL_OPTION
from giza.cli.schemas.models import ModelCreate
from giza.cli.utils import echo, get_response_info

app = typer.Typer()

Expand Down
11 changes: 8 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,14 @@

import typer

from giza.frameworks import cairo, ezkl
from giza.options import DEBUG_OPTION, FRAMEWORK_OPTION, MODEL_OPTION, VERSION_OPTION
from giza.utils.enums import Framework, JobSize
from giza.cli.frameworks import cairo, ezkl
from giza.cli.options import (
DEBUG_OPTION,
FRAMEWORK_OPTION,
MODEL_OPTION,
VERSION_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
11 changes: 8 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,14 @@

import typer

from giza.frameworks import cairo, ezkl
from giza.options import DEBUG_OPTION, FRAMEWORK_OPTION, MODEL_OPTION, VERSION_OPTION
from giza.utils.enums import Framework, JobSize
from giza.cli.frameworks import cairo, ezkl
from giza.cli.options import (
DEBUG_OPTION,
FRAMEWORK_OPTION,
MODEL_OPTION,
VERSION_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,10 +8,10 @@
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 (
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,
DESCRIPTION_OPTION,
FRAMEWORK_OPTION,
Expand All @@ -20,11 +20,11 @@
OUTPUT_PATH_OPTION,
VERSION_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.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.
Loading

0 comments on commit 505bdeb

Please sign in to comment.