I’m not sure if my description is good but I’ll elaborate. I want to use dhall to generate conda meta.yaml files to make Python conda packages. A typical file looks like this:
{% set name = "click" %}
{% set version = "7.0" %}
package:
name: "{{ name|lower }}"
version: "{{ version }}"
source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7
build:
number: 0
script: "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv "
requirements:
host:
- pip
- python
run:
- python
test:
imports:
- click
about:
home: https://palletsprojects.com/p/click/
license: BSD
license_family: BSD
summary: Composable command line interface toolkit
I eventually figured out how to write a dhall version of everything except the first two lines. How would I do that? Tangentially, is yaml-to-dhall supposed to be installed separately? I only have dhall-to-json, json-to-dhall, and dhall-to-yaml.
-- I wrote this but have no idea how to integrate it.
let x = "{% set name = 'click' %}"
let y = "{% set version = '7.0' %}"
let package = { name = "{{ name|lower }}", version = "{{ version }}"}
let source = {
url = "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz",
sha256 = "5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"
}
let build = {
number = 0,
script = "{{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv "
}
let requirements = {host = ["pip", "python"], run = ["pip"]}
let tests = {imports = ["click"]}
let about = {
home = "https://palletsprojects.com/p/click/",
license = "BSD",
license_family = "BSD",
summary = "Composable command line interface toolkit"
}
in {package, source, requirements, tests, about}