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

rattler-build build panics when test.python.python_version match spec is invalid #1493

Open
Tracked by #2308
travishathaway opened this issue Mar 15, 2025 · 0 comments

Comments

@travishathaway
Copy link

travishathaway commented Mar 15, 2025

What happened?

While trying to build a rattler-build recipe, I received the following error:

thread 'main' panicked at src/package_test/run_test.rs:511:26:
called `Result::unwrap()` on an `Err` value: InvalidVersionAndBuild("==.*")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This was due to an invalid match spec in the testing section of my recipe. Here's what that looked like:

tests:
  - python:
      imports:
        - my_package
      python_version: ["${{ python_min ~ '.*' }}", "3.12.*"]

The python_version section was generating an invalid match spec.

How to recreate

First, create this recipe (recipe.yaml):

package:
  name: test
  version: 0.1.0

build:
  script:
    - echo "test" > test.txt

requirements:
  build:
    - python

tests:
  - python:
      imports:
        - time
      python_version: "=.*"

Then try to build it:

rattler-build build 

It should spit out the panic error.

What should be done?

I think it would be nice to trigger a better looking error than just having the program panic. Maybe something that could try to hint at which line of the recipe.yaml that should be changed?

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

No branches or pull requests

2 participants