You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understand it, the intention is to install the game assets when I run setup.py install. That isn't happening though. I think the reason is that package_data is intended for installing data files that belong to a particular Python library to be installed along with it. The data files are all in data/, images/, etc. which are not Python packages (setuptools.find_packages() doesn't find them), so they aren't considered for inclusion in the install.
I'm don't have very much experience with packaging Python applications, but I see a few options:
Just delete that section from the setup.py since as far as I can tell it doesn't do anything. That would leave the responsibility of installing the data files to the packager.
Fix the installer so that it does install the data files. I'm not sure how to do this, but I think it would involve turning the data/, images/, etc. directories into Python packages. This would mean that they would get installed along with the other packages into /usr/lib/python/site-packages, and the code would have to change to use the ResourceManager API to get the data files (basically, leverage Python's import system to load image files and other data files). This sounds complicated and I'm not sure if it's worth it. I tried to write a patch that does this, but with my limited Python packaging experience I got stuck.
Is there a way to just tell setup.py to copy these files to /usr/share even though they're not part of any packages? That makes sense to me, and it's how make install would do it, but I haven't found a way to do that when I read the setuptools docs.
The text was updated successfully, but these errors were encountered:
xordspar0
changed the title
Package data
Package data is not copied during setup.py installJun 5, 2020
I'm working on packaging Gearhead Caramel for Arch in the AUR. In the process, I saw this section in setup.py:
gearhead-caramel/setup.py
Lines 11 to 16 in 25c29c9
As I understand it, the intention is to install the game assets when I run
setup.py install
. That isn't happening though. I think the reason is thatpackage_data
is intended for installing data files that belong to a particular Python library to be installed along with it. The data files are all in data/, images/, etc. which are not Python packages (setuptools.find_packages() doesn't find them), so they aren't considered for inclusion in the install.I'm don't have very much experience with packaging Python applications, but I see a few options:
Just delete that section from the setup.py since as far as I can tell it doesn't do anything. That would leave the responsibility of installing the data files to the packager.
Fix the installer so that it does install the data files. I'm not sure how to do this, but I think it would involve turning the data/, images/, etc. directories into Python packages. This would mean that they would get installed along with the other packages into /usr/lib/python/site-packages, and the code would have to change to use the ResourceManager API to get the data files (basically, leverage Python's import system to load image files and other data files). This sounds complicated and I'm not sure if it's worth it. I tried to write a patch that does this, but with my limited Python packaging experience I got stuck.
There are docs on this:
package_data
Is there a way to just tell setup.py to copy these files to /usr/share even though they're not part of any packages? That makes sense to me, and it's how
make install
would do it, but I haven't found a way to do that when I read the setuptools docs.The text was updated successfully, but these errors were encountered: