Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No configuration options for meta.yml used by nbdev_conda, immediate fix required. #1387

Open
dsm-72 opened this issue Nov 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@dsm-72
Copy link
Contributor

dsm-72 commented Nov 20, 2023

Crux of the issue

In nbdev.release._get_conda_meta
lines 220-233 we have the following:

d2 = {
        'build': {'number': '0', 'noarch': 'python',
                  'script': '{{ PYTHON }} -m pip install . -vv'},
        'requirements': {'host':hostreqs, 'run':reqs},
        'test': {'imports': [cfg.lib_path.name]},
        'about': {
            'license': 'Apache Software',
            'license_family': 'APACHE',
            'home': dev_url, 'doc_url': doc_url, 'dev_url': dev_url,
            'summary': cfg.get('description'),
            'description': descr
        },
        'extra': {'recipe-maintainers': [cfg.get('user')]}
    }

This stands in stark contrast to other nbdev autogenerated documents and files which allow for the user to edit them without overwriting their edits (e.g. in __init__.py files of your package.

Why is this a problem?

Line 224

'test': {'imports': [cfg.lib_path.name]},

If for whatever reason, whatsoever Conda's test environment can not make your package run (even if it passes conda verify locally), your release with nbdev will fail and all of your configuration options required to make the test pass are locked out. Of course you can make your own meta.yml file and build it independently, but the point is that this line makes nbdev_conda a very frustrating API.

While commenting out the test section may be in poor form, looking through the official conda-archive/conda-recipes one can find no shortage or examples just commenting out the test section (e.g. this one).

Proposed solutions

  • immediate fix: add a --meta argument to nbdev_conda that lets users point to a custom meta.yml file.
  • short term: have that file serve as a template i.e. merge dictionary keys, so that way things like "version" still get updated automatically
  • long term: make meta.yml consistent with other autogenerated docs.

Resources and References

Some key functions inside nbdev can be found here:

@dsm-72 dsm-72 added the bug Something isn't working label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant