From 76caf5729855165c5b7243535a9cdb02a3e5bd38 Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Wed, 19 Feb 2025 10:41:25 -0500 Subject: [PATCH 1/7] Copy tests from CI to README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index c93dfddd5..7ffa81b45 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,14 @@ pre-commit install # To disable: # pre-commit uninstall ``` + +Tests should now pass: + +```sh +make check-tests +make check-types +make check-lint +make check-format +# TODO: Requires uv. +# make ci-check-mypy-can-run +``` From 0752db059990251670f4d5bccf1fb8e08bb26aec Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Wed, 19 Feb 2025 10:56:05 -0500 Subject: [PATCH 2/7] "uv" should be a dev dependency, but do not need to run mypy --- README.md | 2 -- pyproject.toml | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ffa81b45..eb940b880 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,4 @@ make check-tests make check-types make check-lint make check-format -# TODO: Requires uv. -# make ci-check-mypy-can-run ``` diff --git a/pyproject.toml b/pyproject.toml index 8d7fc8863..497c0bde8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,7 +117,7 @@ dev = [ "google-generativeai;python_version>='3.9'", "langchain_core", # langsmith (needed for langchain_core) versions >= 0.3 - # (up to at least 0.3.2 as of 2025-01-29) + # (up to at least 0.3.2 as of 2025-01-29) # cause an `argparse.ArgumentError` when running `pytest`. # https://github.com/posit-dev/py-shiny/issues/1829 "langsmith<0.3", @@ -126,6 +126,7 @@ dev = [ "tokenizers", "aiohttp", "beautifulsoup4", + "uv", ] doc = [ "jupyter", From 769f52516d6f12d84a4a5d57af09bb693e66be80 Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Wed, 19 Feb 2025 13:35:04 -0500 Subject: [PATCH 3/7] mention quarto install explicitly --- README.md | 4 +++- docs/README.md | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb940b880..fd3dda561 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ git fetch --tags upstream Then install: ```sh -pip install -e ".[dev,test]" +pip install -e ".[dev,test,doc]" ``` Additionally, you can install pre-commit hooks which will automatically reformat and lint the code when you make a commit: @@ -78,3 +78,5 @@ make check-types make check-lint make check-format ``` + +See the [docs README](docs/README.md) for instructions on building the documentation locally. diff --git a/docs/README.md b/docs/README.md index 82f211be5..f89262812 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,7 +5,7 @@ This directory contains files to generate Shiny for Python API documentation, us ## Building the docs -To build the docs, first install the Python dependencies and Quarto extensions: +To build the docs, first [download and install Quarto](https://quarto.org/docs/get-started/), and then install the Python dependencies and Quarto extensions: ```bash # Install build dependencies @@ -22,6 +22,7 @@ Then build the web site using Quarto: ```bash make site +# When this completes, the docs will be available at _site/index.html. ``` Alternatively, running `make serve` will build the docs, and serve them locally, and watch for changes to the .qmd files: From e9671355fa0ce181001334693fa15be2ed67052a Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Wed, 26 Feb 2025 13:36:47 -0500 Subject: [PATCH 4/7] simplify readme, and remove other changes --- README.md | 13 +++++++++---- docs/README.md | 7 ------- pyproject.toml | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fd3dda561..d290c7f0e 100644 --- a/README.md +++ b/README.md @@ -73,10 +73,15 @@ pre-commit install Tests should now pass: ```sh -make check-tests -make check-types -make check-lint -make check-format +make check +# To apply formatting fixes instead of erroring: +# make check-fix ``` +Or get a full list of helpers with just: +```sh +make +``` + + See the [docs README](docs/README.md) for instructions on building the documentation locally. diff --git a/docs/README.md b/docs/README.md index f89262812..512a1d66a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -18,13 +18,6 @@ After those dependencies are installed, build the .qmd files for Shiny, using qu make quartodoc ``` -Then build the web site using Quarto: - -```bash -make site -# When this completes, the docs will be available at _site/index.html. -``` - Alternatively, running `make serve` will build the docs, and serve them locally, and watch for changes to the .qmd files: ```bash diff --git a/pyproject.toml b/pyproject.toml index 497c0bde8..42a133ec5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -126,7 +126,6 @@ dev = [ "tokenizers", "aiohttp", "beautifulsoup4", - "uv", ] doc = [ "jupyter", From d1cad1e390aeeb7f1b4bb4c1e5964c39ea9df259 Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Wed, 26 Feb 2025 13:46:22 -0500 Subject: [PATCH 5/7] restore "make site", but put it last --- docs/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 512a1d66a..31b42e941 100644 --- a/docs/README.md +++ b/docs/README.md @@ -18,8 +18,14 @@ After those dependencies are installed, build the .qmd files for Shiny, using qu make quartodoc ``` -Alternatively, running `make serve` will build the docs, and serve them locally, and watch for changes to the .qmd files: +Then you can build the docs, and serve them locally, and watch for changes to the .qmd files: ```bash make serve ``` + +Alternatively, build the site just once: + +```bash +make site +``` From b306a9339a4cbf8bc0fd65698522e986a9e0ad75 Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Wed, 26 Feb 2025 13:48:26 -0500 Subject: [PATCH 6/7] consistent line breaks --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d290c7f0e..962ed03cd 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ make check ``` Or get a full list of helpers with just: + ```sh make ``` - See the [docs README](docs/README.md) for instructions on building the documentation locally. From 1746fecd65abd7579f57c36bf5dd27cfa8951918 Mon Sep 17 00:00:00 2001 From: Chuck McCallum Date: Wed, 26 Feb 2025 15:46:58 -0500 Subject: [PATCH 7/7] Explain "-e" install. (See #461) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 962ed03cd..268c8de88 100644 --- a/README.md +++ b/README.md @@ -84,4 +84,14 @@ Or get a full list of helpers with just: make ``` +Typically, when developing new features for Shiny, you'll want to try them out in an application. +In a **separate** application directory, use can use `-e` to reference your local checkout of `py-shiny`: + +```sh +# Rather than +# pip install shiny +# run: +pip install -e ../py-shiny --config-settings editable_mode=compat +``` + See the [docs README](docs/README.md) for instructions on building the documentation locally.