From 64bf7d9103d20a2093736110cecb8ef49f857334 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Mon, 29 Jan 2024 12:04:02 +0100 Subject: [PATCH] Separate job for doctests --- .github/workflows/ci.yml | 12 ++++++++++-- src/vector/backends/_numba.py | 4 +--- src/vector/backends/_numba_object.py | 5 +---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 184101d2..d8736344 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,8 +86,12 @@ jobs: - name: Install awkward v1 run: python -m pip install -U "awkward<2" + - name: Run doctests on Python ${{ matrix.python-version }} with awkward v1.x + if: matrix.python-version == '3.11' + run: python -m pytest -ra --doctest-plus src/vector/ + - name: Test package with awkward v1.x - run: python -m pytest -ra --cov=vector --ignore tests/test_notebooks.py --doctest-plus . + run: python -m pytest -ra --cov=vector --ignore tests/test_notebooks.py . check-awkward-v2: needs: [check-light] @@ -118,8 +122,12 @@ jobs: - name: Install awkward v2 run: python -m pip install -U --pre "awkward>=2.0.0rc1" + - name: Run doctests on Python ${{ matrix.python-version }} with awkward v2.x + if: matrix.python-version == 3.11 + run: python -m pytest -ra --doctest-plus src/vector/ + - name: Test package with awkward v2.x - run: python -m pytest -ra --cov=vector --ignore tests/test_notebooks.py --doctest-plus . + run: python -m pytest -ra --cov=vector --ignore tests/test_notebooks.py . - name: Upload coverage report uses: codecov/codecov-action@v3.1.4 diff --git a/src/vector/backends/_numba.py b/src/vector/backends/_numba.py index fa9ecb77..b3fe5d5d 100644 --- a/src/vector/backends/_numba.py +++ b/src/vector/backends/_numba.py @@ -5,12 +5,10 @@ from __future__ import annotations -import sys import types import typing -if sys.version_info < (3, 12): - import numba +import numba import vector._compute.lorentz import vector._compute.planar diff --git a/src/vector/backends/_numba_object.py b/src/vector/backends/_numba_object.py index 47198bf6..0ecc905e 100644 --- a/src/vector/backends/_numba_object.py +++ b/src/vector/backends/_numba_object.py @@ -13,11 +13,8 @@ from __future__ import annotations import operator -import sys - -if sys.version_info < (3, 12): - import numba +import numba import numpy import vector