11{% set name = "pydsm" %}
2- {% set data = load_setup_py_data() %}
2+ {% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
3+ {% set project = pyproject['project'] %}
34
45package :
56 name : " {{ name|lower }}"
6- version : " {{ data['version'] }}"
7+ version : {{ SETUPTOOLS_SCM_PRETEND_VERSION }}
78
89source :
910 # git_url: https://github.com/CADWRDeltaModeling/pydsm.git
@@ -12,28 +13,29 @@ source:
1213build :
1314 number : 0
1415 noarch : python
15- script : python setup.py install --single-version-externally-managed --record=record.txt
16+ script_env :
17+ - SETUPTOOLS_SCM_PRETEND_VERSION
18+ script : {{ PYTHON }} -m pip install --no-build-isolation --no-deps --ignore-installed -vv .
19+ noarch : python
20+ number : 0
1621 entry_points :
17- - pydsm = pydsm.cli:main
22+ {% for name, reference in project['scripts'].items() %}
23+ - {{ name }} = {{ reference }}
24+ {% endfor %}
1825 # skip: true
1926
2027requirements :
21- build :
22- - python {{ python }}
23- - setuptools
24- {% for dep in data['setup_requires'] %}
25- - {{ dep.lower() }}
26- {% endfor %}
27- # dependencies are defined in setup.py
28- {% for dep in data['install_requires'] %}
28+ host :
29+ - python {{ project['requires-python'] }}
30+ - pip
31+ {% for dep in pyproject['build-system']['requires'] %}
2932 - {{ dep.lower() }}
3033 {% endfor %}
3134 run :
3235 - {{ pin_compatible('python', lower_bound='3.5', upper_bound='4.0') }}
33- # dependencies are defined in setup.py
34- {% for dep in data['install_requires'] %}
36+ {% for dep in project.get('dependencies', []) %}
3537 - {{ dep.lower() }}
36- {% endfor %}
38+ {% endfor %}
3739 test :
3840 imports :
3941 - pydsm
@@ -42,6 +44,9 @@ requirements:
4244 requires :
4345 - pytest
4446 - pytest-cov
47+ {% for dep in project.get("optional-dependencies", {}).get('test', []) %}
48+ - {{ dep.lower() }}
49+ {% endfor %}
4550 commands :
4651 - (setlocal && cd tests && pytest && endlocal) # [win]
4752 - (cd tests; pytest) # [unix]
0 commit comments