-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Refactor cli layer: use the plugin system to read input files #14911
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
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Instrumentation Performance ReportMerging #14911 will not alter performanceComparing Summary
|
d92112f
to
bef3efd
Compare
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.
Loving how this is starting to look!
b47ebdc
to
5560011
Compare
pre-commit.ci autofix |
9cc8285
to
978b726
Compare
a334eca
to
72cb8f6
Compare
37a8173
to
971526d
Compare
names = {MatchSpec(pkg).name for pkg in specs} | ||
for pkg in context.create_default_packages: | ||
pkg_name = MatchSpec(pkg).name | ||
if pkg_name not in names: | ||
specs.append(pkg) |
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.
Per the type annotation specs
may not necessarily be a list
So what if we do this instead (since the ultimate goal is to add missing default packages):
names = {MatchSpec(pkg).name for pkg in specs} | |
for pkg in context.create_default_packages: | |
pkg_name = MatchSpec(pkg).name | |
if pkg_name not in names: | |
specs.append(pkg) | |
# include default packages but override with specs of the same name | |
specs = { | |
MatchSpec(pkg).name: pkg | |
for pkg in (*context.create_default_packages, *specs) | |
}.values() |
8ac31ec
to
2fc85f9
Compare
pre-commit.ci autofix |
This PR is getting a little bit confusing to manage with the refactor to use the environment model + the reconciling of the
|
02ed39a
to
2fc85f9
Compare
…he EnvironmentConfig
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
…t being compatible
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Validate that specifications and conda package filenames are not both specified in install/update/create commands before creating an Environment object. This is consistent with the behaviour of the currently released conda.
for more information, see https://pre-commit.ci
2fc85f9
to
0ca78d8
Compare
Description
This PR refactors the CLI layer to:
model.environment.Environment
objectEnvironment
This refactor is a big change to how conda's cli layer. In order to ensure that we are not changing functionality in unexpected ways. I've outlined all the ways conda package installing related commands work, including noting some bugs (this includes
conda install
,conda env create
,conda remove
, etc.).Some important changes in this PR:
conda install/update
commands can now read environment.yaml files: Previsouly, onlyconda env
commands could read environment.yaml files. This PR introduces using the plugin system to detect the type of the provided--file
source. So, any plugin installed can be used.Things not included in this PR (can be included in follow up PRs):
handle_txn
to execute the installing transactionChecklist - did you ...
Add a file to the
news
directory (using the template) for the next release's release notes?Add / update necessary tests?
Add / update outdated documentation?
addresses:
conda.cli.install
cleanup (technical details) conda-planning#37conda create --file
andconda env create -f
backends conda-planning#15 and Reconcileconda env create
andconda create
input file handling conda-planning#64fixes Use new
Environment
dataclass to refactorconda.cli.install
sources conda-planning#63