classification
Title: Distutils manifest: recursive-(include|exclude) matches suffix instead of full filename
Type: behavior Stage: patch review
Components: Distutils, Distutils2 Versions: Python 3.3, Python 3.2, Python 2.7, 3rd party
process
Status: open Resolution:
Dependencies: 6884 Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, nadeem.vawda, tarek
Priority: normal Keywords: patch

Created on 2012-02-24 14:46 by nadeem.vawda, last changed 2012-02-25 05:45 by eric.araujo.

Files
File name Uploaded Description Edit
recursive-include.diff nadeem.vawda, 2012-02-24 14:46
Messages (2)
msg154137 - (view) Author: Nadeem Vawda (nadeem.vawda) * (Python committer) Date: 2012-02-24 14:46
As I understand it, a MANIFEST.in directive:

    recursive-include foo bar.*

is meant to match files under foo for with names beginning with "bar.".
However, the actual regex that is generated for this line is:

    r'^foo/.*bar\.[^/]*\Z(?ms)'

which matches any filename under foo that contains "bar." anywhere in the
base filename. For example, if foo contains files bar.py and test_bar.py,
then the pattern will match both filenames. Is this the intended
behaviour? I would have expected it to only match bar.py.

If the desired behavior is what I expected (and not how it currently
works), then the desired regex is:

    r'^foo/(.*/)?bar\.[^/]*\Z(?ms)'

The attached patch (against 2.7) implements this change. It is dependent
on the fix for issue 6884. I have tested it on both Linux and Windows.
msg154187 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-25 05:45
Thanks, will look into it.
History
Date User Action Args
2012-02-25 05:45:21eric.araujosetversions: + 3rd party
nosy: + alexis

messages: + msg154187

assignee: eric.araujo
components: + Distutils, Distutils2
2012-02-24 14:47:24nadeem.vawdasetdependencies: + Impossible to include file in sdist that starts with 'build' on Win32
stage: needs patch -> patch review
2012-02-24 14:46:34nadeem.vawdacreate