-
Notifications
You must be signed in to change notification settings - Fork 49
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
API for customizing the conda base environment. #38
base: main
Are you sure you want to change the base?
API for customizing the conda base environment. #38
Conversation
We need to rebase / merge the contents of |
f45dd8f
to
23d2104
Compare
23d2104
to
a9d8597
Compare
condacolab.py
Outdated
from IPython.display import display | ||
|
||
from IPython import get_ipython | ||
|
||
try: | ||
from ruamel.yaml import YAML | ||
from ruamel.yaml.comments import CommentedMap | ||
except ImportError as e: | ||
raise RuntimeError("Could not find ruamel.yaml, plese install using `!pip install ruamel.yaml`!") from e | ||
|
||
try: | ||
import ipywidgets as widgets |
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.
Two things:
- Sort dependencies and separate stdlib from 3rd party
- Add 3rd party packages to
pyproject.toml
dependencies to ensure everything is available in case Google changes the bundled packages.
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.
Did it here: #41! :)
Also, make sure we don't overwrite the original |
condacolab.py
Outdated
yaml.dump(env_details, f) | ||
|
||
_run_subprocess( | ||
[f"{prefix}/bin/python", "-m", "conda_env", "update", "-n", "base", "-f", environment_file_path, *extra_conda_args], |
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.
Let's pass conda_exe
from the calling function to this one so we can use mamba
if available. That should reduce solver times.
[f"{prefix}/bin/python", "-m", "conda_env", "update", "-n", "base", "-f", environment_file_path, *extra_conda_args], | |
[conda_exe, "env", "update", "-n", "base", "-f", environment_file_path, *extra_conda_args], |
Hi, just stumbled on the nice blog post by @ssurbhi560 and came looking for the new features :) |
@@ -297,6 +297,8 @@ def install_from_url( | |||
"pip_task.log" | |||
) | |||
|
|||
print("📦 Updating enviornment using YAML 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.
print("📦 Updating environment using YAML file...")
Description
In this PR, we provide an API for users to customize the conda base environment during the condacolab's installation. Users will have the following options to specify:
environment_file
- This can be a URL or path to an environment.yaml file.specs
- This is a list of additional specifications (packages) to install.python_version
- Python version to use in the conda base environment, eg. "3.9".channels
- Comma-separated list of channels to use in the conda base environment.pip_args
- List of additional packages to be installed using pipextra_conda_args
- This is a list of any extra conda arguments used during the installation.You can check this example notebook demonstrating the new feature here.
Status