templating in conda package for name of package or entrypoint not working

Viewed 74

To build a conda package the meta.yaml file is required which lists i.e. the name of the package, version and entry point and specifies how to build the package.

Also, it supports jinja2-based templating for most parts of the yaml file.

How can I get it to load the package name as well as the entrypoint from a setup.py file?

Given a setup.py file with the following contents:

#!/usr/bin/env python

"""The setup script."""

from setuptools import setup, find_packages


setup(
    entry_points={
        'console_scripts': [
            'foo=foo.cli:main',
        ],
    },
    name='foo',
    packages=find_packages(include=['foo', 'foo.*']),
)

And a meta.yaml of:

{% set data = load_setup_py_data() %}
name: "{{ data['name'] }}"

Why does a conda build of the package fail with:

Error: package/name missing in: '/path/to/conda.recipe/meta.yaml'

Or for a meta.yaml of:

entry_points:
      - "{{ data['entry_points']['console_scripts'] }}"

fail with:
conda_build/build.py", line 1217, in get_entry_point_script_names
    cmd = entry_point[:entry_point.find("=")].strip()
AttributeError: 'NoneType' object has no attribute 'find'
0 Answers
Related