-
Notifications
You must be signed in to change notification settings - Fork 43
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
Remove mount usage in tests #2766
Conversation
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.
✅
modal.Image.debian_slim() | ||
.add_local_python_source("pkg_a") # identical to first explicit mount and auto mounts | ||
.add_local_python_source( | ||
# custom ignore condition, include normally_not_included.pyc (but skip __pycache__) |
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.
I'm confused about how this example is including .pyc
files.
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.
Yeah sorry this was really stupid in hindsight - the test creates a .pyc
-file outside of the __pycache__
dir, but which is still ignored by default. In the second condition we only ignore the __pycache__
dir content and as such the .pyc
file is included 😬
test/image_test.py
Outdated
@@ -221,16 +221,10 @@ def test_image_kwargs_validation(builder_version, servicer, client): | |||
secrets=[ | |||
Secret.from_dict({"xyz": "123"}), | |||
Secret.from_name("foo"), | |||
Mount.from_local_dir("/", remote_path="/"), # type: ignore | |||
Dict.from_name("mydict"), # type: ignore | |||
], # Mount is not a valid Secret |
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.
Update comment too?
Replaces
Mount.from_local
usages in tests to not trigger deprecation warnings.Three different ways of removing:
Mount._from_local*
, to prevent regressions in themount=
-SDK surfaces until we fully deprecate these methods.notest
added to the fenceCheck these boxes or delete any item (or this section) if not relevant for this PR.
Note on protobuf: protobuf message changes in one place may have impact to
multiple entities (client, server, worker, database). See points above.
Changelog