This is an update to the latest version of flake8 which brings a few improvements and bug fixes. This new version depends on the devel/py-mock 1.3.0 port that has not yet been committed and the devel/pep8 port that was committed yesterday.
Bertrand Index: Makefile =================================================================== RCS file: /cvs/ports/devel/flake8/Makefile,v retrieving revision 1.4 diff -u -p -u -r1.4 Makefile --- Makefile 24 Dec 2015 15:36:54 -0000 1.4 +++ Makefile 26 Dec 2015 00:17:20 -0000 @@ -2,13 +2,12 @@ COMMENT = modular python code checker wrapping pep8 and pyflakes -MODPY_EGG_VERSION = 2.2.5 +MODPY_EGG_VERSION = 2.5.1 DISTNAME = flake8-${MODPY_EGG_VERSION} -REVISION = 1 CATEGORIES = devel -HOMEPAGE = https://bitbucket.org/tarek/flake8/ +HOMEPAGE = https://gitlab.com/pycqa/flake8 MAINTAINER = Bertrand Janin <b...@janin.com> Index: distinfo =================================================================== RCS file: /cvs/ports/devel/flake8/distinfo,v retrieving revision 1.1.1.1 diff -u -p -u -r1.1.1.1 distinfo --- distinfo 18 Nov 2014 12:10:58 -0000 1.1.1.1 +++ distinfo 26 Dec 2015 00:17:20 -0000 @@ -1,2 +1,2 @@ -SHA256 (flake8-2.2.5.tar.gz) = KF6L1zDAtv374jwy0pNr/7pAHyPKsTLocixovoDW8YI= -SIZE (flake8-2.2.5.tar.gz) = 28333 +SHA256 (flake8-2.5.1.tar.gz) = RIrtSLBnH+YGL0e5jDCB86Szb76Z3bisKjvm5ssTVgM= +SIZE (flake8-2.5.1.tar.gz) = 83692 Index: patches/patch-flake8_tests_test_engine_py =================================================================== RCS file: patches/patch-flake8_tests_test_engine_py diff -N patches/patch-flake8_tests_test_engine_py --- patches/patch-flake8_tests_test_engine_py 24 Dec 2015 15:36:54 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,30 +0,0 @@ -$OpenBSD: patch-flake8_tests_test_engine_py,v 1.1 2015/12/24 15:36:54 shadchin Exp $ ---- flake8/tests/test_engine.py.orig Sat Sep 13 20:16:36 2014 -+++ flake8/tests/test_engine.py Thu Dec 24 15:06:46 2015 -@@ -50,7 +50,7 @@ class TestEngine(unittest.TestCase): - self.assertTrue(len(registered_exts[0]) > 0) - for i in registered_exts[1:]: - self.assertTrue(isinstance(i, list)) -- register_check.assert_called() -+ self.assertTrue(register_check.called) - - def test_get_parser(self): - # setup -@@ -64,13 +64,13 @@ class TestEngine(unittest.TestCase): - # actual call we're testing - parser, hooks = engine.get_parser() - # assertions -- re.assert_called() -- gpv.assert_called() -+ self.assertTrue(re.called) -+ self.assertTrue(gpv.called) - pgp.assert_called_once_with( - 'flake8', - '%s (pyflakes: 0.7, mccabe: 0.2) Python Version' % __version__) -- m.remove_option.assert_called() -- m.add_option.assert_called() -+ self.assertTrue(m.remove_option.called) -+ self.assertTrue(m.add_option.called) - self.assertEqual(parser, m) - self.assertEqual(hooks, []) - # clean-up Index: patches/patch-flake8_tests_test_integration_py =================================================================== RCS file: patches/patch-flake8_tests_test_integration_py diff -N patches/patch-flake8_tests_test_integration_py --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-flake8_tests_test_integration_py 26 Dec 2015 00:17:20 -0000 @@ -0,0 +1,27 @@ +$OpenBSD$ +This test does not work on Python 2 since the mock library can't +override sys.stdout.flush, so we mock sys.stdout instead. Patch was +sent upstream: https://gitlab.com/pycqa/flake8/merge_requests/49 +--- flake8/tests/test_integration.py.orig Sat Mar 7 21:22:11 2015 ++++ flake8/tests/test_integration.py Fri Dec 25 01:12:13 2015 +@@ -40,17 +40,17 @@ class IntegrationTestCase(unittest.TestCase): + + def _job_tester(self, jobs): + # mock stdout.flush so we can count the number of jobs created +- with mock.patch('sys.stdout.flush') as mocked: ++ with mock.patch('sys.stdout') as mocked: + guide, report = self.check_files(arglist=['--jobs=%s' % jobs]) + if is_windows(): + # The code path where guide.options.jobs gets converted to an + # int is not run on windows. So, do the int conversion here. + self.assertEqual(int(guide.options.jobs), jobs) + # On windows, call count is always zero. +- self.assertEqual(mocked.call_count, 0) ++ self.assertEqual(mocked.flush.call_count, 0) + else: + self.assertEqual(guide.options.jobs, jobs) +- self.assertEqual(mocked.call_count, jobs) ++ self.assertEqual(mocked.flush.call_count, jobs) + + def test_jobs(self): + self._job_tester(2) Index: patches/patch-setup_py =================================================================== RCS file: patches/patch-setup_py diff -N patches/patch-setup_py --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-setup_py 26 Dec 2015 00:17:20 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ +Our version of pep8 1.6.2 is patched. +https://mail.python.org/pipermail/code-quality/2015-March/000515.html +--- setup.py.orig Sun Oct 25 21:27:50 2015 ++++ setup.py Thu Dec 24 05:47:55 2015 +@@ -50,7 +50,7 @@ setup( + packages=["flake8", "flake8.tests"], + install_requires=[ + "pyflakes >= 0.8.1, < 1.1", +- "pep8 >= 1.5.7, != 1.6.0, != 1.6.1, != 1.6.2", ++ "pep8 >= 1.5.7, != 1.6.0, != 1.6.1", + "mccabe >= 0.2.1, < 0.4", + ], + entry_points={ Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/devel/flake8/pkg/PLIST,v retrieving revision 1.1.1.1 diff -u -p -u -r1.1.1.1 PLIST --- pkg/PLIST 18 Nov 2014 12:10:58 -0000 1.1.1.1 +++ pkg/PLIST 26 Dec 2015 00:17:20 -0000 @@ -6,6 +6,7 @@ lib/python${MODPY_VERSION}/site-packages lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/dependency_links.txt lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/entry_points.txt +lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/pbr.json lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/requires.txt lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt lib/python${MODPY_VERSION}/site-packages/flake8/__init__.py @@ -14,6 +15,10 @@ lib/python${MODPY_VERSION}/site-packages lib/python${MODPY_VERSION}/site-packages/flake8/__main__.pyc lib/python${MODPY_VERSION}/site-packages/flake8/_pyflakes.py lib/python${MODPY_VERSION}/site-packages/flake8/_pyflakes.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/callbacks.py +lib/python${MODPY_VERSION}/site-packages/flake8/callbacks.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/compat.py +lib/python${MODPY_VERSION}/site-packages/flake8/compat.pyc lib/python${MODPY_VERSION}/site-packages/flake8/engine.py lib/python${MODPY_VERSION}/site-packages/flake8/engine.pyc lib/python${MODPY_VERSION}/site-packages/flake8/hooks.py @@ -27,7 +32,19 @@ lib/python${MODPY_VERSION}/site-packages lib/python${MODPY_VERSION}/site-packages/flake8/tests/ lib/python${MODPY_VERSION}/site-packages/flake8/tests/__init__.py lib/python${MODPY_VERSION}/site-packages/flake8/tests/__init__.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/tests/_test_warnings.py +lib/python${MODPY_VERSION}/site-packages/flake8/tests/_test_warnings.pyc lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_engine.py lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_engine.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_hooks.py +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_hooks.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_integration.py +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_integration.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_main.py +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_main.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_reporter.py +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_reporter.pyc +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_util.py +lib/python${MODPY_VERSION}/site-packages/flake8/tests/test_util.pyc lib/python${MODPY_VERSION}/site-packages/flake8/util.py lib/python${MODPY_VERSION}/site-packages/flake8/util.pyc