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

prototype: --name to direct to a project from anywhere #2401

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ruben-arts
Copy link
Contributor

Prototyped this to align more with conda like tools.

~ via 🐍 v3.11.10 via πŸ¦€ v1.80.0 
❯ pixi init registered_project --register
βœ” Created /home/rarts/registered_project/pixi.toml
βœ” Registered project 'registered_project' to be used from anywhere by name.

~ via 🐍 v3.11.10 via πŸ¦€ v1.80.0 
❯ pixi add python --name registered_project
βœ” Added python >=3.13.0,<3.14

~ via 🐍 v3.11.10 via πŸ¦€ v1.80.0 
❯ pixi run --name registered_project "echo \$PIXI_PROJECT_MANIFEST"
/home/rarts/registered_project/pixi.toml

~ via 🐍 v3.11.10 via πŸ¦€ v1.80.0 
❯ pixi shell --name registered_project

~ via 🐍 v3.13.0 via πŸ¦€ v1.80.0 via πŸ…’ registered_project 
❯ 

Let me know what you think of this.

@synapticarbors
Copy link
Contributor

As you might imagine, I'm super excited about this. I played with it a little bit and had some initial feedback:

  • I didn't see it in the current draft, but one useful thing to have would be a way to list all registered projects along with maybe where in the filesystem they reside.

  • It looks like there isn't any protection against registering projects with the same name in different locations. It just overwrites the former without any warning:

❯ ~/Projects/github/pixi/target/release/pixi init foo --register
βœ” Created /Users/xyz/opt/pixienvs/foo/pixi.toml
βœ” Registered project 'foo' to be used from anywhere by name.
❯ cd ~/Desktop
❯ ~/Projects/github/pixi/target/release/pixi init foo --register
βœ” Created /Users/xyz/Desktop/foo/pixi.toml
βœ” Registered project 'foo' to be used from anywhere by name.
❯ bat ~/.pixi/config.toml
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       β”‚ File: /Users/xyz/.pixi/config.toml
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   β”‚ detached-environments = false
   2   β”‚
   3   β”‚ [registered-projects]
   4   β”‚ foo = "/Users/xyz/Desktop/foo/pixi.toml"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants