From 82fc179f39ed6da308b0f229769f899570a1d9ea Mon Sep 17 00:00:00 2001
From: Willem Jan Palenstijn <wjp@usecode.org>
Date: Fri, 17 Jan 2020 10:22:05 +0100
Subject: Use numpy backward binary compatibility for conda packages

We now only build a single package built with numpy 1.11.x for numpy>=1.11,<2 .

There is no guarantee that every future numpy version covered by this
will be compatible with numpy 1.11, but numpy checks this internally at
run-time, and should report this (noisily) when this occurs.
---
 python/conda/astra-toolbox/conda_build_config_py27.yaml | 12 ------------
 python/conda/astra-toolbox/conda_build_config_py36.yaml | 12 ------------
 python/conda/astra-toolbox/conda_build_config_py37.yaml | 12 ------------
 python/conda/astra-toolbox/conda_build_config_py38.yaml | 12 ------------
 python/conda/astra-toolbox/linux_build_config.yaml      | 12 ++++++++++++
 python/conda/astra-toolbox/meta.yaml                    |  3 +--
 python/conda/libastra/meta.yaml                         |  2 +-
 python/conda/linux_release/buildenv/build.sh            |  5 ++---
 python/conda/linux_release/release.sh                   |  2 +-
 9 files changed, 17 insertions(+), 55 deletions(-)
 delete mode 100644 python/conda/astra-toolbox/conda_build_config_py27.yaml
 delete mode 100644 python/conda/astra-toolbox/conda_build_config_py36.yaml
 delete mode 100644 python/conda/astra-toolbox/conda_build_config_py37.yaml
 delete mode 100644 python/conda/astra-toolbox/conda_build_config_py38.yaml
 create mode 100644 python/conda/astra-toolbox/linux_build_config.yaml

diff --git a/python/conda/astra-toolbox/conda_build_config_py27.yaml b/python/conda/astra-toolbox/conda_build_config_py27.yaml
deleted file mode 100644
index d453378..0000000
--- a/python/conda/astra-toolbox/conda_build_config_py27.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-python:
-  - 2.7
-
-numpy:
-  - 1.11
-  - 1.15
-  - 1.16
-
-c_compiler_version:
-  - 7.3
-cxx_compiler_version:
-  - 7.3
diff --git a/python/conda/astra-toolbox/conda_build_config_py36.yaml b/python/conda/astra-toolbox/conda_build_config_py36.yaml
deleted file mode 100644
index 571a9e5..0000000
--- a/python/conda/astra-toolbox/conda_build_config_py36.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-python:
-  - 3.6
-
-numpy:
-  - 1.11
-  - 1.15
-  - 1.16
-  - 1.17
-c_compiler_version:
-  - 7.3
-cxx_compiler_version:
-  - 7.3
diff --git a/python/conda/astra-toolbox/conda_build_config_py37.yaml b/python/conda/astra-toolbox/conda_build_config_py37.yaml
deleted file mode 100644
index c654075..0000000
--- a/python/conda/astra-toolbox/conda_build_config_py37.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-python:
-  - 3.7
-
-numpy:
-  - 1.11
-  - 1.15
-  - 1.16
-  - 1.17
-c_compiler_version:
-  - 7.3
-cxx_compiler_version:
-  - 7.3
diff --git a/python/conda/astra-toolbox/conda_build_config_py38.yaml b/python/conda/astra-toolbox/conda_build_config_py38.yaml
deleted file mode 100644
index 96934dd..0000000
--- a/python/conda/astra-toolbox/conda_build_config_py38.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-python:
-  - 3.8
-
-numpy:
-  - 1.11
-  - 1.13
-  - 1.14
-  - 1.17
-c_compiler_version:
-  - 7.3
-cxx_compiler_version:
-  - 7.3
diff --git a/python/conda/astra-toolbox/linux_build_config.yaml b/python/conda/astra-toolbox/linux_build_config.yaml
new file mode 100644
index 0000000..91cc0e4
--- /dev/null
+++ b/python/conda/astra-toolbox/linux_build_config.yaml
@@ -0,0 +1,12 @@
+python:
+  - 2.7
+  - 3.6
+  - 3.7
+  - 3.8
+numpy:
+  - 1.11
+
+c_compiler_version:
+  - 7.3
+cxx_compiler_version:
+  - 7.3
diff --git a/python/conda/astra-toolbox/meta.yaml b/python/conda/astra-toolbox/meta.yaml
index 78a7394..0526778 100644
--- a/python/conda/astra-toolbox/meta.yaml
+++ b/python/conda/astra-toolbox/meta.yaml
@@ -8,7 +8,6 @@ source:
 
 build:
   number: 0
