From 2ae222093154dd90b6ae12dd74b94904b07e520f Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Wed, 6 Nov 2024 13:43:26 -0900 Subject: [PATCH] update docs --- docs/contributing/development.md | 49 +++++++++++++++++++++----------- noxfile.py | 2 +- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/docs/contributing/development.md b/docs/contributing/development.md index f97ae682..7f5a21ad 100644 --- a/docs/contributing/development.md +++ b/docs/contributing/development.md @@ -20,28 +20,45 @@ If you don't have pipx (pip for applications), then you can install with pip is reasonable). If you use macOS, then pipx and nox are both in brew, use `brew install pipx nox`. -To use, run `nox` without any arguments. This will run type checks and unit -tests using the installed version of Python on your system. +To use, run `nox` without any arguments. This will run the type check and unit +test "sessions" (tasks) using your local (and active) Python version. +Nox handles everything for you, including setting up a temporary virtual +environment for each run. +You can see all available sessions with `nox --list`: + +``` +$ nox --list +Sessions defined in earthaccess/noxfile.py: + +* typecheck -> Typecheck with mypy. +* tests -> Run the unit tests. +- test-min-deps -> Run the unit tests using the lowest compatible version of all direct dependencies. +- integration-tests -> Run the integration tests. +- build-pkg -> Build a source distribution and binary distribution (wheel). +- serve-docs -> Build the documentation and serve it. + +sessions marked with * are selected, sessions marked with - are skipped. +``` You can also run individual tasks (_sessions_ in `nox` parlance, hence the `-s` option below), like so: - -```console -nox -s typecheck # Run typechecks -nox -s tests # Run unit tests -nox -s integration-tests # Run integration tests (see note below) -nox -s serve_docs # Build and serve the docs -nox -s build_pkg # Build an SDist and Wheel +```bash +nox -s integration-tests +``` +and pass options to the underlying session like: +```bash +nox -s integration-tests -- [ARGS] ``` -Nox handles everything for you, including setting up a temporary virtual -environment for each run. +!!! tip + + In order to run integration tests locally, you must set the + environment variables `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD` to your + username and password, respectively, of your + [NASA Earthdata](https://urs.earthdata.nasa.gov/) account (registration is + free). + -**NOTE:** In order to run integration tests locally, you must set the -environment variables `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD` to your -username and password, respectively, of your -[NASA Earthdata](https://urs.earthdata.nasa.gov/) account (registration is -free). ## Manual development environment setup diff --git a/noxfile.py b/noxfile.py index 23341d2a..1386948b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -33,7 +33,7 @@ def tests(session: nox.Session) -> None: @nox.session(name="test-min-deps", python="3.9") def test_min_deps(session: nox.Session) -> None: - """Run the unit tests.""" + """Run the unit tests using the lowest compatible version of all direct dependencies.""" session.install("--resolution", "lowest-direct", "--editable", ".[test]") session.run( "pytest",