-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to pyflyte init templating #1665
Conversation
Signed-off-by: zeryx <1892175+zeryx@users.noreply.github.com>
Signed-off-by: zeryx <1892175+zeryx@users.noreply.github.com>
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
Codecov Report
@@ Coverage Diff @@
## master #1665 +/- ##
==========================================
- Coverage 71.03% 70.89% -0.15%
==========================================
Files 336 336
Lines 30765 30746 -19
Branches 5573 2503 -3070
==========================================
- Hits 21853 21796 -57
- Misses 8367 8384 +17
- Partials 545 566 +21
|
Signed-off-by: zeryx <1892175+zeryx@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
We might think about using a brand new repo to hold the examples (instead of flytekit-python-template).
repo = Repo.clone_from(git_url, "temp_repo") | ||
|
||
# Checkout to the branch | ||
repo.git.checkout(branch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can pass the branch name directly in the call to Repo.clone_from
.
# Copy the files from the source directory to the destination directory | ||
shutil.copytree(src_path, dest_dir) | ||
|
||
# Remove the temporary cloned repo | ||
shutil.rmtree("temp_repo") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about we use a TemporaryDirectory
to hold the directory? This way we don't need to do this book-keeping and it also allows for this command to be run multiple times.
@@ -68,7 +68,6 @@ | |||
"docstring-parser>=0.9.0", | |||
"diskcache>=5.2.1", | |||
"cloudpickle>=2.0.0", | |||
"cookiecutter>=1.7.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
cc @eapolinario / @neverett do you think you want to check this one in? |
TL;DR
This PR removes the cookiecutter templating system for
pyflyte init
, and instead uses gitpython, without templating.This is part of a wider effort to replace our Dockerfile / docker_build.sh systems with the much simpler
ImageSpec
.This PR depends on flyteorg/flytekit-python-template#40
This is a breaking change
All templates are now imagespec based, and cookiecutter is no longer used to generate custom readme titles or directory names.
Type
Are all requirements met?
Complete description
As discussed as part of the larger Flyte example improvement with newly introduced imagespec.