Skip to content

Instantly share code, notes, and snippets.

@jakirkham
Last active November 3, 2017 20:19
Show Gist options
  • Save jakirkham/726ed57f1fef0c94fce22b7429124730 to your computer and use it in GitHub Desktop.
Save jakirkham/726ed57f1fef0c94fce22b7429124730 to your computer and use it in GitHub Desktop.
WIP: A skeleton for generating conda-forge recipes.
{% set data = load_setup_py_data() %}
package:
name: {{ data.get('name').lower() }}
version: "{{ data.get('version') }}"
build:
number: 0
noarch: python
script: python setup.py install --single-version-externally-managed --record=record.txt
{% if 'entry_points' in data.keys() and 'console_scripts' in data['entry_points'] %}
entry_points:
{% for each_console_script in data['entry_points']['console_scripts'] %}
- {{ each_console_script }}
{% endfor %}
{% endif %}
requirements:
build:
- python
- setuptools
{% for req in data.get('setup_requires', []) %}
- {{ req.replace(">= ", ">=") }}
{% endfor %}
run:
- python
{% for req in data.get('install_requires', []) %}
- {{ req.replace(">= ", ">=") }}
{% endfor %}
test:
{% if data.get('tests_require', []) %}
requires:
{% for req in data['tests_require'] %}
- {{ req }}
{% endfor %}
{% endif %}
{% if data.get('packages', []) %}
imports:
{% for req in data['packages'] %}
- {{ req }}
{% endfor %}
{% endif %}
about:
{% if data.get('url', '') %}
home: {{ data['url'] }}
{% endif %}
{% if data.get('license', '') %}
license: {{ data['license'] }}
{% endif %}
license_file: LICENSE.txt
{% if data.get('description', '') %}
summary: {{ data['description'] }}
{% endif %}
#extra: {{ data }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment