Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2019 12:05:18 +1100
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        Enji Cooper <ngie@FreeBSD.org>, ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org, python <python@FreeBSD.org>
Subject:   Re: svn commit: r517602 - head/devel/py-mock
Message-ID:  <6f252ffe-9e8d-3bb7-fe48-baccda10012d@FreeBSD.org>
In-Reply-To: <201911141711.xAEHBwBO077712@repo.freebsd.org>
References:  <201911141711.xAEHBwBO077712@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 15/11/2019 4:11 am, Enji Cooper wrote:
> +	@cd ${WRKSRC} && pytest

Hi Enji :)

Python ports *must* always reference/use *Python-version* specific 
versions of binaries/scripts/interpreters for *all* invocations of them, 
as it can never be guaranteed that:

a) A/the non-versioned binary name is installed, and
b) That the non-versioned binary name points to expected (same) version 
as the port is being tested/built with.

The canonical pytest invocation is:

cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs -o addopts=

-v: one line per test (rather than dots per test)
-rs: Show skip/skipped reasons
-o addopts=: Override setup.cfg/pytest.ini options that sometimes set 
arguments that require additional dependencies (--cov for coverage) or 
other test arguments that we dont want)

Note: Some Python packages 'require' or 'depend on' invoking the pytest 
script directly, as the python path semantics of this differ from using 
pythonX.Y -m pytest, but try to use the first one unless it doesn't work.

In these cases, the correct invocation is usually:

cd ${WRKSRC} && ${LOCALBASE}/bin/pytest-${PYTHON_VER} -v -rs -o addopts=




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6f252ffe-9e8d-3bb7-fe48-baccda10012d>