[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"How to package additional files under site-packages "

My package (ibm_db) has LICENSE, README.md and CHANGES files that I want to be available in the same location as my package is installed I.e under site-packages. However, with current setup.py https://github.com/ibmdb/python-ibmdb/blob/master/IBM_DB/ibm_db/setup.py, these files get installed under python install path.
e.g: C:\Users\skauser\AppData\Local\Programs\Python\Python36\LICENSE

I have specified them as:
data_files = [ ('', ['./README.md']),
               ('', ['./CHANGES']),
               ('', ['./LICENSE']) ]

package_data = package_data,
       data_files   = data_files,
       include_package_data = True,
      cmdclass = cmd_class,

Since the directory path is empty, these files get copied under current path of execution. However, I want them to be copied under the install location of my package.
Is there any other way I can achieve this?


-----Original Message-----
From: dieter <dieter at handshake.de>
Sent: Tuesday, March 5, 2019 12:04 PM
To: python-list at python.org
Subject: Re: "How to package additional files under site-packages "

Saba Kauser <skauser at rocketsoftware.com> writes:
> ...
> I want data_files to be copied under my package install path.
> How do I achieve this?

You could look at one of my packages (i.e. "dm.*", e.g. "dm.pdb").

Essentially, I have the data files besides the Python sources and let "setuptools" determine the relevant files (sources and data) as those managed via a source code control system (=SCCS). For the latter to work, your Python must have installed the integration module for your SCCS.

Rocket Software, Inc. and subsidiaries ? 77 Fourth Avenue, Waltham MA 02451 ? Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support: https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy

This communication and any attachments may contain confidential information of Rocket Software, Inc. All unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify Rocket Software immediately and destroy all copies of this communication. Thank you.