Search code examples
pythonpipanacondacondaconda-build

conda-build error: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found


Hej all,

I am trying to build a conda package for a little program I wrote. When I run conda-build, I get the error Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.

I have researched this for some hours now (found the similar questions here, none of which solved my issue) and played with the meta.yaml file (below), but I didn't manage to get it to work. Does anyone have an idea what could be going on here?

meta.yaml:

{% set name = "genview" %}
{% set version = "1.0" %}

package:
  name: "{{ name|lower }}"
  version: "{{ version }}"

source:
  git_url: https://github.com/EbmeyerSt/GEnView.git

build: 
  number: 0
  script: python -m pip install --no-deps --ignore-installed .

requirements:
  host:
    - pip
    - python=3.6
  run:
    - python=3.6
    - pip
    - pandas
    - biopython >=1.68
    - numpy
    - time
    - sqlite
    - argparse
    - prodigal
    - diamond
    - blast
    - cd-hit
    - fasttree

test:
  commands:
          - genview_create_db.py --help

about:
  home: https://github.com/EbmeyerSt/GEnView.git
  license: GPLv3.0
  license_family: GPL3
  summary: Visualization tool for genomic sequences surrounding a gene

directory structure:

../genview:
  -script.py
  -Readme.txt
   /conda_receipe:
     -meta.yaml

To build the package, I run conda-build /conda_receipe from the genview directory. Does anyone have an idea what is going on here? Any clues would be appreciated!


Solution

  • According to the packaging scheme, you need a setup.py or a pyproject.toml in your project. They are configuration files to generate a package.

    If you want to use a setup.py file, it is better to use setuptools:

    from setuptools import setup
    
    setup(...)  # add your setuptools options
    

    (See the reference for setuptools usage here).

    However, if you want to use a pyproject.toml instead, you can refer to the build project. You will have to write the pyprojet.toml file (which is an INI-like file).

    See an example of using these files on this repository. It uses both files, so take a look on it to get an idea.