From 699dafb5802b541fe0ed68ec1c8885e62ca9633d Mon Sep 17 00:00:00 2001
From: Christopher Rhodes <christopher.rhodes@embl.de>
Date: Wed, 3 Jul 2024 14:20:46 +0200
Subject: [PATCH] Trying several things to read dependencies from
 pyproject.yaml

---
 conda-recipe/meta.yaml | 46 +++++++++++++++++++++++-------------------
 tests/_conf.py         |  4 ----
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml
index e75bc05d..93430101 100644
--- a/conda-recipe/meta.yaml
+++ b/conda-recipe/meta.yaml
@@ -1,10 +1,11 @@
 {% set name = "model_server" %}
 {% set version = "2024.7.1" %}
-{% set pyproject = load_file_data('../pyproject.toml') %}
+{% set pyproject = load_file_data('pyproject.toml') %}
+{% set pp = pyproject.get('project') %}
 
 package:
-  name: {{ name|lower }}
-  version: {{ version }}
+  name: {{ pp.get('name') }}
+  version: {{ pp.get('version') }}
 
 source:
   - path: ../dist/{{ name }}-{{ version }}.tar.gz
@@ -23,23 +24,26 @@ requirements:
     - pip
   run:
     - python >=3.9
-#    - czifile
-#    - fastapi>=0.101.*
-#    - ilastik=1.4.*
-#    - imagecodecs
-#    - jupyterlab
-#    - matplotlib
-#    - numpy=1.*
-#    - pandas=1.*
-#    - pillow
-#    - pydantic=1.10.*
-#    - python=3.9.*
-#    - pytorch=1.*
-#    - scikit-image>=0.21.*
-#    - scikit-learn>=1.3.*
-#    - tifffile
-#    - uvicorn>=0.23.*
-#    - zstd=1.5.5
+#    { % for dep in pyproject["dependencies"] % }
+#    - {{ dep.lower() }}
+#    { % endfor % }
+    - czifile
+    - fastapi>=0.101.*
+    - ilastik=1.4.*
+    - imagecodecs
+    - jupyterlab
+    - matplotlib
+    - numpy=1.*
+    - pandas=1.*
+    - pillow
+    - pydantic=1.10.*
+    - python=3.9.*
+    - pytorch=1.*
+    - scikit-image>=0.21.*
+    - scikit-learn>=1.3.*
+    - tifffile
+    - uvicorn>=0.23.*
+    - zstd=1.5.5
     - pip
 
 
@@ -47,7 +51,7 @@ test:
   imports:
     - model_server
   commands:
-    -{{ PYTHON }} -m unittest model_server
+    - python -m unittest discover
   requires:
     - pip
   source_files:
diff --git a/tests/_conf.py b/tests/_conf.py
index e91920a9..61c211af 100644
--- a/tests/_conf.py
+++ b/tests/_conf.py
@@ -6,10 +6,6 @@ root = os.environ.get(
     Path.home() / 'model_server' / 'testing'
 )
 
-import sys
-print(sys.argv)
-
-
 filename = 'D3-selection-01.czi'
 czifile = {
     'filename': filename,
-- 
GitLab