Skip to content

Commit

Permalink
OOP removal (#129)
Browse files Browse the repository at this point in the history
* Removed all object oriented files and tests

Removed source files:
- abstractions.py
- filters.py
- objects.py
- juju.py

* Removed stale dependencies

- Includes fix to typehint in cloud.py
  • Loading branch information
LCVcode authored Dec 17, 2024
1 parent 58eb21c commit dfa2c42
Show file tree
Hide file tree
Showing 11 changed files with 668 additions and 2,442 deletions.
1,378 changes: 664 additions & 714 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ juju-jockey = "jockey.__main__:main"

[tool.poetry.dependencies]
python = ">=3.10,<3.13"
click = "^8.1.7"
fabric = "^3.2.2"
invoke = "^2.2.0"
orjson = "^3.10.7"
xdgenvpy = "^3.0.0"
python-slugify = "^8.0.4"
rich-argparse = "^1.5.2"
regex = "^2024.9.11"
dotty-dictionary = "^1.2.0"
xdgenvpy = "^3.0.0"
types-xdgenvpy = "^3.0.0.20240918"

[tool.poetry.group.dev.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/jockey/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
# Convert object abbreviations and reject malformed object names
try:
obj = convert_object_abbreviation(args.object)
assert obj, f"{args.object} is not a recognized Juju object."
logger.debug("Parsed object expression %r into %r", args.object, obj)
except ValueError:
except AssertionError:
logger.error("Unable to parse object expression: %r", args.object)
return 2 # usage error

# Get the function to query given object type
assert obj
action = RETRIEVAL_MAP.get(obj, None)
assert action, f"Querying object type {obj} is not yet supported."

Expand Down
221 changes: 0 additions & 221 deletions src/jockey/abstractions.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/jockey/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(
self,
host: Optional[str] = None,
doas: Optional[str] = None,
juju: str = "juju",
juju: Optional[str] = "juju",
cache: Optional[FileCache] = None,
timeout: Optional[int] = None,
*args,
Expand Down
Loading

0 comments on commit dfa2c42

Please sign in to comment.