Skip to content

Describe developer setup in more detail #1859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 27, 2025
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -69,3 +69,29 @@ pre-commit install
# To disable:
# pre-commit uninstall
```

Tests should now pass:

```sh
make check
# To apply formatting fixes instead of erroring:
# make check-fix
```

Or get a full list of helpers with just:

```sh
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
Copy link
Collaborator

@gadenbuie gadenbuie Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this section! But is it still required? We moved from setup.cfg to pyproject.toml between when the linked issue was opened and now and the situation may have changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be something else wrong with my local setup, but plain pip install -e ../py-shiny didn't work for me, and this did.

$ pip uninstall shiny -y -q && pip install -e ../../mccalluc/py-shiny -q --config-settings editable_mode=compat && python -c "import shiny; print(dir(shiny))"
['App', 'Inputs', 'Outputs', 'Session', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_app', '_autoreload', '_connection', '_datastructures', '_deprecated', '_docstring', '_error', '_fileupload', '_hostenv', '_is_pyodide', '_main', '_namespaces', '_shinyenv', '_static', '_typing_extensions', '_utils', '_validation', '_version', '_versions', 'event', 'express', 'html_dependencies', 'http_staticfiles', 'input_handler', 'module', 'quarto', 'reactive', 'render', 'render_image', 'render_plot', 'render_text', 'render_ui', 'req', 'run_app', 'session', 'types', 'ui']

$ pip uninstall shiny -y -q && pip install -e ../../mccalluc/py-shiny -q && python -c "import shiny; print(dir(shiny))"
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']

$ pip uninstall shiny -y -q && pip install shiny -q && python -c "import shiny; print(dir(shiny))"
['App', 'Inputs', 'Outputs', 'Session', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_app', '_autoreload', '_connection', '_datastructures', '_deprecated', '_docstring', '_error', '_fileupload', '_hostenv', '_is_pyodide', '_main', '_namespaces', '_shinyenv', '_static', '_typing_extensions', '_utils', '_validation', '_version', '_versions', 'event', 'express', 'html_dependencies', 'http_staticfiles', 'input_handler', 'module', 'quarto', 'reactive', 'render', 'render_image', 'render_plot', 'render_text', 'render_ui', 'req', 'run_app', 'session', 'types', 'ui']

With compat or regular install from pypi everything works, but with just -e it didn't, at least for me.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for checking. It sounds necessary and the advice will be helpful!

```

See the [docs README](docs/README.md) for instructions on building the documentation locally.
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,14 +18,14 @@ After those dependencies are installed, build the .qmd files for Shiny, using qu
make quartodoc
```

Then build the web site using Quarto:
Then you can build the docs, and serve them locally, and watch for changes to the .qmd files:

```bash
make site
make serve
```

Alternatively, running `make serve` will build the docs, and serve them locally, and watch for changes to the .qmd files:
Alternatively, build the site just once:

```bash
make serve
make site
```
Loading