lang/python module: add RUN_DEPENDS to TEST_DEPENDS by default

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

lang/python module: add RUN_DEPENDS to TEST_DEPENDS by default

Kurt Mosiejczuk-9
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.

--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"

Reply | Threaded
Open this post in threaded view
|

Re: lang/python module: add RUN_DEPENDS to TEST_DEPENDS by default

Andrew Hewus Fresh
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 | Threaded
Open this post in threaded view
|

Re: lang/python module: add RUN_DEPENDS to TEST_DEPENDS by default

Daniel Jakots-6
In reply to this post by Kurt Mosiejczuk-9
On Mon, 13 May 2019 13:07:07 -0400, Kurt Mosiejczuk <[hidden email]>
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.

I don't know whether it's a good or a bad move but in either case I
think it needs a better justification than "perl does it so let's do
the same in python land".

Cheers,
Daniel

Reply | Threaded
Open this post in threaded view
|

Re: lang/python module: add RUN_DEPENDS to TEST_DEPENDS by default

Kurt Mosiejczuk-9
On Mon, May 13, 2019 at 01:24:14PM -0400, Daniel Jakots wrote:
> On Mon, 13 May 2019 13:07:07 -0400, Kurt Mosiejczuk <[hidden email]>
> 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.

> I don't know whether it's a good or a bad move but in either case I
> think it needs a better justification than "perl does it so let's do
> the same in python land".

Lots of Python ports end up shoving RUN_DEPENDS into TEST_DEPENDS.
afresh1 noticed that we do this because of his work parsing our
Makefiles DEPENDS for the new portgen work. He was surprised we
keep doing that because cpan just makes it happen.

--Kurt

Reply | Threaded
Open this post in threaded view
|

Re: lang/python module: add RUN_DEPENDS to TEST_DEPENDS by default

Antoine Jacoutot-7
In reply to this post by Kurt Mosiejczuk-9
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.

I support this move.


>
> --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"
>

--
Antoine