From a3cad6dea8648b1164df1a019dd604528b75c7f3 Mon Sep 17 00:00:00 2001 From: masterPiece93 Date: Mon, 10 Nov 2025 11:00:10 +0530 Subject: [PATCH] configured nox --- dev.README.md | 23 +++++++++++++++++++++++ noxfile.py | 33 +++++++++++++++++++++++++++++++++ pytest.ini | 2 ++ 3 files changed, 58 insertions(+) create mode 100644 dev.README.md create mode 100644 noxfile.py create mode 100644 pytest.ini diff --git a/dev.README.md b/dev.README.md new file mode 100644 index 0000000..8561869 --- /dev/null +++ b/dev.README.md @@ -0,0 +1,23 @@ + + +## Nox + +#### Install Nox + +```sh +pipx install --suffix "@gsheet-tools" nox --python python3.12 +``` +- If Alias Required : + - pipx install --alias --python python3.12 + +#### Run Nox + +Run +```sh +nox@gsheet-tools -s test_python_versions +``` + +Run and update nox-output.log +```sh +nox@gsheet-tools -s test_python_versions &> output.log +``` \ No newline at end of file diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..f4e6acb --- /dev/null +++ b/noxfile.py @@ -0,0 +1,33 @@ +"""Nox configuration file for automating testing tasks. + +This script defines the Nox sessions for testing the project across multiple +Python versions. It uses `pytest` as the test runner and includes support for +generating test coverage reports. + +Attributes: + python_versions (list): A list of Python versions to test against. +""" + +import nox + +# Define the Python versions you want to test with +# NOTE: Use pyenv for maintaining multiple Python versions +python_versions = ["3.10", "3.11", "3.12", "3.13"] + +@nox.session(python=python_versions) +def test_python_versions(session: nox.Session): + """Run tests across multiple Python versions. + + This session installs the project, along with the required dependencies + for testing, and then runs the test suite using `pytest`. + + Args: + session (nox.Session): The Nox session object. + """ + # Install Self + session.install(f".") + # Install additional dependencies required for testing + session.install("pytest") # Pytest: Test runner + session.install("pytest-cov") + # Run Pytest + session.run("pytest") diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..7a6c607 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --cov=gsheet_tools --cov-report=term-missing