Skip to content

Commit

Permalink
Update pre-requisites
Browse files Browse the repository at this point in the history
  • Loading branch information
andrie committed Jul 29, 2024
1 parent 4621e21 commit bf25b71
Showing 1 changed file with 39 additions and 14 deletions.
53 changes: 39 additions & 14 deletions docs/pre-requisites.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,62 @@ There are two ways to work through the examples and exercises in this workshop.

### 1) In your web browser with Shinylive

**This option is what we will use during the workshop.**
::: {.callout-note}
This option is what we will use during the workshop.
:::

Shinylive allows you to run full-featured shiny apps in your browser, and includes a basic editor which is good enough to run examples.

As a result you should be able to work through all of the examples in the workshop using just the browser without installing anything locally.

### 2) Optional: on your laptop with VS Code (or Positron)

**You are welcome to use this option if you know how to set up Python and your preferred IDE. We will only be able to give minimal support for this option during the workshop.**
::: {.callout-note}
You are welcome to use this option if you know how to set up Python and your preferred IDE. We will only be able to give minimal support for this option during the workshop.

**You can use [Positron](https://github.com/posit-dev/positron) if you feel adventurous.**
You can use [Positron](https://github.com/posit-dev/positron) instead of VS Code if you feel adventurous.
:::

While Shinylive is great, it likely isn't the environment you'll use to develop Shiny apps, and so it makes sense to set up VS Code and run the examples locally. To do this follow these steps before the workshop:

1) Install [VS Code](https://code.visualstudio.com/)
1. Install [VS Code](https://code.visualstudio.com/)

2) Install the Shiny for Python [VS Code extension](https://marketplace.visualstudio.com/items?itemName=posit.shiny-python)
1. Install the Shiny for Python [VS Code extension](https://marketplace.visualstudio.com/items?itemName=posit.shiny-python)

1. Clone the repository using:

``` sh
git clone https://github.com/rstudio/shiny-python-workshop-2023.git
```

or alternately download the repository as a zip file:

3) Clone the repository with `git clone https://github.com/rstudio/shiny-python-workshop-2023.git`, or alternately download the repository as a zip file: \
![](../images/git-download-button.png){width="287"}

4) Navigate to the project directory and create a new virtual environment with `python3 -m venv .venv`
1. Navigate to the project directory and create a new virtual environment using

```{.python}
python3 -m venv .venv
```

1. Set your python interpreter to the virtual environment with {{< kbd CMD+SHIFT+P >}} and then typing `Select Interpreter`

1. Open a new terminal prompt, which should switch to `(.venv)`

Or ensure the virtual environment is activated by running:

``` sh
source .venv/bin/activate
```

5) Set your python interpreter to the virtual environment with `CMD + SHIFT + P` \> `Select Interpreter`
1. Install the relevant packages with `pip install -r requirements.txt`

6) Open a new terminal prompt, which should switch to `(.venv)`
All of the example apps and problems are stored in the `/docs/exercises` directory.

7) Install the relevant packages with `pip install -r requirements.txt`
If you've installed the Shiny for Python VS Code extension, you can run any of the apps by opening the `app.py` file and clicking the play button in the top right.
All of the example apps are stored in the `/apps` directory.
The examples are in `apps/examples` and the problem sets are in `apps/core`.
If you've installed the Shiny for Python VS Code extension, you can run any of the apps by opening the `app.py` file and clicking the play button in the top right. ([See screenshot](https://camo.githubusercontent.com/5d947e6dff7d74fd1cf221e79583105c42e4986ae673ce79733ce5edbfdcdda5/68747470733a2f2f7368696e792e7273747564696f2e636f6d2f70792f646f63732f6173736574732f7673636f64652e706e67))
Alternatively, run a shiny app from the command line using:
Alternatively, run them from the command line with `shiny run <path-to-app.py> --reload`.
```{.python}
shiny run <path-to-app.py> --reload
```

0 comments on commit bf25b71

Please sign in to comment.