From f849deab74f4a9b662a6bef6003949204a83cfd3 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 30 Oct 2023 15:12:17 -0700 Subject: [PATCH 1/5] How to add dependencies in more detail Refs #1020 --- docs/environment.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/environment.md b/docs/environment.md index ddbf0b24a..962370c8f 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -75,7 +75,14 @@ hatch run test -VV Hatch ensures that environments are always compatible with the currently defined [project dependencies](config/metadata.md#dependencies) (if [installed](config/environment/overview.md#skip-install) and in [dev mode](config/environment/overview.md#dev-mode)) and [environment dependencies](config/environment/overview.md#dependencies). -For example, add `cowsay` as a dependency then try to run it: +To add `cowsay` as a dependency, open `pyproject.toml` and add it to the `dependencies` list there: + +```toml +dependencies = [ + "cowsay" +] +``` +This dependency will be installed the next time you use the `hatch run` command. For example: ```console $ hatch run cowsay -t "Hello, world!" @@ -91,6 +98,7 @@ Syncing dependencies ||----w | || || ``` +Note the "Syncing dependencies" line there, output by Hatch when it installed the new dependency that was missing from the environment. ## Selection From c027d966275917009ebcf9bf74de2b7d63417b1a Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 31 Oct 2023 21:45:00 -0700 Subject: [PATCH 2/5] Update docs/environment.md Co-authored-by: Ofek Lev --- docs/environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/environment.md b/docs/environment.md index 962370c8f..7db9f6cce 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -75,7 +75,7 @@ hatch run test -VV Hatch ensures that environments are always compatible with the currently defined [project dependencies](config/metadata.md#dependencies) (if [installed](config/environment/overview.md#skip-install) and in [dev mode](config/environment/overview.md#dev-mode)) and [environment dependencies](config/environment/overview.md#dependencies). -To add `cowsay` as a dependency, open `pyproject.toml` and add it to the `dependencies` list there: +To add `cowsay` as a dependency, open `pyproject.toml` and add it to the [`dependencies`](config/metadata.md#dependencies) array: ```toml dependencies = [ From 8ac941e36c46503d00305e66d71dd56db3495b38 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 31 Oct 2023 21:45:06 -0700 Subject: [PATCH 3/5] Update docs/environment.md Co-authored-by: Ofek Lev --- docs/environment.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/environment.md b/docs/environment.md index 7db9f6cce..fda9fabc9 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -77,7 +77,9 @@ Hatch ensures that environments are always compatible with the currently defined To add `cowsay` as a dependency, open `pyproject.toml` and add it to the [`dependencies`](config/metadata.md#dependencies) array: -```toml +```toml tab="pyproject.toml" +[project] +... dependencies = [ "cowsay" ] From d2ba54707d1c274d6721e402414ce93df57bca26 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 31 Oct 2023 21:45:17 -0700 Subject: [PATCH 4/5] Update docs/environment.md Co-authored-by: Ofek Lev --- docs/environment.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/environment.md b/docs/environment.md index fda9fabc9..7a6892a50 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -84,7 +84,8 @@ dependencies = [ "cowsay" ] ``` -This dependency will be installed the next time you use the `hatch run` command. For example: + +This dependency will be installed the next time you [spawn a shell](#entering-environments) or [run a command](#command-execution). For example: ```console $ hatch run cowsay -t "Hello, world!" From c43763c15c94005542e83f91b0c959a2860a03a3 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 31 Oct 2023 21:45:23 -0700 Subject: [PATCH 5/5] Update docs/environment.md Co-authored-by: Ofek Lev --- docs/environment.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/environment.md b/docs/environment.md index 7a6892a50..362923349 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -101,7 +101,9 @@ Syncing dependencies ||----w | || || ``` -Note the "Syncing dependencies" line there, output by Hatch when it installed the new dependency that was missing from the environment. + +!!! note + The `Syncing dependencies` status will display temporarily when Hatch updates environments in response to any dependency changes that you make. ## Selection