Bug 191385 - [PATCH] www/py-html5lib: Fix python version
Summary: [PATCH] www/py-html5lib: Fix python version
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Some People
Assignee: Ruslan Makhmatkhanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-26 05:49 UTC by Melvyn Sopacua
Modified: 2014-07-08 06:31 UTC (History)
1 user (show)

See Also:


Attachments
fix-py-html5lib-python-ver.patch (359 bytes, patch)
2014-06-26 05:49 UTC, Melvyn Sopacua
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Melvyn Sopacua 2014-06-26 05:49:15 UTC
Created attachment 144136 [details]
fix-py-html5lib-python-ver.patch

The Python version is set to 2.x only, yet html5lib supports Python 3.

How-To-Repeat:
Install python 3 and then html5lib. Python 2.7 is pulled in.
Comment 1 Melvyn Sopacua 2014-06-26 05:53:50 UTC
Redports: https://redports.org/buildarchive/20140625053801-53876/
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2014-06-26 07:09:30 UTC
Assign to maintainer
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2014-06-26 07:16:06 UTC
Thanks for your submission Melvyn. Could you please:

* Provide unit test output under Python 2.x and 3.x to confirm that the new version works (functionally) under both?

More info here:

https://github.com/html5lib/html5lib-python/blob/master/README.rst#tests
Comment 4 Melvyn Sopacua 2014-06-26 18:42:29 UTC
They don't and I doubt it works with the version in ports as well. Needs a RUN_DEPENDS on devel/py-six. See html5lib-python/html5lib/html5parser.py line 2.
Comment 5 Melvyn Sopacua 2014-06-26 20:36:19 UTC
Python 3:
Ran 25610 tests in 79.508s

OK

Python 2:
Ran 25610 tests in 85.931s

OK

I have the following now, but the porters handbook doesn't include anything about running a test suite. If this is OK, I'll resubmit.

diff -r 4a8fd906061d www/py-html5lib/Makefile
--- a/www/py-html5lib/Makefile  Thu Jun 26 20:55:34 2014 +0200
+++ b/www/py-html5lib/Makefile  Thu Jun 26 22:34:01 2014 +0200
@@ -3,9 +3,11 @@
 
 PORTNAME=      html5lib
 PORTVERSION=   0.999
+PORTREVISION=  1
 CATEGORIES=    www python
-MASTER_SITES=  GOOGLE_CODE \
-               CHEESESHOP
+MASTER_SITES=  GOOGLE_CODE:master \
+               CHEESESHOP:master \
+               http://magemana.nl/ports/dist/:test
 PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=    rm@FreeBSD.org
@@ -13,8 +15,28 @@
 
 LICENSE=       MIT
 
+RUN_DEPENDS=   ${PYTHON_PKGNAMEPREFIX}six>0:${PORTSDIR}/devel/py-six
+TEST_DEPENDS=  ${PYTHON_PKGNAMEPREFIX}nose>0:${PORTSDIR}/devel/py-nose
+
+OPTIONS_DEFINE=        TEST
+
 USE_PYTHON=            yes
 USE_PYDISTUTILS=       yes
 PYDISTUTILS_AUTOPLIST= yes
 
+.include <bsd.port.options.mk>
+.if !empty(PORT_OPTIONS:MTEST)
+DISTFILES=     ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}:master \
+               ${PORTNAME}-${PORTVERSION}-testdata${EXTRACT_SUFX}:test
+BUILD_DEPENDS+=        ${TEST_DEPENDS}
+.endif
+
+regression-test: build
+       @${ECHO_MSG} "===>  Testing ${PORTNAME} (patience...)"
+       @cd ${WRKSRC} && nosetests -q
+
+.if !empty(PORT_OPTIONS:MTEST)
+pre-install: regression-test
+.endif
+
 .include <bsd.port.mk>
Comment 6 Melvyn Sopacua 2014-06-26 20:38:45 UTC
FYI: Added the -q to nosetest, cause otherwise you WILL get 25k dots on your screen / in your log.
Comment 7 commit-hook freebsd_committer freebsd_triage 2014-07-08 06:29:03 UTC
A commit references this bug:

Author: rm
Date: Tue Jul  8 06:28:07 UTC 2014
New revision: 361181
URL: http://svnweb.freebsd.org/changeset/ports/361181

Log:
  www/py-html5lib: update python version

  - update python version: 3.x is now supported
  - add tests

  PR:		191385
  Submitted by:	melvyn@magemana.nl
  Reviewed by:	koobs

Changes:
  head/www/py-html5lib/Makefile
  head/www/py-html5lib/distinfo
Comment 8 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2014-07-08 06:31:38 UTC
Committed, thank you!