Search code examples
pythonpython-3.xpipsetuptoolssetup.py

How to include setup.py absolute path in PKG-INFO?


I am trying to add my project location as part of PKG-INFO. I wanted that information to create some other relative paths which contains some resource files. I could keep those folder as package_data or data_files, But every time i modify files i need to do python setup.py install as well. So if I could add setup.py abosolute path as part of metadata, I could parse that and form path to my required folders.

import os

from setuptools import setup, find_packages
setup(
   name='myproject',
   packages=find_packages(),
   long_description=os.path.dirname(__file__)
)

This is part of my setup.py. But while installing above setup.py by python setup.py install in the PKG-INFO file description=UNKNOWN is coming. How to add this ?


Solution

  • I just changed the long_description to os.path.realpath instead of os.path.dirname(__file__) and it worked!

    import os
    
    from setuptools import setup, find_packages
    setup(
       name='myproject',
       packages=find_packages(),
       long_description=os.path.realpath(__file__)
    )
    

    What could be the difference ?