Skip to content

Commit

Permalink
feat: add a lite nox session + add numba as optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Mar 5, 2024
1 parent 6e1f79f commit 7cb1639
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
21 changes: 13 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

import nox

ALL_PYTHONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]

nox.options.sessions = ["lint", "tests", "doctests"]
nox.options.sessions = ["lint", "lite", "tests", "doctests"]


DIR = Path(__file__).parent.resolve()
Expand All @@ -27,10 +25,17 @@ def pylint(session: nox.Session) -> None:
session.run("pylint", "src/vector/", *session.posargs)


@nox.session(python=ALL_PYTHONS, reuse_venv=True)
@nox.session
def lite(session: nox.Session) -> None:
"""Run the linter."""
session.install("-e", ".[test]")
session.run("pytest", "--ignore", "tests/test_notebooks.py", *session.posargs)


@nox.session(reuse_venv=True)
def tests(session: nox.Session) -> None:
"""Run the unit and regular tests."""
session.install("-e", ".[awkward,test,test-extras]")
session.install("-e", ".[awkward,numba,test,test-extras]")
session.run("pytest", "--ignore", "tests/test_notebooks.py", *session.posargs)


Expand All @@ -44,14 +49,14 @@ def coverage(session: nox.Session) -> None:
@nox.session(reuse_venv=True)
def doctests(session: nox.Session) -> None:
"""Run the doctests."""
session.install("-e", ".[awkward,test,test-extras]")
session.install("-e", ".[awkward,numba,test,test-extras]")
session.run("pytest", "--doctest-plus", "src/vector/", *session.posargs)


@nox.session(python=ALL_PYTHONS, reuse_venv=True)
@nox.session(reuse_venv=True)
def notebooks(session: nox.Session) -> None:
"""Run the notebook tests"""
session.install("-e", ".[awkward,test,test-extras]", "numba")
session.install("-e", ".[awkward,numba,test,test-extras]", "numba")
session.install("jupyter", "papermill")
session.run("pytest", "tests/test_notebooks.py", *session.posargs)

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ docs = [
"sphinx_book_theme>=0.0.42",
"sphinx_copybutton",
]
numba = [
'numba>=0.57; python_version < "3.12"',
]
test = [
"nox",
"papermill>=2.4",
Expand Down

0 comments on commit 7cb1639

Please sign in to comment.