From ca58cc12915c281505e54725a9b8310a2611647f Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Mon, 21 Jun 2021 14:43:03 -0400 Subject: [PATCH] Update Dev Environment Setup Guide --- docs/Dev Environment Setup Guide.md | 34 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/docs/Dev Environment Setup Guide.md b/docs/Dev Environment Setup Guide.md index 6ae7118..b2c611c 100644 --- a/docs/Dev Environment Setup Guide.md +++ b/docs/Dev Environment Setup Guide.md @@ -13,7 +13,7 @@ This document will walk you through the setup and configuration of a development These are already installed on the provided development machines. - [git](https://git-scm.com/downloads) -- [Python](https://www.python.org/downloads/) == 3.6.9 +- [Python](https://www.python.org/downloads/) >= 3.6.9 ## Configuring Your SSH Keys We will be using SSH keys to authenticate to both the development machines and GitHub. @@ -55,9 +55,11 @@ In your editor of choice, create the file `~/.ssh/config` and add this: Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu User campb303 - # Forward webqueue2 API Port + # Forward Flask Debug Port LocalForward 5000 localhost:5000 - # Forward webqueue2 API Docs Port + # Forward MkDocs Port + LocalForward 5000 localhost:6060 + # Forward gunicorn Port LocalForward 8000 localhost:8000 ``` @@ -81,14 +83,16 @@ Development machines are not publicly accessible. You'll need to be connected to Host campb303-pier HostName pier.ecn.purdue.edu User campb303 - + Host campb303-w2vm1 HostName w2vm1.ecn.purdue.edu ProxyJump campb303-pier User campb303 - # Forward webqueue2 API Port + # Forward Flask Debug Port LocalForward 5000 localhost:5000 - # Forward webqueue2 API Docs Port + # Forward MkDocs Port + LocalForward 5000 localhost:6060 + # Forward gunicorn Port LocalForward 8000 localhost:8000 ``` @@ -214,7 +218,7 @@ This will create a `webqueue2-api` folder in your user's home directory. Open th ## Configuring VS Code ### Installing Extensions -- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for Python language support, IntelliSense, virtual environments and debugging +- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) for Python language support, IntelliSense, virtual environments and debugging - [Git Graph](https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph) for a more detailed view of git info - [Markdown Preview GitHub Styling](https://marketplace.visualstudio.com/items?itemName=bierner.markdown-preview-github-styles) for previewing Markdown as it will appear on GitHub - [Python Docstring Generator](https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring) for generating Google style docstrings according to section 3.8 of [Google's Python style guide](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings) @@ -226,7 +230,7 @@ The Python extension supports virtual environments but needs to be told where th Create or modify the file `.vscode/settings.json` and add the following: ```none -"python.pythonPath": "./venv/bin/python3" +"python.defaultInterpreterPath": "./venv/bin/python3" ``` !!! tip @@ -284,16 +288,14 @@ webqueue2 API has multiple [conditional dependencies](https://setuptools.readthe | Condition | Installation Command | Description | | - | - | - | -| Production | `pip install webqueue2-api` | For use in production. Only installed needed packages. | -| Development | `pip install webqueue2-api[dev]` | For use in development. Installs everything for production and extra packages for development. | -| Documentation | `pip install webqueue2-api[docs]` | For use in creating documentation. Installs everything for production and extra packages for documentation. | -| All | `pip install webqueue2-api[all]` | A shortcut for installing production, development and documentation dependencies. | +| Production | `pip install .` | For use in production. Only installed needed packages. | +| Development | `pip install .[dev]` | For use in development. Installs everything for production and extra packages for development. | +| Documentation | `pip install .[docs]` | For use in creating documentation. Installs everything for production and extra packages for documentation. | +| All | `pip install .[all]` | A shortcut for installing production, development and documentation dependencies. | ### API Commands | Command | Description | | - | - | -| `python3 -m webqueue2_api start-api` | Starts the API on [localhost:5000](http://localhost:5000). See [Getting Started](./api/Getting Started.md) for more info. | -| `python3 -m webqueue2_api stop-api` | Stops the API. | -| `python3 -m webqueue2_api restart-api` | Stops and starts the API. | -| `mkdocs serve` | This will start a local server on [localhost:8000](http://localhost:8000) to access the API docs. As you change API documentation files in `./docs/` you'll see your changes in the browser. | +| `gunicorn webqueue2api.api:app` | This will start a local server on [localhost:8000](http://localhost:8000) to access the API. | +| `mkdocs serve` | This will start a local server on [localhost:6060](http://localhost:6060) to access the API docs. As you change API documentation files in `./docs/` you'll see your changes in the browser. | | `mkdocs build` | This will output a static bundle of the API documentation in `./site/` that can be put on any webserver. | \ No newline at end of file