From 8336ab64f7ac0c3a33a121ff1984ec530c8d41fc Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Fri, 2 Apr 2021 17:16:01 -0400 Subject: [PATCH] Finish installation docs --- docs/api/Installation.md | 84 ++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 55 deletions(-) diff --git a/docs/api/Installation.md b/docs/api/Installation.md index 6552a27..f04d7ed 100644 --- a/docs/api/Installation.md +++ b/docs/api/Installation.md @@ -1,57 +1,31 @@ # Installation -The api is hosted as its own package in a dedicated git repository, https://github.itap.purdue.edu/ECN/webqueue2-api, and is easily installable via `pip`. - -### Install via command line -This is the syntax for installing the api: -``` -pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@#egg=webqueue2-api -``` -For example, to install version `0.9.1`, replace `` in the above command like this: -``` -pip install git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api -``` - -### Install via requirements.txt -Append this line in the requirements file: -``` -git+https://github.itap.purdue.edu/ECN/webqueue2-api@#egg=webqueue2-api -``` -For example, to install version `0.9.1`, replace `` in the above line above like this: -``` -git+https://github.itap.purdue.edu/ECN/webqueue2-api@0.9.1#egg=webqueue2-api -``` -### Package Structure -The name of the package itself is `webqueue2-api` and follows this structure: -``` -─webqueue2-api (git repo) -│ -├───__init__.py -├───api.py -├───ECNQueue.py -└───setup.py -``` -**ECNQueue.py:** -The parser that iterates through items and resturns a json formatted string. - -**api.py:** -The bridge between the fronted and the parser: the frontend sends requests to `api.py` which are translated into functions present in the `ECNQueue.py`, and the json returned by `ECNQueue.py` is thus returned to the frontend. - -**setup.py:** -Stores important information about the `webqueue2-api` package including: - -* The version -* Dependencies that are installed with `webqueue2-api` -* The name of the package (`webqueue2-api`) -* The python version requirement, which is anything including and beyond python version 3.6 - -**\_\_init\_\_.py** -Specifies to `pip` that the current directory is a package, doesn't contain any code, but any code contained within `__init__.py` is executed when ever the `webqueue2-api` package is imported. - -### Importing the package - -The package cannot be referenced directly (need to check on this), however, both the `api` and `ECNQueue` modules can be directly imported after successfully installing the webqueue2-api package: -```python -import ECNQueue -import api -``` \ No newline at end of file +The webqueue2 API is publicly available at [{{ production_url }}/api]({{ production_url }}/api) but you can install it on your own machine if you'd like. + +The code is available on [GitHub]({{ config.repo_url }}). Available package versions can be seen on the [releases page]({{ config.repo_url }}/releases) and can be installed via pip, a requirements file, or downloaded and installed manually. + +!!! warning "pip available on ECN machines needs updated." + Installation via pip is possible through pip's [VCS support](https://pip.pypa.io/en/stable/reference/pip_install/#vcs-support) which was introduced in pip 19. The version of pip available on ECN supported machines is too old and needs updated. To update pip, run: + + ```bash + pip install -U pop + ``` + +=== "Install via pip" + To install webqueue2-api 0.9.1, you can run: + + ``` + pip install git+{{ config.repo_url }}@0.9.1#egg=webqueue2-api + ``` + + If you'd like a version other than 0.9.1 simply replace the that version number with a different version listed on the [releases page]({{ config.repo_url }}/releases). + +=== "Install via requirements file" + To install webqueue2-api 0.9.1, place the following line your requirements file: + + ```bash + echo "git+{{ config.repo_url }}@0.9.1#egg=webqueue2-api" >> requirements.txt + pip install -r requirements.txt + ``` + + If you'd like a version other than 0.9.1 simply replace the that version number with a different version listed on the [releases page]({{ config.repo_url }}/releases). \ No newline at end of file