Closed guiwitz closed 5 months ago
hm. It may be a bug in template.
Did you configure project to use setuptools_scm
? If yes then these lines should be obsolete:
[tool.setuptools.dynamic]
version = {attr = "napari_skimage.__init__.__version__"}
at least my project does not contain them https://github.com/4DNucleome/PartSeg/blob/develop/pyproject.toml
Yes I did select the setuptools_scm
. Indeed just commenting out these lines fixes the problem (even without a setup.cfg
file), so I guess this should only be present if not using setuptools_scm. I made a plugin without the setuptools_scm option and the editable install works. I guess this should solve the issue (I'm not very familiar with cookiecutter syntax)?:
{% if cookiecutter.use_git_tags_for_versioning == 'y' -%}
[tool.setuptools.dynamic]
version = {attr = "{{cookiecutter.module_name}}.__init__.__version__"}
{%- endif %}
Thanks!
I created a plugin using the cookiecutter and specifying the versioning should be done with setuptools_scm. Then doing an editable install fails, with an error message ending with
ModuleNotFoundError: No module named 'napari_skimage'
wherenapari_skimage
is my plugin name.It seems that I ran into exactly this problem, where there's an attempt to import the package (which is not yet installed) by this line in the toml file:
It's not clear to me exactly how this can be fixed (it might be related to the difficulty of importing a package in the
src
structure). It seems to be a known issue as there's a specific note in the setuptools docs:that is not very helpful to me.
In the meantime, I managed to make an editable install by commenting out this in the toml file:
and adding back a
setup.cfg
file with: