-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: setup basic plugin with example
- Loading branch information
Showing
8 changed files
with
165 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
# create a test project under ./tmp which uses the kedro-dvc plugin as | ||
# "editable" install. | ||
# | ||
set -e | ||
|
||
name=$1 | ||
from_branch=${2:-sample-project-basic} | ||
|
||
if [[ "$name" == "" ]] ; then | ||
echo "usage: setup-sample-project.sh <name> [from-branch]" | ||
exit 1 | ||
fi | ||
echo "creating sample project $name from branch $from_branch" | ||
|
||
mkdir -p tmp | ||
cd tmp | ||
mkdir $name | ||
cd $name | ||
git clone git@github.com:FactFiber/kedro-dvc.git -b $from_branch . | ||
python3.8 -m venv env/$name | ||
source env/$name/bin/activate | ||
pip install --upgrade pip # ensure pip version >22 | ||
pip install -r src/requirements.txt | ||
hash -r # ensure shell notes local version of kedro | ||
kedro --help | ||
# we should see kedro-dvc commands listed | ||
echo "to use the sample project run "\""source env/$name"\""" |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
__version__ = "0.2.0" | ||
|
||
import click | ||
from kedro.framework.session import KedroSession | ||
|
||
|
||
@click.group(name="JSON") | ||
def commands(): | ||
"""Kedro plugin for printing the pipeline in JSON format""" | ||
pass | ||
|
||
|
||
@commands.command() | ||
@click.pass_obj | ||
def to_json(metadata): | ||
"""Display the pipeline in JSON format""" | ||
session = KedroSession.create(metadata.package_name) | ||
context = session.load_context() | ||
print(context.pipeline.to_json()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import click | ||
|
||
# from kedro.framework.session import KedroSession | ||
|
||
|
||
@click.group(name="dvc") | ||
def dvc(): | ||
"""Kedro-DVC integration.""" | ||
pass | ||
|
||
|
||
@dvc.command() | ||
@click.pass_obj | ||
def hello(metadata): | ||
"""Display the pipeline in JSON format""" | ||
# session = KedroSession.create(metadata.package_name) | ||
# context = session.load_context() | ||
# print(context.pipeline.to_json()) | ||
print("HELLO", metadata) |