Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself
On Thu, Jun 20 2019, Kurt Mosiejczuk wrote: > On Thu, Jun 20, 2019 at 03:56:34PM +0200, Jeremie Courreges-Anglas wrote: >> On Thu, Jun 20 2019, Kurt Mosiejczuk 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
Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself
On 2019/06/20 15:56, Jeremie Courreges-Anglas wrote: > On Thu, Jun 20 2019, Kurt Mosiejczuk 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.. :-)
Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself
On Thu, Jun 20 2019, Kurt Mosiejczuk 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 +++ MakefileThu 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
Re: Fix textproc/py-commonmark tests by adding TEST_DEPENDS on itself
sure