Bug 217238

Summary: devel/py-pathlib2 is missing a dependency on sysutils/py-scandir
Product: Ports & Packages Reporter: Andrew Turner <Andrew>
Component: Individual Port(s)Assignee: Ruslan Makhmatkhanov <rm>
Status: Closed FIXED    
Severity: Affects Some People CC: rene, rm, swills, yuri
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
proposed patch none

Description Andrew Turner freebsd_committer freebsd_triage 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 freebsd_triage 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 freebsd_triage 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 freebsd_triage 2017-02-20 22:40:09 UTC
Created attachment 180176 [details]
proposed patch
Comment 4 commit-hook freebsd_committer freebsd_triage 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

Log:
  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

Changes:
  head/devel/py-pathlib2/Makefile
Comment 5 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2017-02-24 20:55:44 UTC
Fix committed, thank you!