Re: UPDATE: devel/py-mock 1.3.0
Jérémie Courrèges-Anglas wrote : > Alexandr Shadchin writes: > > > On Wed, Dec 23, 2015 at 09:21:43PM +0100, Jérémie Courrèges-Anglas wrote: > >> Daniel Jakots writes: > >> > >> > On Wed, 23 Dec 2015 23:49:11 +0500, Alexandr Shadchin > >> > wrote: > >> > > >> >> Hi, > >> >> > >> >> This diff updates py-mock to the latest release. > >> >> Add python3 flavor. > >> >> > >> >> Comments ? OK ? > >> >> > >> > > >> > I was working on it too (as I need it for another port) and I have > >> > quite the same diff. A comment inline, otherwise that's good :) > >> > > >> >> > >> >> Index: Makefile > >> >> === > >> >> RCS file: /cvs/ports/devel/py-mock/Makefile,v > >> >> retrieving revision 1.7 > >> >> diff -u -p -r1.7 Makefile > >> >> --- Makefile29 Sep 2015 10:51:54 - 1.7 > >> >> +++ Makefile23 Dec 2015 18:44:30 - > >> >> @@ -2,11 +2,10 @@ > >> > > >> > [snip] > >> > > >> >> +NO_TEST = Yes > >> > > >> > Any reason for that? It looks like that test works. > >> > >> The test suite isn't called. Needs a test-dep on devel/py-unittest2 and > >> a custom do-test target, eg. cd ${WRKSRC} && unit2 discover. There are > >> 6 errors that were not present before. > >> > > > > Errors due to the old py-unittest2. > > Ah. ok jca@ for py-mock then. > > >> Also devel/flake8's tests fail with this update, but I'm not sure > >> whether my-mock is to blame. > >> > > > > Fix flake8 attached (also works fine with py-mock 1.0.1) > > Your patch is better than mine. ok jca@ fwiw, cc'ing maintainer. Thanks, that's perfect. That reminds me I should update that port and its dependencies. -b
UPDATE: devel/py-mccabe 0.3.1
This release fixes a few bugs calculating the complexity. I removed NO_TEST since upstream added the test suite to the release (https://github.com/PyCQA/mccabe/issues/31) devel/flake8 is the only port with py-mccabe as dependency and it was tested successfully. Bertrand Index: Makefile === RCS file: /cvs/ports/devel/py-mccabe/Makefile,v retrieving revision 1.3 diff -u -p -u -r1.3 Makefile --- Makefile29 Sep 2015 10:51:54 - 1.3 +++ Makefile24 Dec 2015 14:01:57 - @@ -2,7 +2,7 @@ COMMENT = McCabe complexity checker for Python -MODPY_EGG_VERSION =0.2.1 +MODPY_EGG_VERSION =0.3.1 DISTNAME = mccabe-${MODPY_EGG_VERSION} PKGNAME = py-mccabe-${MODPY_EGG_VERSION} REVISION = 0 @@ -21,7 +21,5 @@ MODPY_PI =Yes MODULES = lang/python MODPY_SETUPTOOLS = Yes - -NO_TEST = Yes .include Index: distinfo === RCS file: /cvs/ports/devel/py-mccabe/distinfo,v retrieving revision 1.1.1.1 diff -u -p -u -r1.1.1.1 distinfo --- distinfo17 Nov 2014 14:18:48 - 1.1.1.1 +++ distinfo24 Dec 2015 14:01:57 - @@ -1,2 +1,2 @@ -SHA256 (mccabe-0.2.1.tar.gz) = WioXDkfeVZOmq/rh6VQr0sOSSsYrvk5u2WyVPANSJDo= -SIZE (mccabe-0.2.1.tar.gz) = 5031 +SHA256 (mccabe-0.3.1.tar.gz) = X36m+zqpr+FG0H/W1c7feIdH2LDCnkRzJFPCstsePRY= +SIZE (mccabe-0.3.1.tar.gz) = 7586
PATCH: devel/pep8
This update adds a patch to devel/pep8 which reverts changes made to the 1.6 series breaking configuration file compatibility with devel/flake8. More information on the Python Code Quality mailing list: https://mail.python.org/pipermail/code-quality/2015-March/000515.html Index: Makefile === RCS file: /cvs/ports/devel/pep8/Makefile,v retrieving revision 1.10 diff -u -p -u -r1.10 Makefile --- Makefile26 Oct 2015 06:09:22 - 1.10 +++ Makefile24 Dec 2015 16:28:26 - @@ -4,10 +4,11 @@ COMMENT = python style guide checker MODPY_EGG_VERSION =1.6.2 DISTNAME = pep8-${MODPY_EGG_VERSION} +REVISION = 1 CATEGORIES = devel -HOMEPAGE = https://github.com/jcrocholl/pep8 +HOMEPAGE = https://github.com/PyCQA/pep8 # Expat PERMIT_PACKAGE_CDROM = Yes Index: patches/patch-pep8_py === RCS file: patches/patch-pep8_py diff -N patches/patch-pep8_py --- /dev/null 1 Jan 1970 00:00:00 - +++ patches/patch-pep8_py 24 Dec 2015 16:28:26 - @@ -0,0 +1,46 @@ +$OpenBSD$ +Reverted a change which had unintended repercussions in flake8. +Refs: + - https://mail.python.org/pipermail/code-quality/2015-March/000515.html + - https://github.com/PyCQA/pep8/commit/435d1cbf995a659a82d1d4b42d25e3459556ef21 +--- pep8.py.orig Thu Dec 24 05:59:45 2015 pep8.pyThu Dec 24 06:01:15 2015 +@@ -1984,24 +1984,24 @@ def read_config(options, args, arglist, parser): + + local_dir = os.curdir + ++if USER_CONFIG and os.path.isfile(USER_CONFIG): ++if options.verbose: ++print('user configuration: %s' % USER_CONFIG) ++config.read(USER_CONFIG) ++ ++parent = tail = args and os.path.abspath(os.path.commonprefix(args)) ++while tail: ++if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG): ++local_dir = parent ++if options.verbose: ++print('local configuration: in %s' % parent) ++break ++(parent, tail) = os.path.split(parent) ++ + if cli_conf and os.path.isfile(cli_conf): + if options.verbose: + print('cli configuration: %s' % cli_conf) + config.read(cli_conf) +-else: +-if USER_CONFIG and os.path.isfile(USER_CONFIG): +-if options.verbose: +-print('user configuration: %s' % USER_CONFIG) +-config.read(USER_CONFIG) +- +-parent = tail = args and os.path.abspath(os.path.commonprefix(args)) +-while tail: +-if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG): +-local_dir = parent +-if options.verbose: +-print('local configuration: in %s' % parent) +-break +-(parent, tail) = os.path.split(parent) + + pep8_section = parser.prog + if config.has_section(pep8_section):
UPDATE: devel/flake8
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 --- Makefile24 Dec 2015 15:36:54 - 1.4 +++ Makefile26 Dec 2015 00:17:20 - @@ -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 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 --- distinfo18 Nov 2014 12:10:58 - 1.1.1.1 +++ distinfo26 Dec 2015 00:17:20 - @@ -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 - 1.1 +++ /dev/null 1 Jan 1970 00:00:00 - @@ -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.pyThu 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 - +++ patches/patch-flake8_tests_test_integration_py 26 Dec 2015 00:17:20 - @@ -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(sel
Re: UPDATE: devel/flake8
Here is a better version without the test suite patch. Index: Makefile === RCS file: /cvs/ports/devel/flake8/Makefile,v retrieving revision 1.4 diff -u -p -u -r1.4 Makefile --- Makefile24 Dec 2015 15:36:54 - 1.4 +++ Makefile28 Dec 2015 14:50:25 - @@ -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 @@ -22,6 +21,7 @@ MODULES = lang/python MODPY_SETUPTOOLS = Yes TEST_DEPENDS = ${RUN_DEPENDS} \ + devel/py-nose \ devel/py-mock RUN_DEPENDS = devel/pep8 \ @@ -29,6 +29,6 @@ RUN_DEPENDS = devel/pep8 \ devel/pyflakes do-test: - cd ${WRKSRC} && ${MODPY_BIN} -m unittest discover + cd ${WRKSRC} && ${LOCALBASE}/bin/nosetests --first-package-wins .include 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 --- distinfo18 Nov 2014 12:10:58 - 1.1.1.1 +++ distinfo28 Dec 2015 14:50:25 - @@ -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 - 1.1 +++ /dev/null 1 Jan 1970 00:00:00 - @@ -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.pyThu 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-setup_py === RCS file: patches/patch-setup_py diff -N patches/patch-setup_py --- /dev/null 1 Jan 1970 00:00:00 - +++ patches/patch-setup_py 28 Dec 2015 14:50:25 - @@ -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 - 1.1.1.1 +++ pkg/PLIST 28 Dec 2015 14:50:26 - @@ -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
Re: UPDATE: devel/py-mccabe 0.5.3
Alexandr Shadchin wrote : > Hi, > > This diff updates py-mccabe to the latest release. > Tested on amd64. > > Comments ? OK ? OK
Re: UPDATE: devel/flake8 3.2.1
Alexandr Shadchin wrote : > Hi, > > This diff updates flake8 to the latest release. > Tested on amd64. > > Unbreak with pyflakes 1.4.0 (on ports@). > > Comments ? OK ? OK as well
Re: UPDATE: devel/py-mccabe 0.5.2
Looks good. Alexandr Shadchin wrote : > ping > > On Fri, Aug 12, 2016 at 11:49 AM, Alexandr Shadchin < > alexandr.shadc...@gmail.com> wrote: > > > Hi, > > > > This diff updates py-mccabe to the latest release. Add python3 flavor. > > Tested on amd64. > > > > Comments ? OK ? > > > > -- > > Alexandr Shadchin > > > > Index: Makefile > > === > > RCS file: /cvs/ports/devel/py-mccabe/Makefile,v > > retrieving revision 1.4 > > diff -u -p -r1.4 Makefile > > --- Makefile25 Dec 2015 14:57:05 - 1.4 > > +++ Makefile12 Aug 2016 06:44:19 - > > @@ -2,7 +2,7 @@ > > > > COMMENT = McCabe complexity checker for Python > > > > -MODPY_EGG_VERSION =0.3.1 > > +MODPY_EGG_VERSION =0.5.2 > > DISTNAME = mccabe-${MODPY_EGG_VERSION} > > PKGNAME = py-mccabe-${MODPY_EGG_VERSION} > > > > @@ -15,10 +15,13 @@ MAINTAINER =Bertrand Janin > > > # Expat > > PERMIT_PACKAGE_CDROM = Yes > > > > -MODPY_PI = Yes > > - > > MODULES = lang/python > > +TEST_DEPENDS = devel/py-test${MODPY_FLAVOR} > > > > +MODPY_PI = Yes > > MODPY_SETUPTOOLS = Yes > > + > > +FLAVORS = python3 > > +FLAVOR ?= > > > > .include > > Index: distinfo > > === > > RCS file: /cvs/ports/devel/py-mccabe/distinfo,v > > retrieving revision 1.2 > > diff -u -p -r1.2 distinfo > > --- distinfo25 Dec 2015 14:57:05 - 1.2 > > +++ distinfo12 Aug 2016 06:44:19 - > > @@ -1,2 +1,2 @@ > > -SHA256 (mccabe-0.3.1.tar.gz) = X36m+zqpr+FG0H/ > > W1c7feIdH2LDCnkRzJFPCstsePRY= > > -SIZE (mccabe-0.3.1.tar.gz) = 7586 > > +SHA256 (mccabe-0.5.2.tar.gz) = NHPwbIt1e7tc3ylQmb9kAy5ffW/ > > g7C+X7psjywpDWv8= > > +SIZE (mccabe-0.5.2.tar.gz) = 8366 > > Index: pkg/PLIST > > === > > RCS file: /cvs/ports/devel/py-mccabe/pkg/PLIST,v > > retrieving revision 1.1.1.1 > > diff -u -p -r1.1.1.1 PLIST > > --- pkg/PLIST 17 Nov 2014 14:18:48 - 1.1.1.1 > > +++ pkg/PLIST 12 Aug 2016 06:44:19 - > > @@ -1,4 +1,5 @@ > > @comment $OpenBSD: PLIST,v 1.1.1.1 2014/11/17 14:18:48 benoit Exp $ > > +lib/python${MODPY_VERSION}/site-packages/${MODPY_PYCACHE} > > mccabe.${MODPY_PYC_MAGIC_TAG}pyc > > lib/python${MODPY_VERSION}/site-packages/mccabe-${MODPY_ > > EGG_VERSION}-py${MODPY_VERSION}.egg-info/ > > lib/python${MODPY_VERSION}/site-packages/mccabe-${MODPY_ > > EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO > > lib/python${MODPY_VERSION}/site-packages/mccabe-${MODPY_ > > EGG_VERSION}-py${MODPY_VERSION}.egg-info/SOURCES.txt > > @@ -7,4 +8,3 @@ lib/python${MODPY_VERSION}/site-packages > > lib/python${MODPY_VERSION}/site-packages/mccabe-${MODPY_ > > EGG_VERSION}-py${MODPY_VERSION}.egg-info/not-zip-safe > > lib/python${MODPY_VERSION}/site-packages/mccabe-${MODPY_ > > EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt > > lib/python${MODPY_VERSION}/site-packages/mccabe.py > > -lib/python${MODPY_VERSION}/site-packages/mccabe.pyc > > > > > > -- > Alexandr Shadchin
NEW: devel/py-mccabe
Hi, attached is the latest released version of the mccabe Python library. It is a complexity checker for Python code using cyclomatic complexity measurement, also known as McCabe's complexity measure. Bertrand devel-py-mccabe.tgz Description: application/tar-gz
NEW: devel/flake8
Hi, attached is the latest version of flake8, a modular python code checker wrapping tools such as pyflakes, pep8 and McCabe for complexity checks. Bertrand devel-flake8.tgz Description: application/tar-gz
Re: NEW: devel/flake8
Stuart Henderson wrote : > On 2014/11/17 21:06, Bertrand Janin wrote: > > Hi, > > > > attached is the latest version of flake8, a modular python code checker > > wrapping tools such as pyflakes, pep8 and McCabe for complexity checks. > > > > Bertrand > > From pkg/PLIST: > > lib/python${MODPY_VERSION}/site-packages/${FULLPKGNAME\-}-py${MODPY_VERSION}.egg-info/ > (and others on the following lines) > > the only time FULLPKGNAME should appear in a PLIST file is when it's used > for a pkg-readmes doc file. In this case try this: > > lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/ I see, here is the updated version. Does it sound possible to fix "make plist" to do the right thing for MODPY packages? And if yes, any pointers to get me started? Bertrand devel-flake8-v2.tgz Description: application/tar-gz
NEW: www/py-gunicorn
Comments? Import? Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resource usage, and fairly speedy. https://github.com/jasperla/openbsd-wip/tree/master/www/py-gunicorn py-gunicorn-0.14.2.tar.gz Description: application/tar-gz