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-brew
for installing the required tools. Before you install new things, please check your installation and updatehome-brew
:brew doctor brew update
If 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 >> /Users/sallius/.zprofile echo 'eval "$(/usr/local/bin/brew shellenv)"' >> /Users/sallius/.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 docker
In 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
pyenv
so we can easily switch the Python versionA description how to install
pyenv
you will find here: pyenv projectThen install
pyenv
and 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
pyenv
andvenv
Start
vscode
and enter the workspace of the proxy:cd tsun-gen3-proxy code tsun.code-workspace
Then open a new terminal (
zsh
) for the working-directorytsun-gen3-proxy
and create the python environment with the required python packages:make install
-
Install
vscode
packages: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 hadolint
and install the
vscode
package:hadolint
-
Create .env file and build your first docker container or Home Assistant Add-on
Save the
.env-example
file as.env
to create a new file. Now set the variable in the file with your values. Build a docker container:make dev
or build a Home Assistant Add-on:
make addon-dev