Skip to content

Commit

Permalink
Fix: change definition of pkg_type variable in build function to solv…
Browse files Browse the repository at this point in the history
…e KeyError: 'conda' (#5560)

Co-authored-by: jaimergp <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent 0ad39dd commit 56a2a80
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
5 changes: 4 additions & 1 deletion conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,10 @@ def build(
# can be different from the env for the top level build.
with utils.path_prepended(m.config.build_prefix):
env = environ.get_dict(m=m)
pkg_type = "conda" if not hasattr(m, "type") else m.type
pkg_type = (
getattr(m, "type", m.config.conda_pkg_format)
or CondaPkgFormat.V2
)
newly_built_packages = bundlers[pkg_type](
output_d, m, env, stats, new_prefix_files
)
Expand Down
19 changes: 19 additions & 0 deletions news/5560-fix-pkg-type-key-error
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* Fix `KeyError` when an inconsistent `build.pkg_type` value is specified in `meta.yaml`. (#5560)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>

0 comments on commit 56a2a80

Please sign in to comment.