-
Notifications
You must be signed in to change notification settings - Fork 215
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
feat: add import yml flag #792
feat: add import yml flag #792
Conversation
What does the usage look like? Maybe we can already add a little bit to the docs? :) Awesome feature! |
$ pixi init -i /path/to/environment.yml |
Co-authored-by: Bas Zalmstra <zalmstra.bas@gmail.com>
src/cli/init.rs
Outdated
@@ -131,6 +225,18 @@ pub async fn execute(args: Args) -> miette::Result<()> { | |||
); | |||
} | |||
|
|||
if args.env_file.is_some() { | |||
// Install prefix if coming from an environment file | |||
let project = Project::load_or_else_discover(Some(&dir.join(consts::PROJECT_MANIFEST)))?; |
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.
This seems strange to me. We just created the project above!
Use this feature to benchmark : Benchmark 1: pixi init -i environment-dev-extra.yml Time (mean ± σ): 1.686 s ± 0.022 s [User: 3.009 s, System: 3.709 s] Range (min … max): 1.662 s … 1.736 s 10 runs Benchmark 2: micromamba create --file environment-dev-extra.yml -p ./.env --yes Time (mean ± σ): 5.688 s ± 0.137 s [User: 11.266 s, System: 1.676 s] Range (min … max): 5.485 s … 5.885 s 10 runs Benchmark 3: conda env create -f environment-dev-extra.yml -p ./.env Time (mean ± σ): 46.115 s ± 5.999 s [User: 43.808 s, System: 1.861 s] Range (min … max): 39.113 s … 59.391 s 10 runs Summary pixi init -i environment-dev-extra.yml ran 3.37 ± 0.09 times faster than micromamba create --file environment-dev-extra.yml -p ./.env --yes 27.35 ± 3.58 times faster than conda env create -f environment-dev-extra.yml -p ./.env
|
Nice! And thats including generating a lock-file! Did you have warm or cold caches? |
This was the command including the warmup command, so the caches are blazingly hot. That includes generating the environment( and lock for pixi). Pixi also does the translation from |
That was with Benchmark 1: pixi init -i environment-dev-extra.yml Time (mean ± σ): 1.747 s ± 0.046 s [User: 3.033 s, System: 3.713 s] Range (min … max): 1.670 s … 1.787 s 5 runs Benchmark 2: micromamba create --file environment-dev-extra.yml -p ./.env --yes Time (mean ± σ): 6.516 s ± 0.338 s [User: 12.660 s, System: 1.949 s] Range (min … max): 6.198 s … 6.900 s 5 runs Benchmark 3: conda env create -f environment-dev-extra.yml -p ./.env Time (mean ± σ): 17.895 s ± 0.212 s [User: 16.057 s, System: 1.725 s] Range (min … max): 17.743 s … 18.266 s 5 runs Summary pixi init -i environment-dev-extra.yml ran 3.73 ± 0.22 times faster than micromamba create --file environment-dev-extra.yml -p ./.env --yes 10.24 ± 0.30 times faster than conda env create -f environment-dev-extra.yml -p ./.env Command:
Versions:
|
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 good to crawl github a little for environment.yml files and seeing if we can actually import them.
Adds the functionality to import
environment.yml
duringpixi init
.Closes #131