Replies: 1 comment
-
Hi @maximlt, please find below my thoughts on the matter:
My best guess is that this issue is caused by a few circumstances happening all at the same time:
That is a way of doing it 😅. Please note that newer versions of
You can do that, but I believe that the easiest solution in my opinion is to use
I created holoviz/holoviews#5634 as an example on how I would implement using |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm reporting what seems to be a bug but as I'm not totally sure I preferred opening a discussion.
I noticed that the holoviews package distributed its
examples
folder twice in its sdist, one at the root and one in./holoviews/
. This is what I've been trying to fix and I've been puzzled by some of the behavior I've observed.The
examples
folder is not included in theholoviews
package source in the Git repository, it is purely a data folder that sits next to the package. However, we distribute it within the package so that distributions include it and users can runholoviews examples
which is a simple command that basically copies theexamples
directory, from the distribution, to the local directory. Super simple way to distribute data, in this case Jupyter notebooks and some data.To include the
examples
folder during the build, there's some code insetup.py
that copies on-the-fly the folder into the package. Thepyct.build.examples
function below just does that, copying./examples
to./holoviews/examples
:(I'm not sure this is the correct way to achieve that, and that might well be the root cause of the issue. Should we instead register a new
Command/SubCommand
and things would work as expected?)Setuptools is configured to
include_package_data
:The
MANIFEST.in
file is set up to graft the newly copied./holoviews/examples
folder:It was previously set to also graft the root
./examples
folder, which led to that folder being included twice in the sdist but also apparently led to that folder correctly being included in the wheel. The snippets I'm sharing in this post are from a branch where the only change I've made is to remove that graft, as I originally thought that was the only issue. It appears that there's more thant that and I don't yet undertand well enough the full build process to debug it properly. Happy to hear anything that would help in that direction! :) Also curious to hear whether there would be a completely different approach to distribution data folders that would be maybe more modern, as the approach used here is I believe a few years old.Here are the commands required to reproduce the issue I'm observing:
This creates an sdist and a wheel. The sdist only contains the
examples* folder once, in
./holoviews/examples. However the *wheel* does not include the
examplesfolder at all :( That's **the issue**. Interestingly, running instead
python -m build --wheel --sdistproduces the output I'm after, where the
examples` folder is included only once in both the sdist and the wheel.Here's the full log of running
python -m build
:Beta Was this translation helpful? Give feedback.
All reactions