AnswerDotAI / AnswerDotAI/nbdev

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

Offen
#1,387 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
Jupyter Notebook
Sterne
5.3k
Forks
513
Ø Merge
2 T. 30 Min.
Gemergte PRs (30 T.)
8

Beschreibung

## Crux of the issue
In [`nbdev.release._get_conda_meta`](https://github.com/fastai/nbdev/blob/master/nbdev/release.py#L196-L234)
lines [`220-233`](https://github.com/fastai/nbdev/blob/master/nbdev/release.py#L220-L233) we have the following:

```python
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](https://github.com/fastai/nbdev/blob/master/nbdev/release.py#L224C9-L224C50)

```python
'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](https://github.com/conda-archive/conda-recipes/blob/main/bedtools/meta.yaml#L5-L7)).

## 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:

- [`release_conda(...)`](https://github.com/fastai/nbdev/blob/master/nbdev/release.py#L262-L289)
- [`write_conda_meta(path='conda')`](https://github.com/fastai/nbdev/blob/master/nbdev/release.py#L237-L239)
- [`_get_conda_meta()`](https://github.com/fastai/nbdev/blob/master/nbdev/release.py#L196-L234)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie in nbdev/release.py mit _get_conda_meta, write_conda_meta und release_conda und verfolgen Sie dann, wie nbdev_conda meta.yml generiert. Prüfen Sie das vorhandene generierte Dictionary und den vorgeschlagenen Workflow für benutzerdefinierte Dateien; am Ende sollte eine dokumentierte Möglichkeit bereitstehen, die Conda-Metadaten anzupassen, ohne automatisch aktualisierte Werte zu verlieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system, release
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.