This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: setup.py sdist mishandles package_dir option
Type: behavior Stage:
Components: Distutils Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, glep
Priority: normal Keywords:

Created on 2016-02-26 18:26 by glep, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg260904 - (view) Author: glep (glep) Date: 2016-02-26 18:26
Suppose I have a setup.py with the option

   ...
   packages=['package', 'package.utils'],
   package_dir={'package.utils', '../utils'},
   ...

as would arise if ../utils was a package shared between several projets ('package', 'package1', ...).

I would expect the source distribution created by 'python setup.py sdist'
to create an archive with the following structure:

   /
   |-- package/
   |-- package/utils

And this is indeed what *bdist* does. BUT *sdist* copies '../utils' in 'package/../utils' instead of 'package/utils', with the result that utils is outside of the distribution altogether. 

The issue is referenced in a couple of StackOverflow posts that have attracted little attention so far, for example:

http://stackoverflow.com/questions/35510972/inconsistent-behaviour-of-bdist-vs-sdist-when-distributing-a-python-package
msg261056 - (view) Author: glep (glep) Date: 2016-03-01 16:17
Actually I have come to realise that this is the intended behaviour for source distributions. And that it is simply not possible to pull in a package from outside the current top-level package when building a source distribution.
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70632
2016-03-01 16:17:05glepsetstatus: open -> closed
resolution: not a bug
messages: + msg261056
2016-02-26 18:26:33glepcreate