Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including logging.conf in setup.py?

In my package_name subdirectory (one below "setup.py") I have a "logging.conf" file.

How do I include it in my setup?

Attempt

from distutils.sysconfig import get_python_lib

data_files=[(path.join(get_python_lib(), package_name),
                     path.join(path.dirname(__file__), package_name, 'logging.conf'))

Preferably it should be something simple like:

data_files = [(package_name, path.join('.', package_name, 'logging.conf'))]

Error

error: can't copy 'c': doesn't exist or not a regular file

like image 501
A T Avatar asked Oct 12 '25 17:10

A T


1 Answers

Do you want to include logging.conf within your package distribution? Use the package_data argument to setup():

setup(
    name = "package-name",
    packages = ["packagename"],
    package_data= {
        "packagename": [
            "resources/foo.bar",
            "resources/static/css/*",
            "README.md",
            "logging.conf"
        ]},
    ...
    )

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!