Justin Uang <[email protected]> writes: > What is the recommended way to get access to a data file in my package > if I'm using a wheel? pkg_resources seems like it's mainly useful > because eggs might be used in a zipped form, but for wheels, I'm > guaranteed that the data will be unpacked into a directory structure > right? In that case, should I just use __file__ to manually find the > location of the file?
An advantage of querying package resources using the ‘pkg_resources’ API is that their lockation *doesn't* need to be known by your program. Let the installation process put them in a sensible location for the system, and discover that location at run-time using ‘pkg_resources’. > I'm assuming I can still use pkg_resources, but it feels like I'm > adding an unnecessary dependency on setuptools, given that setuptools > isn't needed during installation but only when building the wheel. You'll be doing the recipient a favour by allowing the package resources to be in a different place from the executable files. -- \ “Philosophy is questions that may never be answered. Religion | `\ is answers that may never be questioned.” —anonymous | _o__) | Ben Finney _______________________________________________ Distutils-SIG maillist - [email protected] https://mail.python.org/mailman/listinfo/distutils-sig
