Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself

Kurt Mosiejczuk-9
Paco Esteban just had trouble running the tests for py-commonmark because
the module needs itself installed to run the tests. This simple diff
adds itself to the TEST_DEPENDS to fix that.

Tweak the PERMIT line to the new style while here.

cc sebastia@ (maintainer)

--Kurt

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/py-commonmark/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile 15 May 2019 12:04:41 -0000 1.5
+++ Makefile 20 Jun 2019 13:10:19 -0000
@@ -11,7 +11,7 @@ REVISION= 0
 MAINTAINER= Sebastian Reitenbach <[hidden email]>
 
 # BSD
-PERMIT_PACKAGE_CDROM= Yes
+PERMIT_PACKAGE = Yes
 
 MODULES= lang/python
 MODPY_PI= Yes
@@ -21,7 +21,8 @@ FLAVORS= python3
 FLAVOR?=
 
 RUN_DEPENDS= devel/py-future${MODPY_FLAVOR}
-TEST_DEPENDS= devel/flake8 \
+TEST_DEPENDS= ${FULLPKGNAME}:${FULLPKGPATH} \
+ devel/flake8 \
  devel/py-hypothesis${MODPY_FLAVOR}
 
 post-install:

Reply | Threaded
Open this post in threaded view
|

Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself

Klemens Nanni-2
sure

Reply | Threaded
Open this post in threaded view
|

Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself

Jeremie Courreges-Anglas-2
In reply to this post by Kurt Mosiejczuk-9
On Thu, Jun 20 2019, Kurt Mosiejczuk <[hidden email]> wrote:
> Paco Esteban just had trouble running the tests for py-commonmark because
> the module needs itself installed to run the tests. This simple diff
> adds itself to the TEST_DEPENDS to fix that.

Not objecting, but there's another approach which I tend to prefer: use
PYTHONPATH so that the tested code is the code actually being built and
packaged.  Skipping the update/reinstall step also makes testing updates
easier.

Suggested approach, "624 tests passed, 0 failed" both with py2
and py3.

> Tweak the PERMIT line to the new style while here.
>
> cc sebastia@ (maintainer)


--- Makefile.~1.5.~ Thu Jun 20 15:42:58 2019
+++ Makefile Thu Jun 20 15:49:36 2019
@@ -24,6 +24,8 @@ RUN_DEPENDS= devel/py-future${MODPY_FLAVOR}
 TEST_DEPENDS= devel/flake8 \
  devel/py-hypothesis${MODPY_FLAVOR}
 
+TEST_ENV= PYTHONPATH="."
+
 post-install:
  mv ${PREFIX}/bin/cmark ${PREFIX}/bin/commonmark${MODPY_BIN_SUFFIX}
 


--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply | Threaded
Open this post in threaded view
|

Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself

Kurt Mosiejczuk-9
On Thu, Jun 20, 2019 at 03:56:34PM +0200, Jeremie Courreges-Anglas wrote:
> On Thu, Jun 20 2019, Kurt Mosiejczuk <[hidden email]> wrote:
> > Paco Esteban just had trouble running the tests for py-commonmark because
> > the module needs itself installed to run the tests. This simple diff
> > adds itself to the TEST_DEPENDS to fix that.

> Not objecting, but there's another approach which I tend to prefer: use
> PYTHONPATH so that the tested code is the code actually being built and
> packaged.  Skipping the update/reinstall step also makes testing updates
> easier.

> Suggested approach, "624 tests passed, 0 failed" both with py2
> and py3.

Oh. I like this *much* better. This is immediately going in my toolbox.

Do you know if it ever breaks things to have PYTHONPATH="."? Would it be
worth having the lang/python module do that automatically?

--Kurt

Reply | Threaded
Open this post in threaded view
|

Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself

Stuart Henderson
In reply to this post by Jeremie Courreges-Anglas-2
On 2019/06/20 15:56, Jeremie Courreges-Anglas wrote:

> On Thu, Jun 20 2019, Kurt Mosiejczuk <[hidden email]> wrote:
> > Paco Esteban just had trouble running the tests for py-commonmark because
> > the module needs itself installed to run the tests. This simple diff
> > adds itself to the TEST_DEPENDS to fix that.
>
> Not objecting, but there's another approach which I tend to prefer: use
> PYTHONPATH so that the tested code is the code actually being built and
> packaged.  Skipping the update/reinstall step also makes testing updates
> easier.
>
> Suggested approach, "624 tests passed, 0 failed" both with py2
> and py3.
>
> > Tweak the PERMIT line to the new style while here.
> >
> > cc sebastia@ (maintainer)
>
>
> --- Makefile.~1.5.~ Thu Jun 20 15:42:58 2019
> +++ Makefile Thu Jun 20 15:49:36 2019
> @@ -24,6 +24,8 @@ RUN_DEPENDS= devel/py-future${MODPY_FLAVOR}
>  TEST_DEPENDS= devel/flake8 \
>   devel/py-hypothesis${MODPY_FLAVOR}
>  
> +TEST_ENV= PYTHONPATH="."
> +
>  post-install:
>   mv ${PREFIX}/bin/cmark ${PREFIX}/bin/commonmark${MODPY_BIN_SUFFIX}
>  
>
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
>

I think that is preferable and I would like to see it in more ports in the
tree so when I search for a random example I'm more likely to find it than
the common "TEST_DEPENDS=(self)" type.. :-)

Reply | Threaded
Open this post in threaded view
|

Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself

Jeremie Courreges-Anglas-2
In reply to this post by Kurt Mosiejczuk-9
On Thu, Jun 20 2019, Kurt Mosiejczuk <[hidden email]> wrote:

> On Thu, Jun 20, 2019 at 03:56:34PM +0200, Jeremie Courreges-Anglas wrote:
>> On Thu, Jun 20 2019, Kurt Mosiejczuk <[hidden email]> wrote:
>> > Paco Esteban just had trouble running the tests for py-commonmark because
>> > the module needs itself installed to run the tests. This simple diff
>> > adds itself to the TEST_DEPENDS to fix that.
>
>> Not objecting, but there's another approach which I tend to prefer: use
>> PYTHONPATH so that the tested code is the code actually being built and
>> packaged.  Skipping the update/reinstall step also makes testing updates
>> easier.
>
>> Suggested approach, "624 tests passed, 0 failed" both with py2
>> and py3.
>
> Oh. I like this *much* better. This is immediately going in my toolbox.
>
> Do you know if it ever breaks things to have PYTHONPATH="."? Would it be
> worth having the lang/python module do that automatically?

As a knob for MODPY_TEST_CMD only, I guess it should be safe.  Maybe it
could also be a setting (MODPY_TEST_PYTHONPATH)?

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE