Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Sep 2017 14:45:59 +0000 (UTC)
From:      Rene Ladan <rene@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r450995 - in head/sysutils/py-scandir: . files
Message-ID:  <201709301445.v8UEjx4T092583@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rene
Date: Sat Sep 30 14:45:58 2017
New Revision: 450995
URL: https://svnweb.freebsd.org/changeset/ports/450995

Log:
  sysutils/py-scandir: update to 1.6
  
  Add a patch to somewhat deal with Unicode tests, they still fail but
  this might be unrelated to the port itself.
  
  Sort USES before USE_*
  
  Submitted by:	portscout

Added:
  head/sysutils/py-scandir/files/
  head/sysutils/py-scandir/files/patch-test_test__scandir.py   (contents, props changed)
Modified:
  head/sysutils/py-scandir/Makefile
  head/sysutils/py-scandir/distinfo

Modified: head/sysutils/py-scandir/Makefile
==============================================================================
--- head/sysutils/py-scandir/Makefile	Sat Sep 30 13:23:29 2017	(r450994)
+++ head/sysutils/py-scandir/Makefile	Sat Sep 30 14:45:58 2017	(r450995)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	scandir
-PORTVERSION=	1.5
+PORTVERSION=	1.6
 DISTVERSIONPREFIX=	v
 CATEGORIES=	sysutils python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -12,11 +12,11 @@ COMMENT=	Fast and featureful directory iterator
 
 LICENSE=	BSD3CLAUSE
 
-USE_GITHUB=	yes
-GH_ACCOUNT=	benhoyt
-
 USES=		python
 USE_PYTHON=	autoplist distutils
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	benhoyt
 
 do-test:
 	${PYTHON_CMD} ${WRKSRC}/test/run_tests.py

Modified: head/sysutils/py-scandir/distinfo
==============================================================================
--- head/sysutils/py-scandir/distinfo	Sat Sep 30 13:23:29 2017	(r450994)
+++ head/sysutils/py-scandir/distinfo	Sat Sep 30 14:45:58 2017	(r450995)
@@ -1,3 +1,3 @@
-TIMESTAMP = 1487840889
-SHA256 (benhoyt-scandir-v1.5_GH0.tar.gz) = 3b2be74e0be665d22adaf841d1cadab7ed4aa2001a9bb81452e0f498cd0780d8
-SIZE (benhoyt-scandir-v1.5_GH0.tar.gz) = 28100
+TIMESTAMP = 1506772140
+SHA256 (benhoyt-scandir-v1.6_GH0.tar.gz) = 4a84e86c1d1632a8960c3db8686296de048337263406d12e66145e753e078798
+SIZE (benhoyt-scandir-v1.6_GH0.tar.gz) = 29401

Added: head/sysutils/py-scandir/files/patch-test_test__scandir.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/py-scandir/files/patch-test_test__scandir.py	Sat Sep 30 14:45:58 2017	(r450995)
@@ -0,0 +1,69 @@
+--- test/test_scandir.py.orig	2017-09-29 12:38:51 UTC
++++ test/test_scandir.py
+@@ -14,6 +14,9 @@ try:
+ except ImportError:
+     has_scandir = False
+ 
++reload(sys)
++sys.setdefaultencoding('utf8')
++
+ FILE_ATTRIBUTE_DIRECTORY = 16
+ 
+ TEST_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), 'testdir'))
+@@ -48,24 +51,24 @@ def create_file(path, contents='1234'):
+ def setup_main():
+     join = os.path.join
+ 
+-    os.mkdir(TEST_PATH)
+-    os.mkdir(join(TEST_PATH, 'subdir'))
++    os.makedirs(TEST_PATH)
++    os.makedirs(join(TEST_PATH, 'subdir'))
+     create_file(join(TEST_PATH, 'file1.txt'))
+     create_file(join(TEST_PATH, 'file2.txt'), contents='12345678')
+ 
+-    os.mkdir(join(TEST_PATH, 'subdir', 'unidir\u018F'))
++    os.makedirs(join(TEST_PATH, 'subdir', u'unidir\u018F'))
+     create_file(join(TEST_PATH, 'subdir', 'file1.txt'))
+-    create_file(join(TEST_PATH, 'subdir', 'unicod\u018F.txt'))
++    create_file(join(TEST_PATH, 'subdir', u'unicod\u018F.txt'))
+ 
+-    create_file(join(TEST_PATH, 'subdir', 'unidir\u018F', 'file1.txt'))
++    create_file(join(TEST_PATH, 'subdir', u'unidir\u018F', 'file1.txt'))
+ 
+-    os.mkdir(join(TEST_PATH, 'linkdir'))
++    os.makedirs(join(TEST_PATH, 'linkdir'))
+ 
+ 
+ def setup_symlinks():
+     join = os.path.join
+ 
+-    os.mkdir(join(TEST_PATH, 'linkdir', 'linksubdir'))
++    os.makedirs(join(TEST_PATH, 'linkdir', 'linksubdir'))
+     create_file(join(TEST_PATH, 'linkdir', 'file1.txt'))
+ 
+     os.symlink(os.path.abspath(join(TEST_PATH, 'linkdir', 'file1.txt')),
+@@ -217,7 +220,7 @@ class TestMixin(object):
+         self.assertTrue(isinstance(entry.path, bytes))
+ 
+         # b'unicod?.txt' on Windows, b'unicod\xc6\x8f.txt' (UTF-8) or similar on POSIX
+-        entry_name = 'unicod\u018f.txt'.encode(sys.getfilesystemencoding(), 'replace')
++        entry_name = u'unicod\u018f.txt'.encode(sys.getfilesystemencoding(), 'replace')
+         self.assertEqual(entry.name, entry_name)
+         self.assertEqual(entry.path, os.path.join(path, entry_name))
+ 
+@@ -234,12 +237,12 @@ class TestMixin(object):
+         self.assertTrue(isinstance(entry.name, str))
+         self.assertTrue(isinstance(entry.path, str))
+ 
+-        entry_name = 'unicod\u018f.txt'
++        entry_name = u'unicod\u018f.txt'
+         self.assertEqual(entry.name, entry_name)
+-        self.assertEqual(entry.path, os.path.join(path, 'unicod\u018f.txt'))
++        self.assertEqual(entry.path, os.path.join(path, u'unicod\u018f.txt'))
+ 
+         # Check that it handles unicode input properly
+-        path = os.path.join(TEST_PATH, 'subdir', 'unidir\u018f')
++        path = os.path.join(TEST_PATH, 'subdir', u'unidir\u018f')
+         self.assertTrue(isinstance(path, str))
+         entries = list(self.scandir_func(path))
+         self.assertEqual(len(entries), 1)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709301445.v8UEjx4T092583>