-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from JenspederM/fix/init
skip initialization if config already exists
- Loading branch information
Showing
9 changed files
with
115 additions
and
59 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,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
CUR_PATH=$(pwd) | ||
VERSION=$(grep -m 1 version pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3) | ||
WHL=kedro_databricks-$VERSION-py3-none-any.whl | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: $0 <project_name>" | ||
exit 1 | ||
fi | ||
|
||
if test -d "$CUR_PATH/$1"; then | ||
echo "Directory $1 already exists. Removing it." | ||
rm -rf "$CUR_PATH/$1" | ||
fi | ||
|
||
# Build package | ||
rye build | ||
|
||
# Create a new project | ||
kedro new --starter=databricks-iris --name="$1" | ||
|
||
# Databricks needs Java | ||
echo "java openjdk-21" >> "$CUR_PATH/$1/.tool-versions" | ||
|
||
# Copy the package to the project directory | ||
cp "dist/$WHL" "$CUR_PATH/$1/$WHL" | ||
|
||
# Move to the project directory | ||
pushd "$CUR_PATH/$1" | ||
# Create a virtual environment | ||
python3 -m venv .venv | ||
# Activate the virtual environment | ||
source .venv/bin/activate | ||
# Install the project dependencies | ||
pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install $WHL | ||
code . | ||
popd |
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 +0,0 @@ | ||
LOGGING_NAME = "kedro_databricks" | ||
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 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 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 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 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
Oops, something went wrong.