Where can I put the conda recipe in relation to my project?

I created a python project that I want to build using conda, however I get an error when sending cd to the conda-recipe folder and run conda build .that setup.py file was not found. I tried to move the conda recipe to the same level as setup.py and add the original section to my meta.yaml, but I still get the error. Where is the best place for a conda recipe in relation to my python package?

Here is my project structure:

- MyProject/
  |- conda-recipe/
    |- bld.bat
    |- build.sh
    |- meta.yaml
  |- code/
    |- subpackage/
      |- __init__.py
      |- foo.py
  |- tests/
    |- test_foo.py
  |-setup.py

Here is the contents of my bld.bat:

"%PYTHON%" setup.py sdist install
if errorlevel 1 exit 1

And build.sh:

#!/bin/bash

$PYTHON setup.py sdist install     

And meta.yaml:

package:
  name: myproject
  version: "1.0.0" 

source:
  path: ../code

requirements:
  build:
    - python
    - setuptools

  run:
    - python
    - argparse

And for completeness, there is an error here:

(C:\Anaconda2\conda-bld\myproject_1492545717354\_b_env) C:\Anaconda2\conda-bld\myproject_1492545717354\work>"C:\Anaconda2\conda-bld\myproject_1492545717354\_b_env\python.exe" setup.py sdist install C:\Anaconda2\conda-bld\myproject_1492545717354\_b_env\python.exe: can't open file 'setup.py': [Errno 2] No such file or directory
+4
source share
1 answer

IIUC, - , .

path . "MyProject", ...

path: ../code 

path: ../../

, , $RECIPE_DIR :

path: $RECIPE_DIR/../..
+3

Source: https://habr.com/ru/post/1675089/


All Articles