Skip to content

Commit b548af1

Browse files
authored
Merge pull request conda-forge#690 from scopatz/depsorder
some more document on dependency order
2 parents 64fc459 + 4357ad2 commit b548af1

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

src/recipe.rst

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ In case you are building your first recipe using conda-forge, a step-by-step ins
3232
Step-by-step Instructions
3333
-------------------------
3434

35-
0. Ensure your source code can be downloaded as a single file. Source code
36-
should be downloadable as an archive (.tar.gz, .zip, .tar.bz2, .tar.xz)
37-
or tagged on GitHub, to ensure that it can be verified. (For further
38-
detail, see `Build from Tarballs, Not Repos
39-
<https://conda-forge.org/docs/meta.html#build-from-tarballs-not-repos>`_).
35+
0. Ensure your source code can be downloaded as a single file. Source code
36+
should be downloadable as an archive (.tar.gz, .zip, .tar.bz2, .tar.xz)
37+
or tagged on GitHub, to ensure that it can be verified. (For further
38+
detail, see `Build from Tarballs, Not Repos
39+
<https://conda-forge.org/docs/meta.html#build-from-tarballs-not-repos>`_).
4040
1. Fork the `example recipes
4141
<https://github.com/conda-forge/staged-recipes/tree/master/recipes>`_
4242
repository.
@@ -47,11 +47,11 @@ Step-by-step Instructions
4747
example/meta.yaml>`_
4848
file from the example directory. Please leave the example directory
4949
unchanged!
50-
4. Edit the copied recipe (meta.yml) as needed. For details, see
50+
4. Edit the copied recipe (meta.yml) as needed. For details, see
5151
`Writing the "meta.yml" <https://conda-forge.org/docs/meta.html>`_
52-
5. Generate the SHA256 key for your source code archive, as described in the
53-
example recipe using the ``openssl`` tool. As an alternative you can also
54-
go to the package description on `PyPi <https://pypi.org>`_ from which you
52+
5. Generate the SHA256 key for your source code archive, as described in the
53+
example recipe using the ``openssl`` tool. As an alternative you can also
54+
go to the package description on `PyPi <https://pypi.org>`_ from which you
5555
can directly copy the SHA256.
5656
6. Be sure to fill in the ``tests`` section. The simplest test will simply
5757
test that the module can be imported, as described in the example.
@@ -86,15 +86,28 @@ Avoid Dependencies Outside of Conda-Forge
8686
Short answer: yes.
8787

8888
Long answer: In principle, as long as your dependencies are in at least one of
89-
your user's conda channels they will be able to install your package. In practice, that is difficult to manage, and we strive to have all dependencies built in conda-forge.
89+
your user's conda channels they will be able to install your package. In practice,
90+
that is difficult to manage, and we strive to have all dependencies built in conda-forge.
9091

9192
Building all of the dependencies in conda-forge allow us greater assurance
92-
of ABI compatibility for the conda-forge packages. Only in extreme cases
93-
should you rely on a dependency outside of conda-forge.
94-
95-
If your dependencies do not change with the python version, or with the
96-
platform, consider making your build :ref:`noarch <noarch>`, this will allow the recipe to build faster, and free some CI resources for other projects.
97-
93+
of ABI compatibility for the conda-forge packages.
94+
**Only in extreme cases should you rely on a dependency outside of conda-forge.**
95+
In these cases, the basic heirarchy for dependencies, in order of preference, is,
96+
97+
1. Make or use a conda-forge package for the dependency
98+
2. Use a defaults package for a dependency
99+
3. Use a `CDT <https://conda.io/docs/user-guide/tasks/build-packages/compiler-tools.html#cdt-packages>`_ for a dependency
100+
4. Use a ``yum_requirements.txt`` for a dependency (deprecated)
101+
5. Require the package to exist implicitly on the user's system outside of conda managing the package
102+
in any way, shape, or form. This is obviously a terrible option and should never
103+
be purposefully used. The only exceptions are packages such as device drivers
104+
that **need** root or sys admin permissions and kernel access. For example,
105+
GPU code usually requires that a graphics card driver be installed for the
106+
code to execute. Avoid these implicit dependencies at all costs.
107+
108+
If your dependencies do not change with the Python version, or with the
109+
platform, consider making your build :ref:`noarch <noarch>`, this will
110+
allow the recipe to build faster, and free some CI resources for other projects.
98111

99112

100113
Optional: ``bld.bat`` and/or ``build.sh``

0 commit comments

Comments
 (0)