Skip to content
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

Move conda env export to conda export #13577

Merged
merged 20 commits into from
Feb 29, 2024

Conversation

beeankha
Copy link
Contributor

@beeankha beeankha commented Feb 8, 2024

Description

Related epic:

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?

@beeankha beeankha added the type::task indicates a change that doesn't pertain to the code itself, e.g. updating CI/CQ, rebuilding package label Feb 8, 2024
@beeankha beeankha self-assigned this Feb 8, 2024
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Feb 8, 2024
Copy link

codspeed-hq bot commented Feb 8, 2024

CodSpeed Performance Report

Merging #13577 will create unknown performance changes

Comparing beeankha:collapse-export-command (9bb6287) with main (b1751e6)

Summary

⚠️ No benchmarks were detected in both the base of the PR and the PR.

@beeankha beeankha mentioned this pull request Feb 8, 2024
17 tasks
conda/env/env.py Outdated Show resolved Hide resolved
@beeankha beeankha marked this pull request as ready for review February 14, 2024 20:03
@beeankha beeankha requested a review from a team as a code owner February 14, 2024 20:03
@beeankha beeankha changed the title [WIP] Convert conda env export to conda export command Convert conda env export to conda export command Feb 14, 2024
conda/cli/main_env_export.py Show resolved Hide resolved
conda/cli/main_export.py Outdated Show resolved Hide resolved
news/13577-conda-export-command Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a duplicate of the conda env export tests? can we combine them and parameterize the tests instead?

Copy link
Contributor Author

@beeankha beeankha Feb 23, 2024

Choose a reason for hiding this comment

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

It's been a little while since I touched this PR, but I'm pretty sure that the tests in tests/cli/test_main_export.py are not duplicates of the conda env export-related tests in tests/cli/test_env.py; eventually once conda env export is deprecated we can most likely move and update some of those related test_env.py tests into test_main_export.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After thinking about it a bit more, I think it would be best to move the conda env export-related tests from tests/cli/test_env.py into test_main_export.py; at the same time we could move some of the functions used in multiple tests (e.g. env_is_created) into a test fixtures file so that they can be used in multiple places. In order to keep things as simple as possible, I'll do this work in a separate PR.

beeankha and others added 2 commits February 22, 2024 10:27
@beeankha beeankha changed the title Convert conda env export to conda export command Alias conda env export to conda export command Feb 23, 2024
@@ -43,7 +43,7 @@ def configure_parser(sub_parsers: _SubParsersAction | None, **kwargs) -> Argumen
)
main_env_config.configure_parser(env_parsers)
main_env_create.configure_parser(env_parsers)
main_env_export.configure_parser(env_parsers)
main_export.configure_parser(env_parsers)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh! Yes! This is exactly what we want!

filename = args.file
# check for the proper file extension; otherwise when the export file is used later,
# the user will get a file parsing error
if not filename.endswith((".yml", ".yaml")):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use one of the yaml constants we already have defined? E.g.

YAML_EXTENSIONS = (".yml", ".yaml")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't aware of this constant, thanks for pointing it out!

travishathaway
travishathaway previously approved these changes Feb 27, 2024
conda/cli/main_export.py Outdated Show resolved Hide resolved
conda/cli/main_export.py Show resolved Hide resolved
conda/cli/main_env_export.py Outdated Show resolved Hide resolved
conda/cli/main_env_export.py Outdated Show resolved Hide resolved
@kenodegard kenodegard changed the title Alias conda env export to conda export command Move conda env export to conda export Feb 29, 2024
@kenodegard kenodegard merged commit 250fff7 into conda:main Feb 29, 2024
80 checks passed
@jezdez jezdez mentioned this pull request Mar 11, 2024
58 tasks
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 type::task indicates a change that doesn't pertain to the code itself, e.g. updating CI/CQ, rebuilding package
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants