mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-20 15:56:51 +00:00
Update development_environment.markdown (#465)
* Update development_environment.markdown * Update development_environment.markdown venv & farcy * Update development_environment.markdown
This commit is contained in:
parent
44d1200534
commit
5535c1f84c
@ -22,7 +22,7 @@ Home Assistant is open-source and MIT licensed. The source can be found here:
|
||||
You will need to set up a development environment if you want to start developing a new feature or component for Home Assistant. Please follow these steps to get setup.
|
||||
Visit the [the Home Assistant repository](https://github.com/home-assistant/home-assistant) first and click fork in the top right.
|
||||
|
||||
We suggest that you setup a [virtual environment](https://docs.python.org/3.4/library/venv.html) aka `venv` before running the setup script.
|
||||
We suggest that you setup a virtual environment using [`venv`](https://docs.python.org/3.4/library/venv.html) before running the setup script.
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/YOUR_GIT_USERNAME/home-assistant.git
|
||||
@ -30,6 +30,9 @@ $ cd home-assistant
|
||||
$ git remote add upstream https://github.com/home-assistant/home-assistant.git
|
||||
$ script/setup
|
||||
```
|
||||
On Windows you can use `python setup.py develop` instead of the setup script.
|
||||
|
||||
After following these steps, running `hass` will invoke your local installation.
|
||||
|
||||
### {% linkable_title Testing your work %}
|
||||
|
||||
@ -39,8 +42,6 @@ Testing your work requires `tox` to be installed:
|
||||
$ pip3 install tox
|
||||
```
|
||||
|
||||
After following these steps, running `hass` will invoke your local installation.
|
||||
|
||||
### {% linkable_title Prevent Linter Errors %}
|
||||
|
||||
Home Assistant enforces strict [PEP8 style](https://www.python.org/dev/peps/pep-0008/) compliance on all code submitted. You can save yourself the hassle of extra commits just to fix style errors by enabling the flake8 git commit hook. It will check your code when you attempt to commit to the repo. It will block the commit if there are any style issues, giving you a chance to fix it.
|
||||
@ -74,14 +75,17 @@ If you're taking a while developing your feature request and would like to catch
|
||||
|
||||
```bash
|
||||
# Run this from your feature branch
|
||||
$ git fetch upstream dev # to pull the latest changes into a local dev branch
|
||||
$ git fetch upstream dev # to pull the latest changes into a local dev branch
|
||||
$ git rebase upstream/dev # to put those changes into your feature branch before your changes
|
||||
```
|
||||
|
||||
### {% linkable_title Squashing your commits %}
|
||||
|
||||
Your feature is done, it looks great and the tests are all passing. What now? Squash your commits, and create a pull request. Squashing your commits makes for a more readable git commit history. It's an interactive process that is best explained by Matt Stauffer in [this video](https://www.youtube.com/watch?v=7IfkL8swmFw).
|
||||
If rebase detects conflicts, you can repeat the following process until all changes have been resolved:
|
||||
|
||||
1. `git status` will show you the file with the conflict.
|
||||
2. Edit the file and resolving the lines between `<<<< | >>>>`
|
||||
3. Add the modified file `git add <file>` or `git add .`
|
||||
4. Continue rebase `git rebase --continue`
|
||||
5. Repeat until you've resolved all conflicts.
|
||||
|
||||
### {% linkable_title Further reading %}
|
||||
|
||||
@ -92,3 +96,4 @@ Your feature is done, it looks great and the tests are all passing. What now? Sq
|
||||
- [Rest API](/developers/api/)
|
||||
- [Server-sent events](/developers/server_sent_events/)
|
||||
- [Website](/developers/website/)
|
||||
- [Home Assitant on Github - CONTRIBUTING.md](https://github.com/home-assistant/home-assistant/blob/dev/CONTRIBUTING.md)
|
||||
|
Loading…
x
Reference in New Issue
Block a user