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 pythonto install python - Type
$ which python3to figure out the path. Example:/usr/local/Cellar/python/3.7.0/bin - Type
$ vim ~/.bash_profileto open the.bash_profilefile - Insert
export PATH="/usr/local/Cellar/python/3.7.0/bin/:$PATH"in the.bash_profilefile - Type
$ source ~/.bash_profileto adjust the changes - Type
$ python3 --versionto 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-packagesinPipfile)$ 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 -vfor 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=htmlto 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 .