-
Notifications
You must be signed in to change notification settings - Fork 53
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
Set appropriate settings from a plugin context #1055
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for conda-store canceled.
|
✅ Deploy Preview for conda-store canceled.
|
98d7e88
to
a693995
Compare
conda-store-server/conda_store_server/_internal/plugins/lock/conda_lock/conda_lock.py
Outdated
Show resolved
Hide resolved
conda-store-server/conda_store_server/plugins/plugin_context.py
Outdated
Show resolved
Hide resolved
with open(lockfile_path, "w") as f: | ||
yaml.dump({"foo": "bar"}, f) |
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.
Do we even need to write to a file here?
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.
Good call out! Yes, we need to write a file because the last part of the lock_environment
function is to read the output lockfile and return the contents to the user. So if the file isn't there an error is thrown about the missing file, for example, FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpajob34th/conda-lock.yaml'
. For the purpose of this test, it could be an empty file.
I think it makes sense for this to be an error. But open to change if that seems overly strict to you.
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.
Actually, this is used in another test as well. I'll refactor some so we can reuse this in all the places it's required.
0a790d0
to
c8652f7
Compare
3eb042b
to
1f67a02
Compare
38b984d
to
e3c3dc0
Compare
d0bdd0c
to
f6f5ab3
Compare
Description
Follow up to #1044
In order for a plugin to get settings at the right level of specificity, they must have information about the running environment and namespace. This PR:
Pull request checklist