Skip to content

Commit de3e21f

Browse files
authored
prepare release 1.3.2 (#64)
1 parent edf378c commit de3e21f

File tree

6 files changed

+47
-59
lines changed

6 files changed

+47
-59
lines changed

pixi.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
55
[project]
66
name = "rattler-build-conda-compat"
77
description = "A package for exposing rattler-build API for conda-smithy"
8-
version = "1.3.1"
8+
version = "1.3.2"
99
readme = "README.md"
1010
authors = [{ name = "Nichita Morcotilo", email = "nichita@prefix.dev" }]
1111
license = { file = "LICENSE.txt" }

tests/__snapshots__/test_jinja.ambr

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
# serializer version: 1
2-
# name: test_conditional_source_render
3-
set({
4-
Source(url='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_3.24.11.1-linux.tar.gz', template='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_${{ blpapicpp_linux_version }}-linux.tar.gz', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='eb1a9aa834a969a8ccbbb04061274623659a1fb273abda4413b47fe59e7ee412', md5=None),
5-
Source(url='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_3.24.11.1-macos-arm64.tar.gz', template='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_${{ blpapicpp_osx_version }}-macos-arm64.tar.gz', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='fa96331edf06dd2342cb27771367516296067e94961ec6e600add1c2eed9c41d', md5=None),
6-
Source(url='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_3.24.11.1-windows.zip', template='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_${{ blpapicpp_win_version }}-windows.zip', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='e63c0b75d50097194c425489a08cec9c0374ab7b8eafe5b015c076bb2432fa19', md5=None),
7-
Source(url='https://blpapi.bloomberg.com/repository/releases/python/blpapi-3.24.11.tar.gz', template='https://blpapi.bloomberg.com/repository/releases/python/${{ name }}-${{ version }}.tar.gz', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='94dc699df262187b3afe4f163526aac67fb5982b008efe851836e9f1cd5358c1', md5=None),
8-
})
9-
# ---
102
# name: test_context_rendering
113
'''
124
context:
@@ -320,20 +312,6 @@
320312

321313
'''
322314
# ---
323-
# name: test_multi_source_render
324-
set({
325-
Source(url='https://all.com', template='https://all.com', context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
326-
Source(url='https://all.com/foobar/1.2.3.zip', template='https://all.com/${{ name }}/${{ version }}.zip', context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
327-
Source(url='https://foo.com', template='https://foo.com', context={'name': 'foobar', 'version': '1.2.3'}, sha256='679d42a76b82a6dc20ffd9048ab45fb2e5557a526113aaedc7419e12f3cfab38', md5=None),
328-
Source(url='https://osx.com/osx-64/foo.zip', template='https://osx.com/${{ target_platform }}/foo.zip', context={'name': 'foobar', 'version': '1.2.3'}, sha256='zzz', md5=None),
329-
Source(url='https://osx.com/win-64/foo.zip', template='https://osx.com/${{ target_platform }}/foo.zip', context={'name': 'foobar', 'version': '1.2.3'}, sha256='zzz', md5=None),
330-
Source(url='https://win.com', template='https://win.com', context={'name': 'foobar', 'version': '1.2.3'}, sha256='xxx', md5=None),
331-
Source(url=['https://foo.com/linux-64/zip.zip', 'https://mirror.com/linux-64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
332-
Source(url=['https://foo.com/osx-64/zip.zip', 'https://mirror.com/osx-64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
333-
Source(url=['https://foo.com/osx-arm64/zip.zip', 'https://mirror.com/osx-arm64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
334-
Source(url=['https://foo.com/win-64/zip.zip', 'https://mirror.com/win-64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='xxx', md5=None),
335-
})
336-
# ---
337315
# name: test_render_recipe_with_context
338316
'''
339317
# yaml-language-server: $schema=https://raw.githubusercontent.com/prefix-dev/recipe-format/main/schema.json
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# serializer version: 1
2+
# name: test_conditional_source_render
3+
set({
4+
Source(url='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_3.24.11.1-linux.tar.gz', template='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_${{ blpapicpp_linux_version }}-linux.tar.gz', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='eb1a9aa834a969a8ccbbb04061274623659a1fb273abda4413b47fe59e7ee412', md5=None),
5+
Source(url='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_3.24.11.1-macos-arm64.tar.gz', template='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_${{ blpapicpp_osx_version }}-macos-arm64.tar.gz', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='fa96331edf06dd2342cb27771367516296067e94961ec6e600add1c2eed9c41d', md5=None),
6+
Source(url='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_3.24.11.1-windows.zip', template='https://blpapi.bloomberg.com/download/releases/raw/files/blpapi_cpp_${{ blpapicpp_win_version }}-windows.zip', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='e63c0b75d50097194c425489a08cec9c0374ab7b8eafe5b015c076bb2432fa19', md5=None),
7+
Source(url='https://blpapi.bloomberg.com/repository/releases/python/blpapi-3.24.11.tar.gz', template='https://blpapi.bloomberg.com/repository/releases/python/${{ name }}-${{ version }}.tar.gz', context={'name': 'blpapi', 'version': '3.24.11', 'blpapicpp_linux_version': '3.24.11.1', 'blpapicpp_win_version': '3.24.11.1', 'blpapicpp_osx_version': '3.24.11.1'}, sha256='94dc699df262187b3afe4f163526aac67fb5982b008efe851836e9f1cd5358c1', md5=None),
8+
})
9+
# ---
10+
# name: test_multi_source_render
11+
set({
12+
Source(url='https://all.com', template='https://all.com', context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
13+
Source(url='https://all.com/foobar/1.2.3.zip', template='https://all.com/${{ name }}/${{ version }}.zip', context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
14+
Source(url='https://foo.com', template='https://foo.com', context={'name': 'foobar', 'version': '1.2.3'}, sha256='679d42a76b82a6dc20ffd9048ab45fb2e5557a526113aaedc7419e12f3cfab38', md5=None),
15+
Source(url='https://osx.com/osx-64/foo.zip', template='https://osx.com/${{ target_platform }}/foo.zip', context={'name': 'foobar', 'version': '1.2.3'}, sha256='zzz', md5=None),
16+
Source(url='https://osx.com/win-64/foo.zip', template='https://osx.com/${{ target_platform }}/foo.zip', context={'name': 'foobar', 'version': '1.2.3'}, sha256='zzz', md5=None),
17+
Source(url='https://win.com', template='https://win.com', context={'name': 'foobar', 'version': '1.2.3'}, sha256='xxx', md5=None),
18+
Source(url=['https://foo.com/linux-64/zip.zip', 'https://mirror.com/linux-64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
19+
Source(url=['https://foo.com/osx-64/zip.zip', 'https://mirror.com/osx-64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
20+
Source(url=['https://foo.com/osx-arm64/zip.zip', 'https://mirror.com/osx-arm64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='yyy', md5=None),
21+
Source(url=['https://foo.com/win-64/zip.zip', 'https://mirror.com/win-64/zip.zip'], template=['https://foo.com/${{ target_platform }}/zip.zip', 'https://mirror.com/${{ target_platform }}/zip.zip'], context={'name': 'foobar', 'version': '1.2.3'}, sha256='xxx', md5=None),
22+
})
23+
# ---

tests/test_jinja.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from rattler_build_conda_compat.jinja.jinja import render_recipe_with_context
77
from rattler_build_conda_compat.jinja.utils import _MissingUndefined
88
from rattler_build_conda_compat.loader import load_yaml
9-
from rattler_build_conda_compat.recipe_sources import render_all_sources
109
from rattler_build_conda_compat.yaml import _dump_yaml_to_string
1110

1211
test_data = Path(__file__).parent / "data"
@@ -55,27 +54,3 @@ def test_context_rendering(snapshot) -> None:
5554
into_yaml = _dump_yaml_to_string(rendered)
5655

5756
assert into_yaml == snapshot
58-
59-
60-
def test_multi_source_render(snapshot) -> None:
61-
jolt_physics = test_data / "jolt-physics" / "sources.yaml"
62-
variants = (test_data / "jolt-physics" / "ci_support").glob("*.yaml")
63-
64-
recipe_yaml = load_yaml(jolt_physics.read_text())
65-
variants = [load_yaml(variant.read_text()) for variant in variants]
66-
67-
sources = render_all_sources(recipe_yaml, variants)
68-
assert sources == snapshot
69-
70-
71-
def test_conditional_source_render(snapshot) -> None:
72-
jolt_physics = test_data / "conditional_sources.yaml"
73-
# reuse the ci_support variants
74-
variants = (test_data / "jolt-physics" / "ci_support").glob("*.yaml")
75-
76-
recipe_yaml = load_yaml(jolt_physics.read_text())
77-
variants = [load_yaml(variant.read_text()) for variant in variants]
78-
79-
sources = render_all_sources(recipe_yaml, variants)
80-
assert len(sources) == 4
81-
assert sources == snapshot

tests/test_recipe_sources.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from rattler_build_conda_compat.loader import load_yaml
77
from rattler_build_conda_compat.recipe_sources import get_all_url_sources, render_all_sources
88

9+
test_data = Path(__file__).parent / "data"
10+
911

1012
@pytest.mark.parametrize(
1113
("partial_recipe", "expected_output"),
@@ -26,15 +28,25 @@ def test_recipe_sources(partial_recipe: str, expected_output: list[str]) -> None
2628
assert list(get_all_url_sources(recipe)) == expected_output
2729

2830

29-
def test_recipe_source_rendering() -> None:
30-
"""Test that the recipe sources are correctly rendered"""
31-
folder = Path(f"{Path(__file__).parent}/data/jolt-physics")
32-
path = folder / "recipe.yaml"
33-
variants = (folder / "ci_support").glob("*.yaml")
31+
def test_multi_source_render(snapshot) -> None:
32+
jolt_physics = test_data / "jolt-physics" / "sources.yaml"
33+
variants = (test_data / "jolt-physics" / "ci_support").glob("*.yaml")
3434

35-
recipe = load_yaml(path.read_text())
36-
# load all variants
35+
recipe_yaml = load_yaml(jolt_physics.read_text())
36+
variants = [load_yaml(variant.read_text()) for variant in variants]
37+
38+
sources = render_all_sources(recipe_yaml, variants)
39+
assert sources == snapshot
40+
41+
42+
def test_conditional_source_render(snapshot) -> None:
43+
jolt_physics = test_data / "conditional_sources.yaml"
44+
# reuse the ci_support variants
45+
variants = (test_data / "jolt-physics" / "ci_support").glob("*.yaml")
46+
47+
recipe_yaml = load_yaml(jolt_physics.read_text())
3748
variants = [load_yaml(variant.read_text()) for variant in variants]
3849

39-
rendered_sources = render_all_sources(recipe, variants)
40-
print(rendered_sources)
50+
sources = render_all_sources(recipe_yaml, variants)
51+
assert len(sources) == 4
52+
assert sources == snapshot

0 commit comments

Comments
 (0)