Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dexi/commands/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
found_package = fetch_package(package, dexi_tool["packages"])

if found_package is None:
error(f"Could not find '{package}' package")
error(f"Could not find [red]'{package}'[/red] package")
return

data = Package.from_git(found_package["git"], found_package["branch"])
Expand Down Expand Up @@ -107,8 +107,8 @@
if data.app is not None:
if not app_operations_supported():
error(
f"DexI packages with Django apps are not supported "
f"on Ballsdex v$BD_V, please update to v{SUPPORTED_APP_VERSION}+"
f"[red]DexI packages[/red] with Django apps are not supported "
f"on [red]Ballsdex v$BD_V[/red], please update to v{SUPPORTED_APP_VERSION}+"

Check failure on line 111 in dexi/commands/installer.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

dexi/commands/installer.py:111:91: E501 Line too long (92 > 90)
)

app_desination = f"{os.getcwd()}/admin_panel/{data.app.target}"
Expand All @@ -124,7 +124,7 @@
response = requests.get(zip_url)

if not response.ok:
error(f"Failed to fetch {name}")
error(f"Failed to fetch [red]{name}[/red]")

with zipfile.ZipFile(io.BytesIO(response.content)) as z:
base_folder = f"{repository}-{branch}/"
Expand Down
14 changes: 7 additions & 7 deletions dexi/commands/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def add_package(package: str, branch: str):

if installed_version not in specifier:
error(
f"Ballsdex version requirement for '{package}' is set to "
f"'{data.ballsdex_version}', while this instance is on "
f"version '{ballsdex}'"
f"Ballsdex version requirement for [red]'{package}'[/red] is set to "
f"[red]'{data.ballsdex_version}'[/red], while this instance is on "
f"version [red]'{ballsdex}'[/red]"
)

project = parse_pyproject()
Expand All @@ -58,7 +58,7 @@ def add_package(package: str, branch: str):
dexi = tool.setdefault("dexi", table())

if not initialized and fetch_package(package, fetch_all_packages()) is not None:
error("This package has already been added")
error("This [red]package[/red] has already been added")

package_array = dexi.setdefault("packages", array().multiline(True))

Expand Down Expand Up @@ -113,7 +113,7 @@ def remove_package(package: str):
package_entry = fetch_package(package, dexi_tool["packages"])

if package_entry is None:
error(f"Could not find '{package}' package")
error(f"Could not find [red]'{package}'[/red] package")
return

uninstall_package(package)
Expand Down Expand Up @@ -176,12 +176,12 @@ def update_package(package: str | PackageEntry):
dexi_project = parse_pyproject()

if "tool" not in dexi_project or "dexi" not in dexi_project["tool"]: # type: ignore
error("pyproject.toml contains invalid DexI data")
error("[red]pyproject.toml[/red] contains invalid [red]DexI data[/red]")

dexi_tool = dexi_project["tool"]["dexi"] # type: ignore

if "packages" not in dexi_tool: # type: ignore
error("pyproject.toml contains invalid DexI data")
error("[[red]pyproject.toml[/red] contains invalid [red]DexI data[/red]")

packages = dexi_tool["packages"] # type: ignore

Expand Down
6 changes: 3 additions & 3 deletions dexi/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ def invalid_project() -> None:
if os.path.isdir("ballsdex") and os.path.isfile("pyproject.toml"):
return

error("Attempted to use DexI command on an invalid project")
error("Attempted to use [red]DexI[/red] command on an [red]invalid project[/red]")

@staticmethod
def no_config_found() -> None:
if os.path.isfile("config.yml"):
return

error("No 'config.yml' file detected")
error("No [red]'config.yml'[/red] file detected")

@staticmethod
def invalid_version() -> None:
if parse_version(fetch_ballsdex_version()) >= parse_version(SUPPORTED_VERSION):
return

error(
"DexI does not support Ballsdex v$BD_V, please update to "
"DexI does not support [red]Ballsdex v$BD_V[/red], please update to "
f"v{SUPPORTED_VERSION}+"
)

Expand Down
7 changes: 3 additions & 4 deletions dexi/core/package.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from dataclasses import dataclass, field
from typing import Self

from .utils import error, fetch_pyproject, package_name

Check failure on line 4 in dexi/core/package.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (I001)

dexi/core/package.py:1:1: I001 Import block is un-sorted or un-formatted


@dataclass
class PackageConfig:
"""
Expand Down Expand Up @@ -44,19 +43,19 @@
def from_git(cls, package: str, branch: str) -> Self:
if package.count("/") != 1:
error(
"Invalid GitHub repository identifier entered; Expected <name/repository>"
"Invalid GitHub repository identifier entered; Expected [red]<name/repository>[/red]"

Check failure on line 46 in dexi/core/package.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

dexi/core/package.py:46:91: E501 Line too long (101 > 90)
)

data = fetch_pyproject(package, branch)

if not data or "tool" not in data or "dexi" not in data["tool"]:
error(f"Could not locate {package_name(package, branch)}")
error(f"Could not locate [red]{package_name(package, branch)}[/red]")

dexi_tool = data["tool"]["dexi"]
dexi_package = dexi_tool["package"]

if not dexi_tool.get("public", False):
error(f"Could not locate {package_name(package, branch)}")
error(f"Could not locate [red]{package_name(package, branch)}[/red]")

package_config = PackageConfig(
dexi_package["source"], dexi_package["target"], dexi_package.get("exclude")
Expand Down
Loading