|
3 | 3 | This project aims to uphold Python [community norms](https://www.python.org/psf/conduct/) and make use of [recommended |
4 | 4 | tooling](https://packaging.python.org/guides/tool-recommendations/). |
5 | 5 |
|
| 6 | +To get started, you'll want to: |
| 7 | +- clone the repo into a project directory |
| 8 | +- setup a virtual 3.5+ python environment in the project directory |
| 9 | +- activate that virtual environment |
| 10 | +- install the dependencies |
| 11 | +- validate your build environment with some sample commands |
| 12 | + |
| 13 | +While there are several different tools and techniques you can use to accomplish the |
| 14 | +steps listed above, the following is an example which uses `venv`. |
| 15 | + |
| 16 | +```bash |
| 17 | +# Clone the repo |
| 18 | +cd ~/dev |
| 19 | +git clone https://github.com/rstudio/rsconnect-python.git |
| 20 | +cd rsconnect-python |
| 21 | +# Setup a virtual python environment |
| 22 | +python3 -m venv .venv |
| 23 | +# Activate the virtual environment |
| 24 | +source .venv/bin/activate |
| 25 | +# install our requirements into the virtual environment |
| 26 | +pip install -r requirements.txt |
| 27 | +# install rsconnect-python with a symbolic link to the locations repository, |
| 28 | +# meaning any changes to code in there will automatically be reflected |
| 29 | +pip install -e ./ |
| 30 | +``` |
| 31 | + |
6 | 32 | ## Workflow |
7 | 33 |
|
8 | | -The [`test` job in the default GitHub Actions workflow](.github/workflows/main.yml) reflects a typical set of steps for |
9 | | -building and testing. |
| 34 | +With your venv setup and active, as described previously, running rsconnect-python using your codebase is as simple as running the `rsconnect` command from the terminal. |
| 35 | + |
| 36 | +Typical makefile targets are: |
| 37 | + |
| 38 | +```bash |
| 39 | +# verify code formats are correct |
| 40 | +make fmt |
| 41 | +# lint the codebase |
| 42 | +make lint |
| 43 | +# run the tests (w/ python 3.8) |
| 44 | +make test |
| 45 | +# run the tests with all versions of python |
| 46 | +make all-tests |
| 47 | +``` |
| 48 | + |
| 49 | +As another example, the [`test` job in the default GitHub Actions workflow](.github/workflows/main.yml) |
| 50 | +uses some of these targets during the CI for building and testing. |
10 | 51 |
|
11 | 52 | ## Proposing Change |
12 | 53 |
|
|
0 commit comments