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

feat: Support manifest path to project directory #94

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

blmaier
Copy link
Contributor

@blmaier blmaier commented Feb 10, 2025

Allow pixi-pack pack <manifest-path> to accept a path to a project directory. This ports the same feature added to upstream Pixi here prefix-dev/pixi#2716.

This also adds an additional check if the manifest path is invalid and display an error.

Fixes: #93

Motivation

This makes pixi-pack align with how pixi --manifest-path works.
This fixes the bug in #93 where if a directory is used for pixi-pack pack <directory>, pixi pack doesn't handle it correctly and searches the directory's parent for the pixi.lock

Allow `pixi-pack pack <manifest-path>` to accept a path to a project
directory. This ports the same feature added to upstream Pixi here
prefix-dev/pixi#2716.

This also adds an additional check if the manifest path is invalid and
display an error.

Fixes: Quantco#93

Signed-off-by: Brandon Maier <brandon.maier@gmail.com>
@blmaier blmaier force-pushed the pixi-manifest-path-dir branch from 354b64e to 30c9791 Compare February 10, 2025 14:26
Copy link
Member

@pavelzw pavelzw left a comment

Choose a reason for hiding this comment

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

looks good, thanks!

Copy link
Member

@delsner delsner left a comment

Choose a reason for hiding this comment

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

Thanks, could you add a test please?

@blmaier
Copy link
Contributor Author

blmaier commented Feb 11, 2025

I added an integration test, and that test is passing. However now a different macos started failing. It's not clear to me why, as it passed the previous run and it doesn't appear to be related to my changes 😕

@delsner
Copy link
Member

delsner commented Feb 11, 2025

Can you please try to add the following @blmaier? I can't push to your branch.

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 29e2eb7..9ed4e7e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -45,6 +45,7 @@ jobs:
       - name: Set up pixi
         uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 # v0.8.1
         with:
+          pixi-version: v0.41.1
           activate-environment: true
       - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
         with:

@pavelzw
Copy link
Member

pavelzw commented Feb 11, 2025

this is not necessary as 0.41.2 just got pulled because of prefix-dev/pixi#3112

rerunning ci works ✅

@pavelzw
Copy link
Member

pavelzw commented Feb 11, 2025

for future reference:

the following error with pixi 0.41.2 on macos

running 22 tests
test test_compatibility::case_1 ... FAILED
test test_includes_repodata_patches ... ok
test test_compatibility::case_2 ... ok
test test_inject_failure ... ok
test test_custom_env_name ... ok
test test_line_endings::case_2 ... ok
test test_manifest_path_dir ... ok
test test_no_timestamp ... ok
test test_line_endings::case_1 ... ok
test test_non_authenticated ... ok
test test_pypi_ignore::case_2 ... ok
test test_pypi_ignore::case_1 ... ok
test test_inject::case_1 ... ok
test test_inject::case_2 ... ok
test test_reproducible_shasum::case_2 ... ok
test test_reproducible_shasum::case_3 ... ok
test test_reproducible_shasum::case_1 ... ok
test test_reproducible_shasum::case_4 ... ok
test test_reproducible_shasum::case_5 ... ok
test test_reproducible_shasum::case_6 ... ok
test test_simple_python ... ok
test test_run_packed_executable ... ok

failures:

---- test_compatibility::case_1 stdout ----
⏳ Downloading 16 packages...
📦 Created pack at /var/folders/p7/1p9qsdl52bx6w96_t800g_lc0000gn/T/.tmpzWS8jd/environment.tar with size 21.86 MiB.
thread 'test_compatibility::case_1' panicked at tests/integration_test.rs:283:10:
Failed to run create command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_compatibility::case_1

test result: FAILED. 21 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 65.58s

error: test failed, to rerun pass `--test integration_test`

@delsner delsner merged commit b341cc2 into Quantco:main Feb 11, 2025
16 checks passed
@pavelzw
Copy link
Member

pavelzw commented Feb 11, 2025

thanks @blmaier! we'll release this once we implemented #91

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.

Running pixi-pack from nested pixi projects doesn't work
3 participants