Bug 216953 - devel/py-setuptools: egg_info fails under python 3.4.6 on nonexistent MANIFEST graft
Summary: devel/py-setuptools: egg_info fails under python 3.4.6 on nonexistent MANIFES...
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on: 217044
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-10 01:03 UTC by John W. O'Brien
Modified: 2017-06-24 14:25 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (python)


Attachments
Terminal capture showing passing and failing examples (1.23 KB, text/plain)
2017-02-10 01:03 UTC, John W. O'Brien
no flags Details
devel/py-setuptools: Backport graft glob support from 34.0.1 (3.52 KB, patch)
2017-02-12 21:36 UTC, John W. O'Brien
no flags Details | Diff
devel/py27-setuptools: Backport graft glob support from 34.0.1 (3.56 KB, patch)
2017-03-25 15:45 UTC, John W. O'Brien
john: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John W. O'Brien 2017-02-10 01:03:47 UTC
Created attachment 179814 [details]
Terminal capture showing passing and failing examples

When the MANIFEST.in file contains a graft statement that refers to a directory that does not exist, the egg_info command will fail when run under python 3.4.6.

Expected behavior:

    setuptools warns on the nonexistent directory

Observed behavior:

    setuptools exits with an error on the nonexistent directory due to an unhandled `FileNotFoundError` exception

How to reproduce:

    export DISTUTILS_DEBUG=yes
    echo "graft nope" > MANIFEST.in
    python3.4 \
        -c "from setuptools import setup; setup(name='x', version='0.1.0')" \
        sdist

See the attached sample output comparing output between `distutils.core.setup` and `setuptools.setup` across all versions of python currently supported on FreeBSD. Only the combination of `setuptools` with python 3.4.6 exhibit this problem.

N.B. I believe the underlying problem is where `setuptools.commands.egg_info` uses `distutils.filelist.findall`. I chose to demonstrate the problem with the sdist command because that is the only `distutils` command that uses `distutils.filelist.findall`.

See some background on this bug on the freebsd-python list [0].

[0] https://lists.freebsd.org/pipermail/freebsd-python/2017-January/011524.html
Comment 1 John W. O'Brien 2017-02-12 02:06:48 UTC
I believe I have isolated this to versions of setuptools prior to v34.0.1. At and after that point, setuptools switches to using a glob [0] which avoids triggering the changed behavior in python 3.4.6.

Therefore, upgrading the port to v34.0.1 or later would resolve this issue.

[0] https://github.com/pypa/setuptools/commit/9cb83c3711d737fa3bff56f55e4def8267bae83c
Comment 2 Wen Heping freebsd_committer freebsd_triage 2017-02-12 15:02:33 UTC
(In reply to John W. O'Brien from comment #1)
Would you file a PR to update py-setuptools to 34.1.1 ?

wen
Comment 3 John W. O'Brien 2017-02-12 16:22:54 UTC
(In reply to Wen Heping from comment #2)

I'll be glad to give it a shot. Given [0], and that a tarball is consequently no longer published to PyPI, do you have an initial sense of the best way to proceed? I'm thinking switch to GH, start using the bootstrap.py script, and figure out how to satisfy the pip dependency.

[0] https://github.com/pypa/setuptools/blob/master/CHANGES.rst#v3400
Comment 4 Antoine Brodin freebsd_committer freebsd_triage 2017-02-12 20:03:04 UTC
Remove dependency on bug #217044

The upgrade to 34.x will probably be hard,  while this bug may only need to cherry-pick a commit.
Comment 5 John W. O'Brien 2017-02-12 21:36:39 UTC
Created attachment 179918 [details]
devel/py-setuptools: Backport graft glob support from 34.0.1

QA
==

portlint: OK -- two pre-existing warnings
poudriere testport: OK -- py2.7 (default), py3.4, py3.5, py3.6
Comment 6 John W. O'Brien 2017-02-12 21:48:58 UTC
(In reply to John W. O'Brien from comment #1)

A correction to my earlier comment. Setuptools actually restored the glob function in [0], which is what avoids the underlying problem with python 3.4.6. [1] simply changes how the glob feature is implemented. In the patch I attached, I backport the earlier commit but not the later one.

[0] https://github.com/pypa/setuptools/commit/56274b32724933cd2016488c4e667e86d30572ef
[1] https://github.com/pypa/setuptools/commit/9cb83c3711d737fa3bff56f55e4def8267bae83c
Comment 7 John W. O'Brien 2017-03-25 15:45:34 UTC
Created attachment 181190 [details]
devel/py27-setuptools: Backport graft glob support from 34.0.1

Refresh patch following ports r436290 and ports r436350.
Comment 8 John W. O'Brien 2017-06-24 14:25:36 UTC
Resolved by upgrade to setuptools 36.0.1 (bug #219876)