-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Environment Spec plugins should return an Environment model #14937
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
Conversation
CodSpeed Instrumentation Performance ReportMerging #14937 will not alter performanceComparing Summary
|
f602df7
to
29074b5
Compare
Could we start this up again, now that #14820 is merged? #14886 could really need a way to convert the legacy environment classes to the new models, see _create_environment_from_prefix here |
Absolutely! Will whip it up in just a bit |
29074b5
to
7808343
Compare
@@ -56,18 +57,18 @@ def _solve( | |||
|
|||
def dry_run( | |||
specs: list[str], args: Namespace, env: Environment, *_, **kwargs | |||
) -> Environment: | |||
) -> EnvironmentYaml: |
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.
We want to continue to return the conda.env.env.Environment
here so that we aren't changing the installer api. Eventually this should move over to use the new Environment model. But I think it's better to chunk that in another piece of work to keep this change focused on the env spec api.
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 can't parse this statement
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 think it would be ok to make these changes here to make sure we have covered all the API changes and nothing lingers.
CodSpeed WallTime Performance ReportMerging #14937 will not alter performanceComparing Summary
|
167fc08
to
9776b39
Compare
@@ -1,108 +0,0 @@ | |||
# Copyright (C) 2012 Anaconda, Inc |
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.
We don't want to support an explicit environment.yaml anymore. The conda.env.env.Environment
class should just represent the conda environment.yaml format.
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.
Wait, what's "an explicit environment.yaml"? @EXPLICIT
input files are defined in CEP 23, we can't not support them
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.
TL;DR
- To clarify, this PR is still supporting explicit input files.
conda.env.env.Environment
should only be representingenvironment.yaml
files.
Previously, this was implemented by making conda.env.env.Environment
support reading these files (that was in #14820). That was an ok approach at that time since env spec plugins were meant to be returning conda.env.env.Environment
.
However, now we want env spec plugins to return conda.models.environment.Environment
. So, I think we should back out the changes to conda.env.env.Environment
that allow it to represent an explicit environment and restore it to it's original purpose which is to represent an environment.yaml
file. And ExplicitSpecPlugin
should create a conda.models.environment.Environment
.
@@ -1,102 +0,0 @@ | |||
# Copyright (C) 2012 Anaconda, Inc |
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.
These tests are duplicates of the ones in tests/env/specs/test_explicit.py
@@ -4,9 +4,12 @@ | |||
|
|||
import pytest | |||
|
|||
from conda.env.env import Environment |
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.
Maybe this whole file can be deleted?
pre-commit.ci autofix |
11c65cd
to
1916f6e
Compare
1916f6e
to
971a044
Compare
971a044
to
6faf13e
Compare
conda/cli/main_env_update.py
Outdated
if len(env.requested_packages) > 0: | ||
installers["conda"] = get_installer("conda") | ||
|
||
for installer_type in env.external_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.
Why do we only get and set the conda installer if there are requested packages? This makes me wonder why we have a separation between requested and external 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.
requested
packages are only for conda
packages. external
are everything else (PyPI and whatever ecosystem we end up adding).
for more information, see https://pre-commit.ci
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
for more information, see https://pre-commit.ci
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
for more information, see https://pre-commit.ci
ef7ed2a
to
95f62f8
Compare
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
Description
This PR updates the
EnvironmentSpecBase
interface to return amodel.Environment
(environment model) instead of anenv.env.Environment
(environment.yml model). Theenv.env.Environment
does not fully describe a conda environment. On the other hand,model.Environment
can fully describe an environment. So, this type makes more sense to be the return type for env spec plugins. For more information on the Environment model see https://docs.google.com/document/d/1Q_M66kFGCYLuaqAqez_jlsqxnQEQh5tSUBtvEz3ixdA/edit?tab=t.gmwr9pinfepw.This PR also updates
conda env
commands and env installers to use the new Environment model.This is a refactor PR, there should be no changes in conda's behaviour.
fixes conda/conda-planning#62
depends on #14820
Checklist - did you ...
news
directory (using the template) for the next release's release notes?