pypa / distutils

distutils as found in cpython

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better support of output directories

jaraco opened this issue · comments

I think what this function is really trying to achieve is to ensure that object filenames are stored somewhere in the "output_dir", even if the source files are indicated by an absolute path. According to the docs, the files should be stored relative to their originally specified path in the output dir, but that example only considers relative paths. And to make matters worse, the default output dir is "", meaning the current working directory.

I think three things need to happen:

  • Remove the deprecation warning.
  • Instead of simply replacing an absolute path with a relative one, calculate the best path relative to the output dir (so a temp path doesn't appear twice).
  • If an output dir is not specified, the output dir should default to the dir where the source file is found.

Originally posted by @jaraco in #169 (comment)

There were several problems identified in #169, including that temp paths get duplicated, causing very long, sometimes invalid paths.