Skip to content

Commit

Permalink
✨ enable running kedro boot commands from packaged project (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
takikadiri authored Nov 15, 2024
1 parent b9cd2d0 commit d18655a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
Expand Down Expand Up @@ -47,4 +47,4 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }} # token is not mandatory but make access more stable
file: ./coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: true
fail_ci_if_error: true
17 changes: 5 additions & 12 deletions kedro_boot/framework/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""A CLI factory for kedro boot apps"""
import click
import logging
from pathlib import Path
from .factory import kedro_boot_command_factory
from .utils import get_entry_points_commands, _is_project, _find_kedro_project
from .utils import get_entry_points_commands

LOGGER = logging.getLogger(__name__)

Expand All @@ -24,16 +23,10 @@
class KedroClickGroup(click.Group):
def reset_commands(self):
self.commands = {}

# add commands on the fly based on conditions
if _is_project(_find_kedro_project(Path.cwd()) or Path.cwd()):
self.add_command(run_command)
self.add_command(compile_command)
for entry_point_command in entry_points_commands:
self.add_command(entry_point_command)

# else:
# self.add_command(new) # TODO : IMPLEMENT THIS FUNCTION
self.add_command(run_command)
self.add_command(compile_command)
for entry_point_command in entry_points_commands:
self.add_command(entry_point_command)

def list_commands(self, ctx):
self.reset_commands()
Expand Down

0 comments on commit d18655a

Please sign in to comment.