Bug 217238 - devel/py-pathlib2 is missing a dependency on sysutils/py-scandir
Summary: devel/py-pathlib2 is missing a dependency on sysutils/py-scandir
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Ruslan Makhmatkhanov
Depends on:
Reported: 2017-02-19 20:29 UTC by Andrew Turner
Modified: 2017-02-24 20:55 UTC (History)
4 users (show)

See Also:

proposed patch (754 bytes, patch)
2017-02-20 22:40 UTC, Antoine Brodin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Turner freebsd_committer 2017-02-19 20:29:15 UTC
Python earlier than 3.5 is unable to use pathlib2 due to a missing dependency. I'm getting the following error when I try to import it.

% python2
Python 2.7.13 (default, Jan  5 2017, 01:52:49) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.9.1 (tags/RELEASE_391/final 289601)] on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/pathlib2.py", line 46, in <module>
    from scandir import scandir as os_scandir
ImportError: No module named scandir

It seems pathlib2 2.2.1 added a dependency in https://github.com/mcmtroffaes/pathlib2/commit/ebc97b37d4f3441624eaef0a17b97470c7264d06#diff-26e76055fe3b754cfe171b269e04d00c. It tries to use the new python 3.5 os.scandir, then if that fails uses scandir.scandir.
Comment 1 Rene Ladan freebsd_committer 2017-02-19 20:46:28 UTC
So if I understand correctly the problem is in py-pathlib2, not in py-scandir?
Comment 2 Andrew Turner freebsd_committer 2017-02-19 21:20:38 UTC
Correct, it seems bugzilla added you as sysutils/py-scandir is in the summary.
Comment 3 Antoine Brodin freebsd_committer 2017-02-20 22:40:09 UTC
Created attachment 180176 [details]
proposed patch
Comment 4 commit-hook freebsd_committer 2017-02-24 20:55:15 UTC
A commit references this bug:

Author: rm
Date: Fri Feb 24 20:54:40 UTC 2017
New revision: 434748
URL: https://svnweb.freebsd.org/changeset/ports/434748

  devel/py-pathlib2: add missing dependency

  Add dependency upon sysutils/py-scandir, because it required for
  python < 3.5. Bump PORTREVISION.

  PR:		217238
  Submitted by:	antoine
  Reported by:	Andrew
  Approved by:	portmgr (blanket approval)
  MFH:		2017Q1

Comment 5 Ruslan Makhmatkhanov freebsd_committer 2017-02-24 20:55:44 UTC
Fix committed, thank you!