I'm working on building my first Python package for a client to use. At the most, I am envisioning the user pulling the code from GitHub, then pip installing (pip install .
). This package will be used in a Windows environment. What is the convention or where is the easiest place to put log files? Is there a way to tell setup.py
to make a log directory that is easily accessible for the user?
For a more specific example, let's say I had the code base locally at C:\Users\iamuser\projects\client_project
. I pip install .
while in the client_project
directory. There is a logs\
directory (C:\Users\iamuser\projects\client_project\logs
) that I'd like the log files to be placed into. Is there a way to have my setup.py
place log files in that directory? If not, are there any other tools I should try?
I have tried something like this, but any paths acquired while running setup are not where the original setup.py
file was located (example: os.path.abspath(__file__)
shows some other location than within the client_project
directory).