Skip to content

Commit fecab59

Browse files
authored
Merge pull request #1624 from bollwyvl/add-noarch-platform
[wip] add noarch_platforms to knowledge base
2 parents 8714a68 + 5efb81e commit fecab59

File tree

2 files changed

+49
-17
lines changed

2 files changed

+49
-17
lines changed

src/maintainer/conda_forge_yml.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Top-level fields
3737
* :ref:`linux`
3838
* :ref:`linux_aarch64`
3939
* :ref:`linux_ppc64le`
40+
* :ref:`noarch_platforms`
4041
* :ref:`os_version`
4142
* :ref:`osx`
4243
* :ref:`provider`
@@ -152,7 +153,6 @@ Leaving this field empty implicitly requests to build a package natively. i.e.
152153
osx_arm64: osx_arm64
153154
win_64: win_64
154155
155-
156156
.. _build_with_mambabuild:
157157

158158
build_with_mambabuild
@@ -270,7 +270,7 @@ defaults are as follows:
270270
repo_name: ""
271271
# branch name to execute on
272272
branch_name: master
273-
# branch name to use for rerender+webservices github actions and
273+
# branch name to use for rerender+webservices github actions and
274274
# conda-forge-ci-setup-feedstock references
275275
tooling_branch_name: master
276276
@@ -321,6 +321,26 @@ Currently only:
321321
linux_ppc64le:
322322
enabled: False
323323
324+
.. _noarch_platforms:
325+
326+
noarch_platforms
327+
----------------
328+
Platforms on which to build noarch packages. The preferred default is a
329+
single build on ``linux_64``.
330+
331+
.. code-block:: yaml
332+
333+
noarch_platforms: linux_64
334+
335+
To build on multiple platforms, e.g. for simple packages with platform-specific
336+
dependencies, provide a list.
337+
338+
.. code-block:: yaml
339+
340+
noarch_platforms:
341+
- linux_64
342+
- win_64
343+
324344
.. _os_version:
325345

326346
os_version

src/maintainer/knowledge_base.rst

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -917,18 +917,23 @@ which restricts the corresponding conda-forge recipes from becoming ``noarch``.
917917
Therefore, some conda-forge recipes only create an actual package on specific Python versions and are otherwise an
918918
empty placeholder. This allows them to be safely installed under all Python versions and makes using ``skips`` unnecessary.
919919

920-
Currently available packages:
920+
Similarly, some packages are `only` platform-specific dependency of a package, such as ``pywin32``, and have
921+
helper metapackages which can help recipes stay ``noarch``. The version of the `actual` package required
922+
can be controlled with ``run_constrained``, even for packages not available on all platforms.
921923

922-
+-------------+-------------------+--------------+
923-
| Name | Available on: | Empty on: |
924-
+=============+===================+==============+
925-
| dataclasses | python >=3.6,<3.7 | python >=3.7 |
926-
+-------------+-------------------+--------------+
927-
| enum34 | python =2.7 | python >=3.4 |
928-
+-------------+-------------------+--------------+
929-
| typing | | python >=3 |
930-
+-------------+-------------------+--------------+
924+
Currently available packages:
931925

926+
+--------------------+-------------------+--------------+
927+
| Name | Available on: | Empty on: |
928+
+====================+===================+==============+
929+
| dataclasses | python >=3.6,<3.7 | python >=3.7 |
930+
+--------------------+-------------------+--------------+
931+
| enum34 | python =2.7 | python >=3.4 |
932+
+--------------------+-------------------+--------------+
933+
| typing | | python >=3 |
934+
+--------------------+-------------------+--------------+
935+
| pywin32-on-windows | windows | unix |
936+
+--------------------+-------------------+--------------+
932937

933938
.. _knowledge:all-installs:
934939

@@ -957,7 +962,7 @@ Noarch builds
957962
Noarch packages are packages that are not architecture specific and therefore only have to be built once.
958963

959964
Declaring these packages as ``noarch`` in the ``build`` section of the meta.yaml, reduces shared CI resources.
960-
Therefore all packages that qualify to be noarch packages, should be declared as such.
965+
Therefore all packages that qualify to be noarch packages `should` be declared as such.
961966

962967

963968
.. _noarch:
@@ -977,7 +982,7 @@ In order to qualify as a noarch python package, all of the following criteria mu
977982
statement and add version constraint on python in ``host`` and ``run``
978983
section.
979984
- ``2to3`` is not used
980-
- Scripts argument in setup.py is not used
985+
- ``scripts`` argument in ``setup.py`` is not used
981986
- If ``console_scripts`` ``entry_points`` are defined in ``setup.py`` or ``setup.cfg``, they are also listed in
982987
the ``build`` section of ``meta.yaml``
983988
- No activate scripts
@@ -991,7 +996,7 @@ In order to qualify as a noarch python package, all of the following criteria mu
991996

992997
.. note::
993998

994-
Only ``console_scripts`` entry points have to be listed in meta.yaml. Other entry points do not conflict
999+
Only ``console_scripts`` entry points have to be listed in ``meta.yaml``. Other entry points do not conflict
9951000
with ``noarch`` and therefore do not require extra treatment.
9961001

9971002
.. note::
@@ -1000,9 +1005,16 @@ In order to qualify as a noarch python package, all of the following criteria mu
10001005
``noarch`` even if one of its dependencies is not available on a given platform. If this is the case, conda will
10011006
display a helpful error message describing which dependency couldn't be found when it tries to install the package.
10021007
If the dependency is later made available, your package will be installable on that platform without having to make
1003-
any changes to the feedstock. However, keep in mind that since ``noarch`` packages are built on Linux, all
1004-
dependencies must be available on Linux.
1008+
any changes to the feedstock.
1009+
1010+
By default, ``noarch`` packages are built on Linux, and all dependencies must be available on Linux.
1011+
1012+
.. hint::
10051013

1014+
If a ``noarch`` package `cannot` be built on Linux, one or more ``noarch_platforms`` can be provided in
1015+
``conda-forge.yml``. One example is `pywin32-on-windows <https://github.com/conda-forge/pywin32-on-windows-feedstock>`_,
1016+
which builds on Linux `and` Windows, with ``build_number`` offsets to create a pair packages, like
1017+
``dataclasses``.
10061018

10071019
If an existing python package qualifies to be converted to a noarch package, you can request the required changes
10081020
by opening a new issue and including ``@conda-forge-admin, please add noarch: python``.

0 commit comments

Comments
 (0)