Date: Sunday, April 16, 2023 @ 17:08:04
  Author: arojas
Revision: 1446569

Run tests in a venv (FS#78214)

Modified:
  jupyter-nbconvert/trunk/PKGBUILD

----------+
 PKGBUILD |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-04-16 17:02:16 UTC (rev 1446568)
+++ PKGBUILD    2023-04-16 17:08:04 UTC (rev 1446569)
@@ -12,8 +12,8 @@
 depends=(jupyter-nbformat jupyter-nbclient jupyterlab_pygments
          python-beautifulsoup4 python-bleach python-defusedxml 
python-entrypoints python-jinja python-pandocfilters
          python-mistune python-pygments python-traitlets python-tinycss2 
python-lxml)
-makedepends=(python-build python-installer python-hatchling python-pyppeteer)
-checkdepends=(python-pytest python-ipywidgets)
+makedepends=(python-build python-installer python-hatchling)
+checkdepends=(python-pytest python-ipywidgets python-pyppeteer)
 optdepends=('pandoc: non-html conversion output'
             'python-pyppeteer: for webPDF conversion support')
 
source=(https://github.com/jupyter/nbconvert/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
@@ -26,12 +26,13 @@
 
 check() {
   cd nbconvert-$pkgver
-  export PYTHONPATH="$PWD" # Make sure system nbconvert is not used
+  python -m venv --system-site-packages test-env
+  test-env/bin/python -m pip install -e .
   # disable tests that download chromium and (probably) require a graphical 
session
-  pytest -v -k 'TestWebPDFExporter and not (test_export or 
test_webpdf_without_pyppeteer)' -W ignore::DeprecationWarning
-  pytest -v -k 'TestNbConvertApp and not test_webpdf_with_chromium' -W 
ignore::DeprecationWarning
+  test-env/bin/python -m pytest -v -k 'TestWebPDFExporter and not (test_export 
or test_webpdf_without_pyppeteer)' -W ignore::DeprecationWarning
+  test-env/bin/python -m pytest -v -k 'TestNbConvertApp and not 
test_webpdf_with_chromium' -W ignore::DeprecationWarning
   # run all remaining tests
-  pytest -v -k 'not TestWebPDFExporter and not TestNbConvertApp' -W 
ignore::DeprecationWarning
+  test-env/bin/python -m pytest -v -k 'not TestWebPDFExporter and not 
TestNbConvertApp' -W ignore::DeprecationWarning
 }
 
 package() {

Reply via email to