Dev environment - s-allius/tsun-gen3-proxy GitHub Wiki
Development Setup
For easy contribution here you find the recommended setup:
-
Update or install Homebrew On MacOS you should use
home-brewfor installing the required tools. Before you install new things, please check your installation and updatehome-brew:brew doctor brew updateIf you have no home-brew you can easily install it:
xcode-select --install /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo >> ~/.zprofile echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile eval "$(/usr/local/bin/brew shellenv)" -
Install 'vscode' from code.visualstudio.com
brew install --cask visual-studio-code -
Install 'docker-desktop' from www.docker.com
brew install --cask dockerIn this project we build multiarch container and use attestations. Please check if you have to enable cantainerd usage on your system for supporting this:
-
Install readline, xz and gettext
brew install readline xz gettext -
Install
pyenvso we can easily switch the Python versionA description how to install
pyenvyou will find here: pyenv projectThen install
pyenvand set some environments for your shellbrew install pyenv echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zprofile echo '[ -d $PYENV_ROOT/bin ](/s-allius/tsun-gen3-proxy/wiki/--d-$PYENV_ROOT/bin-) && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zprofile echo 'eval "$(pyenv init -)"' >> ~/.zprofile -
Download repositories
mkdir tsun cd tsun git clone https://github.com/s-allius/tsun-gen3-proxy.git git clone https://github.com/s-allius/tsun-gen3-proxy.wiki.git git clone https://github.com/s-allius/ha-addons.git -
Setup a virtual environment with
pyenvandvenvStart
vscodeand enter the workspace of the proxy:cd tsun-gen3-proxy code tsun.code-workspaceThen open a new terminal (
zsh) for the working-directorytsun-gen3-proxyand create the python environment with the required python packages:make install -
Install
vscodepackages:Python,Pylance,Python Debugger,Docker,Flake8,yUML,Markdown All In One,markdownlint,Coverage Gutters,GitHub Pull Requests,Better Jinja,Git Graph -
Optional: install hadolint for Dockerfile checking
brew install hadolintand install the
vscodepackage:hadolint -
Create .env file and build your first docker container or Home Assistant Add-on
Save the
.env-examplefile as.envto create a new file. Now set the variable in the file with your values. Build a docker container:make devor build a Home Assistant Add-on:
make addon-dev