From 55552fbd9b02a439199f6ac6fba2f62cbb9c4876 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Wed, 8 Nov 2017 16:52:54 +0000
Subject: [PATCH] Maybe this will work?

---
 .ci/build_conda_dist.sh | 38 ++++++++------------------------------
 .conda/bld.bat          |  2 --
 .conda/build.sh         |  1 -
 .conda/meta.yaml        | 11 +++++------
 4 files changed, 13 insertions(+), 39 deletions(-)
 delete mode 100644 .conda/bld.bat
 delete mode 100644 .conda/build.sh

diff --git a/.ci/build_conda_dist.sh b/.ci/build_conda_dist.sh
index 1307a2292..09e188e95 100644
--- a/.ci/build_conda_dist.sh
+++ b/.ci/build_conda_dist.sh
@@ -2,45 +2,23 @@
 
 conda update conda
 conda install setuptools conda-build
+
 cd .conda
 
+mkdir -p ../dist
+
 # get version and name
 version=`python ../setup.py -V`
 name=`python ../setup.py --name`
 
-# get requirements, and make
-# them conda compatible...
-
-# strip all spaces
-reqs=`cat ../requirements.txt ../requirements-dev.txt | sed -e 's/ //g'`
-
-# add a space after package name -
-# package names must match a-zA-Z0-9_
-reqs=`echo "$reqs" | sed -e "s/^[a-zA-Z0-9_][a-zA-Z0-9_]*/& /g"`
-
-# remove ==, replace it with a space
-reqs=`echo "$reqs" | sed -e "s/==/ /g"`
+cat ../requirements.txt     >  requirements.txt
+cat ../requirements-dev.txt >> requirements.txt
 
-# wrap each dep in quotes
-reqs=`echo "$reqs" | sed -e "s/^.*$/'&'/g"`
+echo "{% set name    = '$name' %}"    >  vars.txt
+echo "{% set version = '$version' %}" >> vars.txt
 
-# add a comma at the end
-reqs=`echo "$reqs" | sed -e "s/$/,/g"`
-
-# remove newlines
-reqs=`echo $reqs`
-
-echo "version: $version"
-echo "name:    $name"
-echo "reqs:    $reqs"
-
-echo "{% set name         = 'name' %}"     >  vars.txt
-echo "{% set version      = '$version' %}" >> vars.txt
-echo "{% set requirements = [$reqs] %}"    >> vars.txt
 cat vars.txt meta.yaml > tempfile
 mv tempfile meta.yaml
 rm vars.txt
 
-conda build fslpy
-
-cd ..
+conda build --output-folder=../dist .
diff --git a/.conda/bld.bat b/.conda/bld.bat
deleted file mode 100644
index c40a9bbef..000000000
--- a/.conda/bld.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-"%PYTHON%" setup.py install
-if errorlevel 1 exit 1
diff --git a/.conda/build.sh b/.conda/build.sh
deleted file mode 100644
index a40f1097a..000000000
--- a/.conda/build.sh
+++ /dev/null
@@ -1 +0,0 @@
-$PYTHON setup.py install     # Python command to install the script.
diff --git a/.conda/meta.yaml b/.conda/meta.yaml
index af27c70ef..5c576d5f0 100644
--- a/.conda/meta.yaml
+++ b/.conda/meta.yaml
@@ -2,6 +2,11 @@ package:
   name:    '{{ name }}'
   version: '{{ version }}'
 
+
+build:
+  noarch: python
+  script: python setup.py install --single-version-externally-managed --record=record.txt
+
 source:
   path:
     ../
@@ -10,12 +15,6 @@ requirements:
   build:
     - python
     - setuptools
-    {% for r in requirements %}
-    - {{ r }}
-    {% endfor %}
 
   run:
     - python
-    {% for r in requirements %}
-    - {{ r }}
-    {% endfor %}
-- 
GitLab