Skip to content

Commit c46f283

Browse files
committed
Use single recipe.yaml duplicated across directories
1 parent 456503b commit c46f283

File tree

12 files changed

+57
-130
lines changed

12 files changed

+57
-130
lines changed

Tools/pixi-packages/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ Each package definition is contained in a subdirectory, but they share the build
2020
`build.sh` in this directory. Currently defined package variants:
2121

2222
- `default`
23-
- `free-threading`
23+
- `freethreading`
2424
- `asan`: ASan-instrumented build
25-
- `tsan-free-threading`: TSan-instrumented free-threading build
25+
- `tsan_freethreading`: TSan-instrumented free-threading build
2626

2727
## Maintenance
2828

29-
- Keep the `version` fields in each `recipe.yaml` up to date with the Python version
30-
- Keep the dependency requirements up to date in each `recipe.yaml`
29+
- Keep the `abi_tag` and `version` fields in each `pixi.toml` up to date with the Python version
30+
- If you update one `recipe.yaml` file, update all
3131
- Update `build.sh` for any breaking changes in the `configure` and `make` workflow
3232

3333
## Opportunities for future improvement

Tools/pixi-packages/asan/pixi.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ channels = ["https://prefix.dev/conda-forge"]
33
platforms = ["osx-arm64", "linux-64"]
44
preview = ["pixi-build"]
55

6+
[workspace.build-variants]
7+
variant = ["asan"]
8+
abi_tag = ["cp315"]
9+
version = ["3.15"]
10+
611
[package.build.backend]
712
name = "pixi-build-rattler-build"
813
version = "*"

Tools/pixi-packages/asan/recipe.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
context:
22
# Keep up to date
33
version: "3.15"
4-
variant: "asan"
5-
freethreading_tag: ${{ "t" if "free-threading" in variant else "" }}
6-
abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }}
4+
variant: ${{ variant }}
5+
freethreading_tag: ${{ "t" if "freethreading" in variant else "" }}
6+
abi_tag: ${{ abi_tag }}
77

88
recipe:
99
name: python
@@ -16,16 +16,16 @@ outputs:
1616
name: python_abi
1717
version: ${{ version }}
1818
build:
19-
string: "0_cp315"
19+
string: "0_${{ variant }}_${{ abi_tag }}"
2020
requirements:
2121
run_constraints:
22-
- python ${{ version }}.* *_cp315
22+
- python ${{ version }}.* *_${{ variant }}_${{ abi_tag }}
2323

2424
- package:
2525
name: python
2626
version: ${{ version }}
2727
build:
28-
string: "0_cp315"
28+
string: "0_${{ variant }}_${{ abi_tag }}"
2929
files:
3030
exclude:
3131
- "*.o"
@@ -80,7 +80,7 @@ outputs:
8080
noarch:
8181
- python
8282
weak:
83-
- python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }}
83+
- python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }}
8484

8585
about:
8686
homepage: https://www.python.org/

Tools/pixi-packages/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
if [[ "${PYTHON_VARIANT}" == "free-threading" ]]; then
3+
if [[ "${PYTHON_VARIANT}" == "freethreading" ]]; then
44
echo "BUILD TYPE: FREE-THREADING"
55
BUILD_DIR="../build_free_threading"
66
CONFIGURE_EXTRA="--disable-gil"
@@ -9,7 +9,7 @@ elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then
99
BUILD_DIR="../build_asan"
1010
CONFIGURE_EXTRA="--with-address-sanitizer"
1111
export ASAN_OPTIONS="strict_init_order=true"
12-
elif [[ "${PYTHON_VARIANT}" == "tsan-free-threading" ]]; then
12+
elif [[ "${PYTHON_VARIANT}" == "tsan_freethreading" ]]; then
1313
echo "BUILD TYPE: TSAN FREE-THREADING"
1414
BUILD_DIR="../build_tsan_free_threading"
1515
CONFIGURE_EXTRA="--disable-gil --with-thread-sanitizer"

Tools/pixi-packages/default/pixi.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ channels = ["https://prefix.dev/conda-forge"]
33
platforms = ["osx-arm64", "linux-64"]
44
preview = ["pixi-build"]
55

