-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mhogan-nwra/develop
Bump to Version 0.3.1 (Redo)
- Loading branch information
Showing
10 changed files
with
784 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,99 @@ | ||
"""Run tests using Nox""" | ||
"""Run tests using Nox | ||
Quick Usage | ||
----------- | ||
``` | ||
pdm run nox -s <SESSION_NAME>-<VERSION> | ||
``` | ||
Description | ||
----------- | ||
You have options on how to use Nox depending on which applications are on your platform. If you have all supported | ||
Python versions installed and in your $PATH, then you can use the `noxfile.test` method like so | ||
``` | ||
pdm run nox -s tests_venv # Or | ||
pdm run nox -s tests_virtualenv | ||
``` | ||
If you have a limited installation set, you can install the Anaconda, Mamba, or micromamba and run | ||
``` | ||
pdm run nox -s tests_conda # Or | ||
pdm run nox -s tests_mamba # Or | ||
pdm run nox -s tests_micromamba | ||
``` | ||
""" | ||
from pathlib import Path | ||
|
||
import nox | ||
import os | ||
|
||
os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"}) | ||
supported_pythons = ["3.9", "3.10", "3.11", "3.12"] | ||
|
||
|
||
@nox.session( | ||
python=supported_pythons, | ||
venv_backend="venv" | ||
) | ||
def tests_venv(session: nox.Session) -> None: | ||
"""Test environment the venv venv_backend""" | ||
_pdm_install_test_group(session) | ||
_unifed_test(session) | ||
|
||
|
||
@nox.session( | ||
python=["3.9", "3.10", "3.11", "3.12"], | ||
python=supported_pythons, | ||
venv_backend="virtualenv" | ||
) | ||
def tests(session: nox.Session) -> None: | ||
session.run_always("pdm", "install", "-G", "test", external=True) | ||
def tests_virtualenv(session: nox.Session) -> None: | ||
"""Test environment the virtualenv venv_backend""" | ||
_pdm_install_test_group(session) | ||
_unifed_test(session) | ||
|
||
|
||
@nox.session( | ||
python=supported_pythons, | ||
venv_backend="conda", | ||
) | ||
def tests_conda(session: nox.Session) -> None: | ||
"""Test environment with the conda venv_backend""" | ||
_tests_conda_like(session) | ||
|
||
|
||
@nox.session( | ||
python=supported_pythons, | ||
venv_backend="micromamba", | ||
) | ||
def tests_micromamba(session: nox.Session) -> None: | ||
"""Test environment with the micromamba venv_backend""" | ||
_tests_conda_like(session) | ||
|
||
|
||
@nox.session( | ||
python=supported_pythons, | ||
venv_backend="mamba", | ||
) | ||
def tests_mamba(session: nox.Session) -> None: | ||
"""Test environment with the mamba venv_backend""" | ||
_tests_conda_like(session) | ||
|
||
|
||
def _pdm_install_test_group(session: nox.Session) -> None: | ||
session.run_always("pdm", "install", "-dG", "test", external=True) | ||
|
||
|
||
def _tests_conda_like(session: nox.Session) -> None: | ||
session.run_always("pdm", "build", external=True) | ||
session.install("--upgrade", "pip") | ||
session.run_always("pip", "install", "-f", os.fspath(Path.cwd() / "dist"), "envector") | ||
session.install("pytest", "pytest-cov", "pytest-pep8", "hypothesis") | ||
_unifed_test(session) | ||
|
||
def _unifed_test(session: nox.Session) -> None: | ||
"""The unified command to run the test suite""" | ||
session.run("pytest", "-rxsXf", "--doctest-modules", "src", "tests") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
from .objects import * | ||
|
||
|
||
__version__ = "0.3.0" | ||
__version__ = "0.3.1" | ||
|
||
|
||
def test(*options): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.