This manages HWSC user file transactions
This provides file management service which includes the following:
- GetStatus()
- DownloadZippedFiles()
- UploadFile()
- CreateUserFolder()
- Python 3.7 or greater
- pip
- pipenv
- Pycharm or VSCode
- Open your terminal and type
$ python --version
- On your terminal, type
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- On your terminal, type
$ brew install python
to install python - Type
$ which python3
to figure out the path. Example:/usr/local/Cellar/python/3.7.0/bin
- Type
$ vim ~/.bash_profile
to open the.bash_profile
file - Insert
export PATH="/usr/local/Cellar/python/3.7.0/bin/:$PATH"
in the.bash_profile
file - Type
$ source ~/.bash_profile
to adjust the changes - Type
$ python3 --version
to check the version is 3.7 - Call python3.7 by
$ python3
- If you installed python3.7 with Homebrew, you would have pip installed already
- On the terminal, type
$ pip install pipenv
-Type $./generate_dep.sh
. This will create copied proto files from the github urls.
- Change to your project directory by typing
$ cd [project name]
- To spawn a shell in a virtual environment, type
$ pipenv shell
- In the shell, run the bash script by typing
$ ./generate.sh
. This will create Pipfile and Pipfile.lock files that are used for dependency management Pipfile
: track which dependencies your project needs in case you need to reinstall themPipfile.lock
: enables deterministic builds by specifying the exact requirements for reproducing an environment
- To install for development: Type
$ pipenv install --dev
- To install for delivering services in a container:
$ pipenv install
$ pipenv install -dev
(Put dependency indev-packages
inPipfile
)$ pipenv install -env
(UpdatePipfile.lock
)$ pipenv lock
(Lock the environment to ensure the same dependency for production)
- On the command, type
$ pipenv install
. This ignores the Pipfile for installation and use what's in the Pipfile.lock - Type
$ pipenv run python3 main.py
.
- Type
$ pipenv run pytest -v
for testing to see which cases are passed or failed - Type
$ pipenv run pytest --cov=.
to visualize coverage in console - Type
$ pipenv run pytest --cov=. --cov-report=html
to report the coverage in html file
- After the command
$ pipenv run pytest --cov=. --cov-report=html
, it will create htmlcov directory - The test report html files are located in the directory
- Type
$ python3.7 -m flake8 .