-  string: py_{{ python }}_numpy_{{ numpy }}
 
 test:
   imports:
@@ -36,7 +35,7 @@ requirements:
     - libastra ==1.9.9.dev0
   run:
     - python
-    - {{ pin_compatible('numpy', min_pin='x.x', max_pin='x.x') }}
+    - {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
     - scipy
     - six
     - libastra ==1.9.9.dev0
diff --git a/python/conda/libastra/meta.yaml b/python/conda/libastra/meta.yaml
index d6ab1f8..16ddf0e 100644
--- a/python/conda/libastra/meta.yaml
+++ b/python/conda/libastra/meta.yaml
@@ -8,7 +8,7 @@ source:
 
 build:
   number: 0
-  string: cuda_{{ cudatoolkit }} # [linux]
+  string: cuda_{{ cudatoolkit }}_0 # [linux]
 
 requirements:
   build:
diff --git a/python/conda/linux_release/buildenv/build.sh b/python/conda/linux_release/buildenv/build.sh
index f9ac361..04e4066 100755
--- a/python/conda/linux_release/buildenv/build.sh
+++ b/python/conda/linux_release/buildenv/build.sh
@@ -13,13 +13,12 @@ git clone --depth 1 --branch ${BRANCH} ${URL}
 
 [ $# -eq 0 ] || perl -pi -e "s/^(\s*version:\s*)[0-9a-z+\.']+$/\${1}'$1'/" astra-toolbox/python/conda/libastra/meta.yaml astra-toolbox/python/conda/astra-toolbox/meta.yaml
 [ $# -eq 0 ] || perl -pi -e "s/^(\s*number:\s*)[0-9]+$/\${1}$2/" astra-toolbox/python/conda/libastra/meta.yaml astra-toolbox/python/conda/astra-toolbox/meta.yaml
+[ $# -eq 0 ] || perl -pi -e "s/^(\s*string:.+_)[0-9]+/\${1}$2/" astra-toolbox/python/conda/libastra/meta.yaml
 [ $# -eq 0 ] || perl -pi -e "s/^(\s*-\s*libastra\s*==\s*)[0-9a-z+\.]+$/\${1}$1/" astra-toolbox/python/conda/astra-toolbox/meta.yaml
 
 
 conda-build -m astra-toolbox/python/conda/libastra/linux_build_config.yaml astra-toolbox/python/conda/libastra
 
-for i in 27 36 37 38; do
-  conda-build -m astra-toolbox/python/conda/astra-toolbox/conda_build_config_py$i.yaml astra-toolbox/python/conda/astra-toolbox
-done
+conda-build -m astra-toolbox/python/conda/astra-toolbox/linux_build_config.yaml astra-toolbox/python/conda/astra-toolbox
 
 cp /root/miniconda3/conda-bld/linux-64/*astra* /out
diff --git a/python/conda/linux_release/release.sh b/python/conda/linux_release/release.sh
index 26e67a3..8134b41 100644
--- a/python/conda/linux_release/release.sh
+++ b/python/conda/linux_release/release.sh
@@ -12,7 +12,7 @@ docker build -t astra-build-env buildenv
 
 cp buildenv/build.sh $D
 
-docker run -v $D:/out:z astra-build-env /bin/bash /out/build.sh 1.9.9.dev1 0
+docker run -v $D:/out:z astra-build-env /bin/bash /out/build.sh 1.9.9.dev2 0
 
 rm -f $D/build.sh
 
-- 
cgit v1.2.3