Skip to content

Commit 4b9f17f

Browse files
committed
Use the recipe highlighter
Signed-off-by: Michał Górny <mgorny@quansight.com>
1 parent 82f818d commit 4b9f17f

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

docs/maintainer/understanding_conda_forge/jinja-templating.mdx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The values can either be scalars or lists.
2727

2828
<RecipeTabs>
2929

30-
```yaml
30+
```recipe
3131
{% set version = "3.7.3" %}
3232
3333
package:
@@ -39,7 +39,7 @@ source:
3939
sha256: da60b54064d4cfcd9c26576f6df2690e62085123826cff2e667e72a91952d318
4040
```
4141

42-
```yaml
42+
```recipe
4343
context:
4444
version: "3.7.3"
4545
@@ -77,12 +77,12 @@ Expressions can be grouped using parentheses.
7777

7878
<RecipeTabs>
7979

80-
```yaml
80+
```recipe
8181
{% set build_base = 0 %}
8282
{% set build_number = build_base + 100 if mpi == "nompi" else build_base %}
8383
```
8484

85-
```yaml
85+
```recipe
8686
context:
8787
build_base: 0
8888
build_number: ${{ build_base + 100 if mpi == "nompi" else build_base }}
@@ -112,14 +112,14 @@ The full list of available filters depends on the recipe version:
112112

113113
<RecipeTabs>
114114

115-
```yaml
115+
```recipe
116116
source:
117117
# for version 3.1.1, the filename becomes "openbabel-3-1-1.tar.gz"
118118
url: https://github.com/openbabel/openbabel/archive/openbabel-{{ version | replace('.','-') }}.tar.gz
119119
sha256: c97023ac6300d26176c97d4ef39957f06e68848d64f1a04b0b284ccff2744f02
120120
```
121121

122-
```yaml
122+
```recipe
123123
source:
124124
# for version 3.1.1, the filename becomes "openbabel-3-1-1.tar.gz"
125125
url: https://github.com/openbabel/openbabel/archive/openbabel-${{ version | replace('.','-') }}.tar.gz
@@ -136,7 +136,7 @@ This is specifically useful for Python versions (as a replacement for the `CONDA
136136

137137
<RecipeTabs>
138138

139-
```yaml
139+
```recipe
140140
build:
141141
number: {{ build_number }}
142142
# cuda_compiler_version = 12.9
@@ -145,7 +145,7 @@ build:
145145
string: cuda{{ cuda_compiler_version | replace('.', '') }}py{{ CONDA_PY }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
146146
```
147147

148-
```yaml
148+
```recipe
149149
build:
150150
number: ${{ build_number }}
151151
# cuda_compiler_version = 12.9
@@ -164,7 +164,7 @@ For example, this can be used to conveniently construct a test skip filter for p
164164

165165
<RecipeTabs>
166166

167-
```yaml
167+
```recipe
168168
{% set tests_to_skip = [
169169
# skip test_url_is_accessible instead of hitting 20+ servers per run, since
170170
# each server might be occasionally unresponsive and end up failing our CI
@@ -182,7 +182,7 @@ test:
182182
- pytest {{ tests_to_skip | join(' OR ') }}
183183
```
184184

185-
```yaml
185+
```recipe
186186
context:
187187
tests_to_skip:
188188
# skip test_url_is_accessible instead of hitting 20+ servers per run, since
@@ -216,13 +216,13 @@ It is recommended to store the build number as a custom variable instead.
216216

217217
<RecipeTabs>
218218

219-
```yaml
219+
```recipe
220220
build:
221221
number: 0
222222
string: abc_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
223223
```
224224

225-
```yaml
225+
```recipe
226226
context:
227227
build_number: 0
228228
@@ -261,7 +261,7 @@ In v0 recipes, an additional `py` variable is provided that exposes the Python v
261261

262262
<RecipeTabs>
263263

264-
```yaml
264+
```recipe
265265
requirements:
266266
build:
267267
- {{ compiler('c') }}
@@ -277,7 +277,7 @@ requirements:
277277
- onednn-cpu-threadpool # [linux and x86_64]
278278
```
279279

280-
```yaml
280+
```recipe
281281
requirements:
282282
build:
283283
- ${{ compiler('c') }}
@@ -310,7 +310,7 @@ They can also be used to introduce conditional sections, to some degree.
310310

311311
<RecipeTabs>
312312

313-
```yaml
313+
```recipe
314314
requirements:
315315
host:
316316
- openssl
@@ -322,7 +322,7 @@ requirements:
322322
- zlib
323323
```
324324

325-
```yaml
325+
```recipe
326326
requirements:
327327
host:
328328
- openssl
@@ -339,7 +339,7 @@ requirements:
339339

340340
<RecipeTabs>
341341

342-
```yaml
342+
```recipe
343343
test:
344344
imports:
345345
- spam
@@ -352,7 +352,7 @@ test:
352352
- abi3audit %SP_DIR%/spam.pyd -s -v --assume-minimum-abi3 {{ python_min }} # [win and is_abi3]
353353
```
354354

355-
```yaml
355+
```recipe
356356
tests:
357357
- python:
358358
imports:
@@ -383,15 +383,15 @@ The use of these functions is described in greater detail in [compilers and runt
383383

384384
<RecipeTabs>
385385

386-
```yaml
386+
```recipe
387387
requirements:
388388
build:
389389
- {{ compiler('c') }}
390390
- {{ compiler('cxx') }}
391391
- {{ stdlib('c') }}
392392
```
393393

394-
```yaml
394+
```recipe
395395
requirements:
396396
build:
397397
- ${{ compiler('c') }}
@@ -408,7 +408,7 @@ It is commonly used to match against `python` versions, as a v1 recipe replaceme
408408

409409
<RecipeTabs>
410410

411-
```yaml
411+
```recipe
412412
build:
413413
skip: true # [py<311]
414414
@@ -417,7 +417,7 @@ requirements:
417417
- typing_extensions # [py<312]
418418
```
419419

420-
```yaml
420+
```recipe
421421
build:
422422
skip: match(python, "<3.11")
423423
@@ -455,7 +455,7 @@ In v0 recipes, pin expressions can be specified using `min_pin` and `max_pin` ar
455455

456456
<RecipeTabs>
457457

458-
```yaml
458+
```recipe
459459
requirements:
460460
host:
461461
- numpy
@@ -471,7 +471,7 @@ build:
471471
- {{ pin_subpackage('libopencv', max_pin='x.x.x') }}
472472
```
473473

474-
```yaml
474+
```recipe
475475
requirements:
476476
host:
477477
- numpy
@@ -496,13 +496,13 @@ If you need to pin on version without the build string, use an appropriately lon
496496

497497
<RecipeTabs>
498498

499-
```yaml
499+
```recipe
500500
build:
501501
run_exports:
502502
- {{ pin_subpackage('vtk-base', exact=true) }}
503503
```
504504

505-
```yaml
505+
```recipe
506506
requirements:
507507
run_exports:
508508
- ${{ pin_subpackage('vtk-base', exact=true) }}
@@ -517,7 +517,7 @@ CDTs are described in greater detail in [Core Dependency Tree Packages (CDTs)]/d
517517

518518
<RecipeTabs>
519519

520-
```yaml
520+
```recipe
521521
requirements:
522522
build:
523523
- {{ cdt('mesa-libgl-devel') }} # [linux]
@@ -528,7 +528,7 @@ requirements:
528528
- {{ cdt('libxext') }} # [linux]
529529
```
530530

531-
```yaml
531+
```recipe
532532
requirements:
533533
build:
534534
- if: linux

0 commit comments

Comments
 (0)