Skip to content

Commit 0a44caa

Browse files
authored
feat: turn wildcards into name-only specs for better variant rendering (#33)
1 parent ee8db0e commit 0a44caa

7 files changed

+26
-21
lines changed

crates/pixi-build/src/bin/pixi-build-cmake/snapshots/pixi_build_cmake__cmake__tests__setting_host_and_build_requirements-2.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ build:
1212
script: "[ ... script ... ]"
1313
requirements:
1414
build:
15-
- boltons *
15+
- boltons
1616
- "... compiler ..."
1717
host:
18-
- hatchling *
19-
- cmake *
20-
- ninja *
18+
- hatchling
19+
- cmake
20+
- ninja
2121
run:
2222
- foobar ==3.2.1

crates/pixi-build/src/bin/pixi-build-cmake/snapshots/pixi_build_cmake__cmake__tests__setting_host_and_build_requirements.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ source: crates/pixi-build/src/bin/pixi-build-cmake/cmake.rs
33
expression: reqs
44
---
55
build:
6-
- boltons *
6+
- boltons
77
- "... compiler ..."
88
host:
9-
- hatchling *
10-
- cmake *
11-
- ninja *
9+
- hatchling
10+
- cmake
11+
- ninja
1212
run:
1313
- foobar ==3.2.1

crates/pixi-build/src/bin/pixi-build-python/snapshots/pixi_build_python__python__tests__noarch_none.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ build:
1414
script: "[ ... script ... ]"
1515
requirements:
1616
host:
17-
- pip *
18-
- python *
17+
- pip
18+
- python

crates/pixi-build/src/bin/pixi-build-python/snapshots/pixi_build_python__python__tests__noarch_python.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ build:
1515
noarch: python
1616
requirements:
1717
host:
18-
- pip *
19-
- python *
18+
- pip
19+
- python

crates/pixi-build/src/bin/pixi-build-python/snapshots/pixi_build_python__python__tests__setting_host_and_build_requirements-2.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ build:
1515
noarch: python
1616
requirements:
1717
build:
18-
- boltons *
18+
- boltons
1919
host:
20-
- hatchling *
21-
- pip *
22-
- python *
20+
- hatchling
21+
- pip
22+
- python
2323
run:
2424
- foobar >=3.2.1

crates/pixi-build/src/bin/pixi-build-python/snapshots/pixi_build_python__python__tests__setting_host_and_build_requirements.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ source: crates/pixi-build/src/bin/pixi-build-python/python.rs
33
expression: reqs
44
---
55
build:
6-
- boltons *
6+
- boltons
77
host:
8-
- hatchling *
9-
- pip *
10-
- python *
8+
- hatchling
9+
- pip
10+
- python
1111
run:
1212
- foobar >=3.2.1

crates/pixi-build/src/dependencies.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ impl<'a> MatchspecExtractor<'a> {
5555
let nameless_spec = binary
5656
.try_into_nameless_match_spec(self.channel_config)
5757
.into_diagnostic()?;
58-
MatchSpec::from_nameless(nameless_spec, Some(name))
58+
if nameless_spec.version == Some("*".parse().unwrap()) {
59+
// Skip dependencies with wildcard versions.
60+
name.as_normalized().to_string().parse().unwrap()
61+
} else {
62+
MatchSpec::from_nameless(nameless_spec, Some(name))
63+
}
5964
}
6065
};
6166

0 commit comments

Comments
 (0)