Skip to content

Conversation

soapy1
Copy link
Contributor

@soapy1 soapy1 commented Jul 9, 2025

Description

#14684 added a check to ensure that conda create/update commands do not allow users to mix file types provided with the --file command.

This makes conda install consistent with the create and update commands.

For example:

$ conda install --file tests/env/support/explicit.txt --file tests/env/support/add-pip.yml                      

EnvironmentFileTypeMismatchError: Cannot mix environment file formats.

'tests/env/support/explicit.txt' is a explicit format file
'tests/env/support/add-pip.yml' is a environment.yml format file

Checklist - 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?

@github-project-automation github-project-automation bot moved this to 🆕 New in 🔎 Review Jul 9, 2025
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jul 9, 2025
soapy1 added 2 commits July 8, 2025 18:35
This makes it consistent with the create and update commands
@soapy1 soapy1 force-pushed the dont-allow-mixing-filetypes-install branch from c50db2b to 6a20840 Compare July 9, 2025 01:36
@soapy1 soapy1 marked this pull request as ready for review July 9, 2025 01:36
@soapy1 soapy1 requested a review from a team as a code owner July 9, 2025 01:36
Copy link

codspeed-hq bot commented Jul 9, 2025

CodSpeed Instrumentation Performance Report

Merging #14999 will not alter performance

Comparing soapy1:dont-allow-mixing-filetypes-install (b8e7969) with main (65ca75a)

Summary

✅ 21 untouched benchmarks

@@ -140,6 +141,9 @@ def execute(args: Namespace, parser: ArgumentParser) -> int:
file=sys.stderr,
)

# Validate that input files are of the same format type
validate_environment_files_consistency(args.file)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also do a small refactor to move this common validation into conda.cli.install.install.

@soapy1
Copy link
Contributor Author

soapy1 commented Jul 9, 2025

pre-commit.ci autofix

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Approved in 🔎 Review Jul 11, 2025
@kenodegard kenodegard merged commit f040c19 into conda:main Jul 11, 2025
75 checks passed
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants