storborg / python-packaging

Tutorial on how to structure Python packages
http://www.scotttorborg.com/python-packaging/
438 stars 133 forks source link

Handle files created on the fly. #17

Closed iCHAIT closed 8 years ago

iCHAIT commented 8 years ago

Hi, thanks for this great tutorial, I wanted to ask a question -

My python script which I have packed writes to a file, this file is not shipped with the package so in essence it is created on the fly for the user (that is when he runs the package.).

Now I want to know, how do I handle such a file?

Currently I have not specified it in my setup.py because it has not been shipped with the package, do I need to define it in setup.py and maybe ship it is an empty file?

storborg commented 8 years ago

This isn't really something that Python has strong conventions for, but personally I think:

Also, those files should not be defined in setup.py at all: your setup.py should only reference read-only files which are included with the package.

iCHAIT commented 8 years ago

Thanks a lot :+1:

FIxed using os.path.expanduser("~")