@@ -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 warrants some attention because the metadata is often not available.
1062
+ The are two options to proceed:
1063
+
1064
+ * For Python package also available on PyPi:
1065
+ Use the PyPi tarball as a source, as it will have the metadata encoded
1066
+ (in such a way that ``setuptools_scm `` knows how to find it).
1067
+
1068
+ * Specify the environment variable ``SETUPTOOLS_SCM_PRETEND_VERSION `` with the version string.
1069
+ If specified this environment variable is the principle source for ``setuptools_scm ``.
1070
+ There are two ways how to do this:
1071
+
1072
+ - If you are using build scripts, in ``build.sh `` specify:
1073
+
1074
+ .. code-block :: bash
1075
+
1076
+ export SETUPTOOLS_SCM_PRETEND_VERSION=" $PKG_VERSION "
1077
+
1078
+ and in ``bld.bat `` specify:
1079
+
1080
+ .. code-block :: bash
1081
+
1082
+ set SETUPTOOLS_SCM_PRETEND_VERSION=%PKG_VERSION%
1083
+
1084
+ Whereby you use that ``PKG_VERSION `` has been set with the version string,
1085
+ see `Environment variables <https://docs.conda.io/projects/conda-build/en/latest/user-guide/environment-variables.html#env-vars >`_.
1086
+
1087
+ - Otherwise, if you are directly building from ``meta.yaml ``, use for example:
1088
+
1089
+ .. code-block :: yaml
1090
+
1091
+ build :
1092
+ # [...]
1093
+ script :
1094
+ - export SETUPTOOLS_SCM_PRETEND_VERSION="{{ version }}" # [unix]
1095
+ - set SETUPTOOLS_SCM_PRETEND_VERSION="{{ version }}" # [win]
1096
+ - " {{ PYTHON }} -m pip install . -vv"
1097
+
1053
1098
.. _centos7 :
1054
1099
1055
1100
Using CentOS 7
0 commit comments