mamba-org/boa

Support `build/pin_depends`

Opened this issue · 2 comments

For certain kinds of meta-packages, the build/pin_depends option is really useful. It looks like Boa once had support with 95cab54:

boa/boa/cli/new_build.py

Lines 598 to 622 in 95cab54

def write_info_json(m):
info_index = m.info_index()
if m.pin_depends:
# Wtih 'strict' depends, we will have pinned run deps during rendering
if m.pin_depends == 'strict':
runtime_deps = m.meta.get('requirements', {}).get('run', [])
info_index['depends'] = runtime_deps
else:
runtime_deps = environ.get_pinned_deps(m, 'run')
with open(join(m.config.info_dir, 'requires'), 'w') as fo:
fo.write("""\
# This file as created when building:
#
# %s.tar.bz2 (on '%s')
#
# It can be used to create the runtime environment of this package using:
# $ conda create --name <env> --file <this file>
""" % (m.dist(), m.config.build_subdir))
for dist in sorted(runtime_deps + [' '.join(m.dist().rsplit('-', 2))]):
fo.write('%s\n' % '='.join(dist.split()))
# Deal with Python 2 and 3's different json module type reqs
mode_dict = {'mode': 'w', 'encoding': 'utf-8'} if PY3 else {'mode': 'wb'}
with open(join(m.config.info_dir, 'index.json'), **mode_dict) as fo:
json.dump(info_index, fo, indent=2, sort_keys=True)

but it was removed not long after with bbc1713.

Current schema model notes that no usage was found:

# pin_depends: Optional[str] -- did not find usage anywhere, removed

but well, I'd like to use it, and I know the anaconda meta-package also uses it. :-)

wolfv commented

I checked the conda-forge recipes (https://cs.github.com/?scope=org%3Aconda-forge&scopeName=conda-forge&q=pin_depends+language%3Ayaml) and didn't find any usage. We can consider it if you send a PR with a test :)

Hmm, ok. Out of publicly available code, I did find MOOSE using it.