Site updated at 2017-05-22 20:42:22 UTC
This commit is contained in:
parent
8e403bf0b1
commit
371ab3c213
25 changed files with 62 additions and 67 deletions
|
@ -67,21 +67,12 @@
|
|||
</header>
|
||||
<hr class="divider">
|
||||
<p>You’ll need to set up a development environment if you want to develop a new feature or component for Home Assistant. Read on to learn how to set up.</p>
|
||||
<h3><a class="title-link" name="setup-local-repository" href="#setup-local-repository"></a> Setup Local Repository</h3>
|
||||
<p>Visit the <a href="https://github.com/home-assistant/home-assistant">Home Assistant repository</a> and click <strong>Fork</strong>.
|
||||
Once forked, setup your local copy of the source using the commands:</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>git clone https://github.com/YOUR_GIT_USERNAME/home-assistant.git
|
||||
<span class="gp">$ </span><span class="nb">cd </span>home-assistant
|
||||
<span class="gp">$ </span>git remote add upstream https://github.com/home-assistant/home-assistant.git
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3><a class="title-link" name="prepare-your-environment" href="#prepare-your-environment"></a> Prepare Your Environment</h3>
|
||||
<h4><a class="title-link" name="core-dependencies" href="#core-dependencies"></a> Core dependencies</h4>
|
||||
<h3><a class="title-link" name="preparing-your-environment" href="#preparing-your-environment"></a> Preparing your environment</h3>
|
||||
<h4><a class="title-link" name="developing-on-linux" href="#developing-on-linux"></a> Developing on Linux</h4>
|
||||
<p>Install the core dependencies.</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo apt-get install python3-pip python3-dev
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo apt-get install python3-pip python3-dev python3-venv
|
||||
</code></pre>
|
||||
</div>
|
||||
<h4><a class="title-link" name="platform-dependencies" href="#platform-dependencies"></a> Platform dependencies</h4>
|
||||
<p>In order to run <code class="highlighter-rouge">script/setup</code> below you will need some more dependencies.</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>sudo apt-get install libssl-dev libxml2-dev libxslt1-dev libjpeg-dev libffi-dev libudev-dev
|
||||
</code></pre>
|
||||
|
@ -90,28 +81,38 @@ Once forked, setup your local copy of the source using the commands:</p>
|
|||
Different distributions have different package installation mechanisms and sometimes packages names as well. For example Centos would use: <code class="highlighter-rouge">sudo yum install epel-release && sudo yum install python34 python34-devel mysql-devel</code>
|
||||
</p>
|
||||
<p>Additional dependencies exist if you you plan to perform Frontend Development, please read the <a href="https://home-assistant.io/developers/frontend/">Frontend</a> section to learn more.</p>
|
||||
<h4><a class="title-link" name="setting-up-virtual-environment-optional" href="#setting-up-virtual-environment-optional"></a> Setting up virtual environment (optional)</h4>
|
||||
<h4><a class="title-link" name="developing-on-windows" href="#developing-on-windows"></a> Developing on Windows</h4>
|
||||
<p>If you are using Windows as a development platform, make sure that you have the correct Microsoft Visual C++ build tools installed. Check the <a href="https://wiki.python.org/moin/WindowsCompilers">Windows Compilers</a> section on the <a href="https://www.python.org/">Python website</a> for details. Validation using <code class="highlighter-rouge">tox</code> will fail if this is not done correctly.</p>
|
||||
<p>Also, make sure to install or upgrade the <code class="highlighter-rouge">setuptools</code> Python package. It contains compatibility improvements and adds automatic use of compilers:</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pip install --upgrade setuptools
|
||||
</code></pre>
|
||||
</div>
|
||||
<h4><a class="title-link" name="developing-on-os-x" href="#developing-on-os-x"></a> Developing on OS X</h4>
|
||||
<p>Install <a href="https://brew.sh/">Homebrew</a>, then use that to install Python 3:</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>brew install python3
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3><a class="title-link" name="setup-local-repository" href="#setup-local-repository"></a> Setup Local Repository</h3>
|
||||
<p>Visit the <a href="https://github.com/home-assistant/home-assistant">Home Assistant repository</a> and click <strong>Fork</strong>.
|
||||
Once forked, setup your local copy of the source using the commands:</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>git clone https://github.com/YOUR_GIT_USERNAME/home-assistant.git
|
||||
<span class="gp">$ </span><span class="nb">cd </span>home-assistant
|
||||
<span class="gp">$ </span>git remote add upstream https://github.com/home-assistant/home-assistant.git
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3><a class="title-link" name="setting-up-virtual-environment-optional" href="#setting-up-virtual-environment-optional"></a> Setting up virtual environment (optional)</h3>
|
||||
<p>If you plan on providing isolation to your environment using <a href="https://docs.python.org/3.4/library/venv.html"><code class="highlighter-rouge">venv</code></a>. Within the <code class="highlighter-rouge">home-assistant</code> directory, create and activate your virtual environment.</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>python3 -m venv venv
|
||||
<span class="gp">$ </span><span class="nb">source </span>venv/bin/activate
|
||||
</code></pre>
|
||||
</div>
|
||||
<p>Note, Debian does not ship a full Python3 package and so requires you to install <code class="highlighter-rouge">venv</code> manually <code class="highlighter-rouge">sudo apt-get install python3-venv</code>.</p>
|
||||
<h3><a class="title-link" name="setup-and-run" href="#setup-and-run"></a> Setup and Run</h3>
|
||||
<ul>
|
||||
<li>On Mac OS X and Linux:</li>
|
||||
</ul>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span><span class="nb">cd </span>home-assistant
|
||||
<span class="gp">$ </span>script/setup
|
||||
</code></pre>
|
||||
</div>
|
||||
<ul>
|
||||
<li>
|
||||
<p>On Windows, you can use <code class="highlighter-rouge">python setup.py develop</code> instead of the setup script.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Run <code class="highlighter-rouge">hass</code> to invoke your local installation.</p>
|
||||
</li>
|
||||
<li>Run <code class="highlighter-rouge">hass</code> to invoke your local installation.</li>
|
||||
</ul>
|
||||
<h3><a class="title-link" name="logging" href="#logging"></a> Logging</h3>
|
||||
<p>By default logging in home-assistant is tuned for operating in
|
||||
|
@ -119,12 +120,6 @@ production (set to INFO by default, with some modules set to even less
|
|||
verbose logging levels).</p>
|
||||
<p>You can use the <a href="/components/logger/">logger</a> component to adjust
|
||||
logging to DEBUG to see even more details about what is going on.</p>
|
||||
<h3><a class="title-link" name="developing-on-windows" href="#developing-on-windows"></a> Developing on Windows</h3>
|
||||
<p>If you are using Windows as a development platform, make sure that you have the correct Microsoft Visual C++ build tools installed. Check the <a href="https://wiki.python.org/moin/WindowsCompilers">Windows Compilers</a> section on the <a href="https://www.python.org/">Python website</a> for details. Validation using <code class="highlighter-rouge">tox</code> will fail if this is not done correctly.</p>
|
||||
<p>Also, make sure to install or upgrade the <code class="highlighter-rouge">setuptools</code> Python package. It contains compatibility improvements and adds automatic use of compilers:</p>
|
||||
<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>pip install --upgrade setuptools
|
||||
</code></pre>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
<aside id="sidebar" class="grid__item one-third lap-one-whole palm-one-whole">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue