flake8 -> py-flake8 + py3 flavor

2017-02-22 Thread Daniel Jakots
Hi,

The only way to add a py3 flavor to flake8 is by renaming the port.

Plan is:

1. import a py-flake8 which is flake8 + py-flake8.diff.
2. hook py{,3}-flake8 and unhook flake8 in devel/Makefile
3. commit devel/quirks
4. commit net/py-libcloud and www/youtube-dl (I didn't rev bump as it's
TDEP only)
5. cvs rm devel/flake8

According to cvsweb, there have never been any py-flake8 before so
things should be smoother than last time (-:

Cheers,
DanielIndex: Makefile
===
RCS file: /cvs/ports/net/py-libcloud/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- Makefile	30 Dec 2016 11:31:06 -	1.14
+++ Makefile	23 Feb 2017 01:22:51 -
@@ -23,7 +23,7 @@ MODPY_SETUPTOOLS=	Yes
 
 RUN_DEPENDS=		sysutils/py-lockfile
 
-TEST_DEPENDS=		devel/flake8 \
+TEST_DEPENDS=		devel/py-flake8 \
 			devel/pep8 \
 			devel/py-mock \
 			sysutils/py-lockfile
Index: Makefile
===
RCS file: /cvs/ports/www/youtube-dl/Makefile,v
retrieving revision 1.162
diff -u -p -r1.162 Makefile
--- Makefile	14 Feb 2017 20:30:11 -	1.162
+++ Makefile	23 Feb 2017 01:21:31 -
@@ -21,7 +21,7 @@ MODULES =	lang/python
 
 MODPY_SETUPTOOLS =	Yes
 
-TEST_DEPENDS +=	devel/flake8 \
+TEST_DEPENDS +=	devel/py-flake8 \
 		devel/py-nose
 
 do-test:
Index: Makefile
===
RCS file: /cvs/ports/devel/quirks/Makefile,v
retrieving revision 1.441
diff -u -p -r1.441 Makefile
--- Makefile	19 Feb 2017 21:14:44 -	1.441
+++ Makefile	23 Feb 2017 01:20:08 -
@@ -5,7 +5,7 @@ CATEGORIES =	devel databases
 DISTFILES =
 
 # API.rev
-PKGNAME =	quirks-2.286
+PKGNAME =	quirks-2.287
 PKG_ARCH =	*
 MAINTAINER =	Marc Espie 
 
Index: files/Quirks.pm
===
RCS file: /cvs/ports/devel/quirks/files/Quirks.pm,v
retrieving revision 1.453
diff -u -p -r1.453 Quirks.pm
--- files/Quirks.pm	19 Feb 2017 21:14:44 -	1.453
+++ files/Quirks.pm	23 Feb 2017 01:20:08 -
@@ -410,6 +410,7 @@ my $stem_extensions = {
 	'u-boot' => 'u-boot-arm',
 	'ja-w3m' => 'w3m',
 	'markdown' => 'py-markdown',
+	'flake8' => 'py-flake8',
 };
 
 my $obsolete_reason = {
Index: Makefile
===
RCS file: /cvs/ports/devel/flake8/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- Makefile	19 Feb 2017 20:15:42 -	1.11
+++ Makefile	23 Feb 2017 01:38:41 -
@@ -4,6 +4,8 @@ COMMENT =		modular python code checker w
 
 MODPY_EGG_VERSION =	3.3.0
 DISTNAME =		flake8-${MODPY_EGG_VERSION}
+PKGNAME =		py-${DISTNAME}
+REVISION =		0
 
 CATEGORIES =		devel
 
@@ -19,17 +21,26 @@ MODULES =		lang/python
 MODPY_PI =		Yes
 MODPY_SETUPTOOLS =	Yes
 
+FLAVORS =		python3
+FLAVOR ?=
+
 TEST_DEPENDS =		${RUN_DEPENDS} \
-			devel/py-test \
-			devel/py-mock
+			devel/py-test${MODPY_FLAVOR} \
+			devel/py-mock${MODPY_FLAVOR}
+
+RUN_DEPENDS =		devel/py-codestyle${MODPY_FLAVOR} \
+			devel/py-mccabe${MODPY_FLAVOR} \
+			devel/pyflakes${MODPY_FLAVOR}
+
+.if ! ${FLAVOR:Mpython3}
+RUN_DEPENDS +=		devel/py-configparser \
+			devel/py-enum34
+.endif
 
-RUN_DEPENDS =		devel/py-codestyle \
-			devel/py-configparser \
-			devel/py-enum34 \
-			devel/py-mccabe \
-			devel/pyflakes
+BUILD_DEPENDS =		devel/py-test-runner${MODPY_FLAVOR}
 
-BUILD_DEPENDS =		devel/py-test-runner
+post-install:
+	mv ${PREFIX}/bin/flake8{,${MODPY_BIN_SUFFIX}}
 
 do-test:
 	cd ${WRKSRC} && PYTHONPATH=src ${MODPY_BIN} -m pytest tests
Index: pkg/PFRAG.no-python3
===
RCS file: pkg/PFRAG.no-python3
diff -N pkg/PFRAG.no-python3
--- /dev/null	1 Jan 1970 00:00:00 -
+++ pkg/PFRAG.no-python3	23 Feb 2017 01:38:41 -
@@ -0,0 +1,3 @@
+@comment $OpenBSD$
+@pkgpath devel/flake8
+@conflict flake8-*
Index: pkg/PLIST
===
RCS file: /cvs/ports/devel/flake8/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -r1.4 PLIST
--- pkg/PLIST	15 Nov 2016 08:23:50 -	1.4
+++ pkg/PLIST	23 Feb 2017 01:38:41 -
@@ -1,5 +1,6 @@
 @comment $OpenBSD: PLIST,v 1.4 2016/11/15 08:23:50 shadchin Exp $
-bin/flake8
+!%%python3%%
+bin/flake8${MODPY_BIN_SUFFIX}
 lib/python${MODPY_VERSION}/site-packages/flake8/
 lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
 lib/python${MODPY_VERSION}/site-packages/flake8-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
@@ -9,71 +10,77 @@ lib/python${MODPY_VERSION}/site-packages
 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
-lib/python${MODPY_VERSION}/site-packages/flake8/__init__.pyc
 lib/python${MODPY_VERSION}

Re: flake8 -> py-flake8 + py3 flavor

2017-02-23 Thread Alexandr Shadchin
On Wed, Feb 22, 2017 at 09:11:30PM -0500, Daniel Jakots wrote:
> Hi,
> 
> The only way to add a py3 flavor to flake8 is by renaming the port.
> 
> Plan is:
> 
> 1. import a py-flake8 which is flake8 + py-flake8.diff.
> 2. hook py{,3}-flake8 and unhook flake8 in devel/Makefile
> 3. commit devel/quirks
> 4. commit net/py-libcloud and www/youtube-dl (I didn't rev bump as it's
> TDEP only)
> 5. cvs rm devel/flake8
> 
> According to cvsweb, there have never been any py-flake8 before so
> things should be smoother than last time (-:
> 
> Cheers,
> Daniel

Thank you for add py3 flavor :-)

ok shadchin@

Small comment below.

> Index: Makefile
> ===
> RCS file: /cvs/ports/devel/flake8/Makefile,v
> retrieving revision 1.11
> diff -u -p -r1.11 Makefile
> --- Makefile  19 Feb 2017 20:15:42 -  1.11
> +++ Makefile  23 Feb 2017 01:38:41 -
> @@ -4,6 +4,8 @@ COMMENT = modular python code checker w
>  
>  MODPY_EGG_VERSION =  3.3.0
>  DISTNAME =   flake8-${MODPY_EGG_VERSION}
> +PKGNAME =py-${DISTNAME}
> +REVISION =   0
>  

I think that REVISION is not need, PKGNAME will change.

-- 
Alexandr Shadchin



Re: flake8 -> py-flake8 + py3 flavor

2017-02-23 Thread Stuart Henderson
On 2017/02/23 16:41, Alexandr Shadchin wrote:
> On Wed, Feb 22, 2017 at 09:11:30PM -0500, Daniel Jakots wrote:
> > Hi,
> > 
> > The only way to add a py3 flavor to flake8 is by renaming the port.
> > 
> > Plan is:
> > 
> > 1. import a py-flake8 which is flake8 + py-flake8.diff.
> > 2. hook py{,3}-flake8 and unhook flake8 in devel/Makefile
> > 3. commit devel/quirks
> > 4. commit net/py-libcloud and www/youtube-dl (I didn't rev bump as it's
> > TDEP only)
> > 5. cvs rm devel/flake8
> > 
> > According to cvsweb, there have never been any py-flake8 before so
> > things should be smoother than last time (-:
> > 
> > Cheers,
> > Daniel
> 
> Thank you for add py3 flavor :-)
> 
> ok shadchin@

OK with me too, and thanks :)

> Small comment below.
> 
> > Index: Makefile
> > ===
> > RCS file: /cvs/ports/devel/flake8/Makefile,v
> > retrieving revision 1.11
> > diff -u -p -r1.11 Makefile
> > --- Makefile19 Feb 2017 20:15:42 -  1.11
> > +++ Makefile23 Feb 2017 01:38:41 -
> > @@ -4,6 +4,8 @@ COMMENT =   modular python code checker w
> >  
> >  MODPY_EGG_VERSION =3.3.0
> >  DISTNAME = flake8-${MODPY_EGG_VERSION}
> > +PKGNAME =  py-${DISTNAME}
> > +REVISION = 0
> >  
> 
> I think that REVISION is not need, PKGNAME will change.

Quirks won't pick up the update unless it thinks the version is newer.