Inside the setup.py script I need to create some temporary files for the installation. The natural place to put them would be the “build/” directory. Is there a way to retrieve its path that works if installing via pypi, from source, easy_install, pip, …? Thanks a lot! Answer By default dist…
Tag: distutils
How to copy directory recursively in python and overwrite all?
I’m trying to copy /home/myUser/dir1/ and all its contents (and their contents, etc.) to /home/myuser/dir2/ in python. Furthermore, I want the copy to overwrite everything in dir2/. It looks like distutils.dir_util.copy_tree might be the right tool for the job, but not sure if there’s anything eas…
tokenize in python3.x
I have following codes in python2.x: Now problem is that in python3.x second argument does not exist. I need to call the function operations.eat() before tokenize. How can we perform the above task in python3.x. One idea is to directly call the function tokenize.eat() before ‘tokenize’ statement(l…
Including non-Python files with setup.py
How do I make setup.py include a file that isn’t part of the code? (Specifically, it’s a license file, but it could be any other thing.) I want to be able to control the location of the file. In the original source folder, the file is in the root of the package. (i.e. on the same level as the topm…