Skip to content

Commit 17b9444

Browse files
authored
Merge pull request #2355 from conda-forge/new-noarch-python
doc: add updates for new noarch python syntax from CFEP-25
2 parents 9c674e3 + 3275ba1 commit 17b9444

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

docs/maintainer/knowledge_base.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -809,11 +809,11 @@ build:
809809
810810
requirements:
811811
host:
812-
- python
812+
- python {{ python_min }}.*
813813
- nodejs
814814
- pip
815815
run:
816-
- python
816+
- python >={{ python_min }}
817817
- nodejs
818818
- jupyterlab >=2
819819
```
@@ -1480,6 +1480,33 @@ In order to qualify as a noarch python package, all of the following criteria mu
14801480
in the `build` section of `meta.yaml`
14811481
- No activate scripts
14821482

1483+
All recipes employing `noarch: python` should use the `python_min` variable per the following example:
1484+
1485+
```yaml title="recipe/meta.yaml"
1486+
{% set python_min = python_min|default("0.1a0") %}
1487+
1488+
name: package
1489+
source:
1490+
# ...
1491+
build:
1492+
noarch: python
1493+
# ...
1494+
requirements:
1495+
host:
1496+
- python {{ python_min }}.*
1497+
# ...
1498+
run:
1499+
- python >={{ python_min }}
1500+
# ...
1501+
1502+
test:
1503+
requires:
1504+
- python ={{ python_min }}
1505+
# ...
1506+
```
1507+
1508+
See [CFEP-25](https://github.com/conda-forge/cfep/blob/main/cfep-25.md) for more details on this syntax.
1509+
14831510
:::note
14841511

14851512
While `noarch: python` does not work with selectors, it does work with version constraints.
@@ -1576,10 +1603,10 @@ build:
15761603
noarch: python
15771604
requirements:
15781605
host:
1579-
- python >=3.7
1606+
- python {{ python_min }}.*
15801607
# ...
15811608
run:
1582-
- python >=3.7
1609+
- python >={{ python_min }}
15831610
- numpy
15841611
- __unix # [unix]
15851612
- __win # [win]
@@ -1614,7 +1641,7 @@ build:
16141641
requirements:
16151642
# ...
16161643
run:
1617-
- python
1644+
- python >={{ python_min }}
16181645
- numpy
16191646
- __linux # [linux]
16201647
- __osx # [osx]

0 commit comments

Comments
 (0)