Closed Karol-G closed 2 years ago
When I had this issue it was because include_package_data
was in the wrong place, but as far as I can tell everything looks fine :/ @tlambert03 @nclack hopefully can spot the issue :)
very sorry about this @Karol-G ... this is an issue caused by the src
layout used in the cookiecutter. I'll submit a fix.
The solution for you is to change the [options.package_data]
entry. You can either just delete it entirely (since include_package_data = True
in the [options]
section is sufficient in this basic case), or to explicitly include all yaml files regardless of where they are, change it to:
[options.package_data]
* = *.yaml
This worked for me, thanks!
[options.package_data]
* = *.yaml
actually... strangely enough, I don't actually get this problem when I build the cookiecutter:
[options]
packages = find:
include_package_data = True
python_requires = >=3.8
package_dir =
=src
# add your package requirements here
install_requires =
numpy
[options.packages.find]
where = src
[options.package_data]
napari-foobar =
napari.yaml
[options.entry_points]
napari.manifest =
napari-foobar = napari_foobar:napari.yaml
so, I guess I'm a still a little stumped as to why your first setup.cfg didn't work. but I'll update it to the more general package data just in case
Hi,
I created a widget plugin with cookiecutter. However, after generating a wheel with
python -m build
and trying to install it withpip install dist\DKFZ_random_forest_noise_removal-0.0.1-py3-none-any.whl
, I get the following error:napari.manifest -> 'dkfz_random_forest_noise_removal:napari.yaml' could not be imported: Could not find file 'napari.yaml' in module 'dkfz_random_forest_noise_removal'
.I used the cookiecutter version 1.7.3.
This is the setup.cfg:
This is the napari.yaml located in src/dkfz_random_forest_noise_removal/napari.yaml:
Any idea why napari.yaml cannot be found?
Best, Karol