On Mon, May 13, 2019 at 01:07:07PM -0400, Kurt Mosiejczuk wrote:
> During our work on the portgen improvements afresh1 mentioned that the
> cpan module just adds RUN_DEPENDS to TEST_DEPENDS automatically. So I
> coded up this patch to lang/python/python.port.mk to do the same.
> 
> It will still obey MODPY_TESTDEP being set to no, in which case we 
> don't touch TEST_DEPENDS.
> 
> Thoughts? If folks like this, I can go through and update python port
> Makefiles that do this manually right now and commit this change and the
> Makefile changes at one time.

As a heavy user of cpan.port.mk I was surprised this didn't exist more
generally, it seems like a good idea, but I don't understand why
MODPY_TEST_DEPENDS exists and such, but I do know it's very common to
need this.

$ grep '^TEST_DEPENDS.*=.*RUN_DEPENDS' */py-*/Makefile | wc -l
     116

Although I don't know what makes it required, but it's possible it's
MODPY_PYTEST.

$ ls */py-*/Makefile | wc -l                                   
     652


> 
> --Kurt
> 
> Index: lang/python/python.port.mk
> ===================================================================
> RCS file: /cvs/ports/lang/python/python.port.mk,v
> retrieving revision 1.108
> diff -u -p -r1.108 python.port.mk
> --- lang/python/python.port.mk        27 Apr 2019 21:28:30 -0000      1.108
> +++ lang/python/python.port.mk        13 May 2019 16:31:21 -0000
> @@ -72,10 +72,9 @@ MODPY_RUN_DEPENDS =        lang/python/${MODPY_
>  MODPY_LIB_DEPENDS =  lang/python/${MODPY_VERSION}
>  _MODPY_BUILD_DEPENDS =       lang/python/${MODPY_VERSION}
>  
> +MODPY_TEST_DEPENDS = ${RUN_DEPENDS}
>  .if ${MODPY_PYTEST:L} == "yes"
> -MODPY_TEST_DEPENDS = devel/py-test${MODPY_FLAVOR}
> -.else
> -MODPY_TEST_DEPENDS = # Leave blank for now for non-pytest
> +MODPY_TEST_DEPENDS +=        devel/py-test${MODPY_FLAVOR}
>  .endif
>  
>  .if ${NO_BUILD:L} == "no"
> 

-- 
andrew - http://afresh1.com

Software doesn't do what you want it to do, it does what you tell it do.
                      -- Stefan G. Weichinger.

Reply via email to