Skip to content

Commit c0b4740

Browse files
committed
mention test environments too
1 parent df8ee9c commit c0b4740

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

docs/maintainer/understanding_conda_forge/environment-types.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: 'Environment types'
33
---
44

5+
import { RecipeTabs } from "@site/src/components/RecipeTabs";
6+
57
One of the least intuitive things to grasp when beginning to work with conda recipes is what the
68
roles of the different environments are. Questions such as "does it go into `build:` or `host:`?"
79
or "what's the difference between those two?" are very common. This page provides a high-level
@@ -71,6 +73,39 @@ to be present both at build time (for the linker to find the symbols therein, an
7173
find them), as well as at runtime (when the dynamic linker goes looking for the symbols that have
7274
been marked as externally provided during the build of `mypkg`).
7375

76+
It's worth noting that the `run:` environment is never actually created during the build of `mypkg`.
77+
That's why testing packages is essential, not least to find if the resulting artefact can actually
78+
be installed as-is. Here, the recipe formats v0 (`meta.yaml`) and v1 (`recipe.yaml`) behave sligtly
79+
differently. Then, using the same notation as above:
80+
81+
<RecipeTabs>
82+
83+
```yaml
84+
requirements: # build/host/run as above
85+
[...]
86+
87+
test:
88+
requires: # [runtime] linux-aarch64; the package we built above
89+
- pytest # ... plus (optionally) additional test-only dependencies
90+
91+
92+
93+
```
94+
95+
```yaml
96+
requirements: # build/host/run as above
97+
[...]
98+
99+
tests:
100+
- requirements:
101+
run: # [runtime] linux-aarch64; the package we built above
102+
- pytest # ... plus (optionally) additional test-only dependencies
103+
build: # not currently necessary in conda-forge, but future use-cases
104+
- ... # may need this (e.g., if conda-forge ever builds for emscripten)
105+
```
106+
107+
</RecipeTabs>
108+
74109
### Native builds
75110
76111
When the architectures between `build:` and `host:` match, the situation is simplified, because

0 commit comments

Comments
 (0)