@@ -467,7 +467,7 @@ shouldn't be, because some packages built with mpi don't preclude other packages
467
467
from using the no-mpi variant of the library (e.g. for a long time, fenics used mpi with no-mpi hdf5 since there was no
468
468
parallel hdf5 yet. This works fine, though some features may not be available).
469
469
470
- Typically, if there is a preference it will be for the serial build, such that installers/requirers of the package
470
+ Typically, if there is a preference it will be for the serial build, such that installers/requirers of the package
471
471
only get the mpi build if explicitly requested. We use a higher build number for the ``nompi `` variant in this case.
472
472
473
473
Here is an example build section:
@@ -1050,6 +1050,51 @@ To skip the pypy builds, do the following,
1050
1050
skip : True # [python_impl == 'pypy']
1051
1051
1052
1052
1053
+ Using setuptools_scm
1054
+ ====================
1055
+
1056
+ The Python module `setuptools_scm <https://github.com/pypa/setuptools_scm >`_
1057
+ can be used to manage a package's version automatically from metadata, such as git tags.
1058
+ The package's version string is thus not specified anywhere in the package,
1059
+ but encoded in it at install-time.
1060
+
1061
+ For conda-build this means that ``setuptools_scm `` must be included as a ``host `` dependency.
1062
+ Additionally, some attention because the metadata is often not available in the sources.
1063
+ There are two options for how to proceed:
1064
+
1065
+ * For Python package also available on PyPI:
1066
+ Use the PyPi tarball as a source, as it will have the metadata encoded
1067
+ (in such a way that ``setuptools_scm `` knows how to find it).
1068
+
1069
+ * Specify the environment variable ``SETUPTOOLS_SCM_PRETEND_VERSION `` with the version string.
1070
+ If specified this environment variable is the principle source for ``setuptools_scm ``.
1071
+ There are two ways how to do this:
1072
+
1073
+ - If you are using build scripts, in ``build.sh `` specify:
1074
+
1075
+ .. code-block :: bash
1076
+
1077
+ export SETUPTOOLS_SCM_PRETEND_VERSION=" $PKG_VERSION "
1078
+
1079
+ and in ``bld.bat `` specify:
1080
+
1081
+ .. code-block :: bash
1082
+
1083
+ set SETUPTOOLS_SCM_PRETEND_VERSION=%PKG_VERSION%
1084
+
1085
+ Whereby you use that ``PKG_VERSION `` has been set with the version string,
1086
+ see `Environment variables <https://docs.conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html#env-vars >`_.
1087
+
1088
+ - Otherwise, if you are directly building from ``meta.yaml ``, use for example:
1089
+
1090
+ .. code-block :: yaml
1091
+
1092
+ build :
1093
+ # [...]
1094
+ script_env :
1095
+ - SETUPTOOLS_SCM_PRETEND_VERSION={{version}}
1096
+ script : " {{ PYTHON }} -m pip install . -vv"
1097
+
1053
1098
.. _centos7 :
1054
1099
1055
1100
Using CentOS 7
0 commit comments