-
Notifications
You must be signed in to change notification settings - Fork 301
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
Add poetry to image spec #3025
base: master
Are you sure you want to change the base?
Add poetry to image spec #3025
Conversation
Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Code Review Agent Run #73368bActionable Suggestions - 5
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
run_mock = Mock() | ||
monkeypatch.setattr("flytekit.image_spec.default_builder.run", run_mock) | ||
|
||
uv_lock_file = tmp_path / "uv.lock" | ||
uv_lock_file.write_text("this is a lock file") | ||
lock_file = tmp_path / lock_file |
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.
The variable name lock_file
is being redefined in the function scope, shadowing the parameter with the same name. This could lead to confusion and potential bugs.
Code suggestion
Check the AI-generated fix before applying
lock_file = tmp_path / lock_file | |
lock_file_path = tmp_path / lock_file |
Code Review Run #73368b
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
builder.build_image(image_spec) | ||
|
||
|
||
@pytest.mark.parametrize("lock_file", ["uv.lock", "poetry.lock"]) |
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.
Consider consolidating the duplicate @pytest.mark.parametrize
decorator with the one at line 254 since both test functions use the same parameters.
Code suggestion
Check the AI-generated fix before applying
@@ -254,7 +254,6 @@
@pytest.mark.parametrize("lock_file", ["uv.lock", "poetry.lock"])
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_lock_errors_no_pyproject_toml(monkeypatch, tmp_path, lock_file):
@@ -274,7 +274,6 @@
-@pytest.mark.parametrize("lock_file", ["uv.lock", "poetry.lock"])
@pytest.mark.filterwarnings("ignore::UserWarning")
def test_uv_lock_error_no_packages(monkeypatch, tmp_path, lock_file):
Code Review Run #73368b
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Code Review Agent Run #edb466Actionable Suggestions - 0Review Details
|
Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Code Review Agent Run #9afb0fActionable Suggestions - 0Additional Suggestions - 7
Review Details
|
Tracking issue
Related to flyteorg/flyte#6119
Why are the changes needed?
This allows poetry uses to create a image spec with their dependencies. This PR treats poetry as a "dependency manager". This means that their local project will not be installed. If we see that poetry users want to install their local package, then we can extend this feature with a follow up PR.
What changes were proposed in this pull request?
This PR adds a
requirements="poetry.lock"
that creates anImageSpec
with poetry.How was this patch tested?
I created a repo with
poetry init
with this workflow:and ran
pyflyte run --remote workflows/main.py
.Summary by Bito
This PR implements Poetry support in ImageSpec with lock file handling capabilities and Docker build integration. It enhances array node capabilities with ReferenceTask support and improves file handling for remote access. The implementation includes comprehensive error handling across components, particularly in file operations and logging systems. Changes include expanded testing infrastructure with improved variable naming and VSCode integration enhancements.Unit tests added: True
Estimated effort to review (1-5, lower is better): 5