6+
[workspace.build-variants]
7+
variant = ["default"]
8+
abi_tag = ["cp315"]
9+
version = ["3.15"]
10+
611
[package.build.backend]
712
name = "pixi-build-rattler-build"
813
version = "*"

Tools/pixi-packages/default/recipe.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
context:
22
# Keep up to date
3-
version: "3.15"
4-
variant: "default"
5-
freethreading_tag: ${{ "t" if "free-threading" in variant else "" }}
6-
abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }}
3+
version: ${{ version }}
4+
variant: ${{ variant }}
5+
freethreading_tag: ${{ "t" if "freethreading" in variant else "" }}
6+
abi_tag: ${{ abi_tag }}
77

88
recipe:
99
name: python
@@ -16,16 +16,16 @@ outputs:
1616
name: python_abi
1717
version: ${{ version }}
1818
build:
19-
string: "0_cp315"
19+
string: "0_${{ variant }}_${{ abi_tag }}"
2020
requirements:
2121
run_constraints:
22-
- python ${{ version }}.* *_cp315
22+
- python ${{ version }}.* *_${{ variant }}_${{ abi_tag }}
2323

2424
- package:
2525
name: python
2626
version: ${{ version }}
2727
build:
28-
string: "0_cp315"
28+
string: "0_${{ variant }}_${{ abi_tag }}"
2929
files:
3030
exclude:
3131
- "*.o"
@@ -80,7 +80,7 @@ outputs:
8080
noarch:
8181
- python
8282
weak:
83-
- python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }}
83+
- python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }}
8484

8585
about:
8686
homepage: https://www.python.org/

Tools/pixi-packages/free-threading/pixi.toml renamed to Tools/pixi-packages/freethreading/pixi.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ channels = ["https://prefix.dev/conda-forge"]
33
platforms = ["osx-arm64", "linux-64"]
44
preview = ["pixi-build"]
55

6+
[workspace.build-variants]
7+
variant = ["freethreading"]
8+
abi_tag = ["cp315t"]
9+
version = ["3.15"]
10+
611
[package.build.backend]
712
name = "pixi-build-rattler-build"
813
version = "*"

Tools/pixi-packages/free-threading/recipe.yaml renamed to Tools/pixi-packages/freethreading/recipe.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
context:
22
# Keep up to date
33
version: "3.15"
4-
variant: "free-threading"
5-
freethreading_tag: ${{ "t" if "free-threading" in variant else "" }}
6-
abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }}
4+
variant: ${{ variant }}
5+
freethreading_tag: ${{ "t" if "freethreading" in variant else "" }}
6+
abi_tag: ${{ abi_tag }}
77

88
recipe:
99
name: python
@@ -16,16 +16,16 @@ outputs:
1616
name: python_abi
1717
version: ${{ version }}
1818
build:
19-
string: "0_cp315t"
19+
string: "0_${{ variant }}_${{ abi_tag }}"
2020
requirements:
2121
run_constraints:
22-
- python ${{ version }}.* *_cp315t
22+
- python ${{ version }}.* *_${{ variant }}_${{ abi_tag }}
2323

2424
- package:
2525
name: python
2626
version: ${{ version }}
2727
build:
28-
string: "0_cp315t"
28+
string: "0_${{ variant }}_${{ abi_tag }}"
2929
files:
3030
exclude:
3131
- "*.o"
@@ -80,7 +80,7 @@ outputs:
8080
noarch:
8181
- python
8282
weak:
83-
- python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }}
83+
- python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }}
8484

8585
about:
8686
homepage: https://www.python.org/

Tools/pixi-packages/generate.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
# Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/4599
44

5-
for name in default asan free-threading tsan-free-threading; do
6-
if [[ "${name}" == *free-threading* ]]; then
7-
tag="cp315t"
8-
else
9-
tag="cp315"
10-
fi
11-
sed -e 's/variant: "default"/variant: "'${name}'"/g' -e 's/${{ abi_tag }}/'${tag}'/g' Tools/pixi-packages/recipe.yaml > Tools/pixi-packages/${name}/recipe.yaml
5+
for name in asan free-threading tsan-free-threading; do
6+
cp Tools/pixi-packages/default/recipe.yaml Tools/pixi-packages/${name}/recipe.yaml
127
done

Tools/pixi-packages/recipe.yaml

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)