Skip to content

Conversation

@tdejager
Copy link
Contributor

@tdejager tdejager commented Nov 19, 2025

Description

This allows for passing of relative parts to exec. As an example:

From this PR

# replace with your platform
cargo r exec -s "./tests/data/channels/channels/non_self_expose_channel_2/osx-arm64/jupyter-core-0.2.0-h60d57d3_0.conda" python

Python 3.13.5 | packaged by conda-forge | (main, Jun 16 2025, 08:24:05) [Clang 18.1.8 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

This useful for testing out local conda files you have just build using pixi build, this was already possible with absolute paths.

The question is how to solve this, doing this in rattler would require accesing the pwd while parsing, which is not ideal. I opted to go for a typed data-structure here. I'm keeping it in draft until we are sure this makes sense. I think the downside of this approach is that it adds a lot of code, we can also add a clap parser, but that does not make this explicitly in the type.

Fixes: #4867 (by adding relevant tests)

How Has This Been Tested?

Manually, and a number of tests have been added.

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

I made the initial idea and codex worked it out for me.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@tdejager tdejager requested a review from baszalmstra November 19, 2025 08:23
@tdejager tdejager marked this pull request as draft November 19, 2025 08:23
assert!(looks_like_path("file.tar.bz2"));
assert!(looks_like_path("file.conda"));
assert!(!looks_like_path("python>=3.12"));
assert!(!looks_like_path("conda-forge::python"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

might be good to add more cases here if we know m?

Copy link
Contributor Author

@tdejager tdejager left a comment

Choose a reason for hiding this comment

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

An additional comment.

Copy link
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

This looks really good to me!

@tdejager tdejager marked this pull request as ready for review November 19, 2025 13:21
@lucascolley lucascolley changed the title feat: exec can accept relative paths. feat(exec): accept relative paths Nov 19, 2025
@lucascolley lucascolley added enhancement New features area:exec Related to pixi exec labels Nov 19, 2025
@baszalmstra baszalmstra enabled auto-merge (squash) November 20, 2025 14:52
@baszalmstra baszalmstra disabled auto-merge November 20, 2025 21:56
@baszalmstra baszalmstra merged commit 0d8b2c2 into prefix-dev:main Nov 20, 2025
72 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:exec Related to pixi exec enhancement New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(exec): integration tests for pixi exec

3 participants