-
Notifications
You must be signed in to change notification settings - Fork 34
Migrate to poetry #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
338ac90
654f751
e582813
8917deb
c369e75
75e3b03
e2024c1
019decf
7a2f85a
e5b8295
0ece412
df95c01
f4e6e18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| tests: | ||
| name: "Python ${{ matrix.python-version }}" | ||
| runs-on: "ubuntu-latest" | ||
|
|
||
| strategy: | ||
| matrix: | ||
| python-version: ["3.6", "3.7", "3.8"] | ||
|
|
||
| steps: | ||
| - uses: "actions/checkout@v2" | ||
| - uses: "actions/setup-python@v1" | ||
| with: | ||
| python-version: "${{ matrix.python-version }}" | ||
|
|
||
| - name: Install and set up Poetry | ||
| run: | | ||
| curl -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | ||
| python get-poetry.py -y | ||
|
|
||
| - name: "Install tox" | ||
| run: | | ||
| python -m pip install --upgrade tox tox-gh-actions | ||
| - name: "Run tox targets for ${{ matrix.python-version }}" | ||
| run: | | ||
| source $HOME/.poetry/env | ||
| python -m tox |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v2.5.0 | ||
| hooks: | ||
| - id: check-json | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - repo: https://github.com/python/black | ||
| rev: 19.10b0 | ||
| hooks: | ||
| - id: black | ||
| language_version: python3.8 | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v2.4.0 | ||
| hooks: | ||
| - id: flake8 | ||
| language_version: python3.8 | ||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v0.740 | ||
| hooks: | ||
| - id: mypy | ||
| - repo: https://github.com/pre-commit/mirrors-pylint | ||
| rev: v2.4.4 | ||
| hooks: | ||
| - id: pylint | ||
| - repo: https://github.com/asottile/seed-isort-config | ||
| rev: v1.9.4 | ||
| hooks: | ||
| - id: seed-isort-config | ||
| - repo: https://github.com/pre-commit/mirrors-isort | ||
| rev: v4.3.21 | ||
| hooks: | ||
| - id: isort | ||
| additional_dependencies: ['toml'] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| [BASIC] | ||
| good-names=id | ||
|
|
||
| [LOGGING] | ||
| logging-format-style=fstr | ||
|
|
||
| [MESSAGES CONTROL] | ||
| disable= | ||
| missing-module-docstring, | ||
| missing-class-docstring, | ||
| missing-function-docstring, | ||
| no-self-use, | ||
| too-few-public-methods, | ||
| too-many-public-methods, | ||
| too-many-arguments, | ||
| bad-continuation, | ||
| import-error, | ||
| unsubscriptable-object, | ||
| fixme, | ||
| pointless-string-statement, | ||
| redefined-builtin |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,43 @@ | ||
| # Somfy TaHoma | ||
|
|
||
| <p align=center> | ||
| <a href="https://github.com/iMicknl/python-tahoma-api/actions"><img src="https://github.com/iMicknl/python-tahoma-api/workflows/CI/badge.svg"/></a> | ||
| <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" /></a> | ||
| </p> | ||
|
|
||
| An updated and async version of the original [tahoma-api](https://github.com/philklei/tahoma-api) by [@philklei](https://github.com/philklei). The aim of this wrapper is to offer an easy to consume Python wrapper for the internal API's used by tahomalink.com. | ||
|
|
||
| Somfy TaHoma has an official API, which can be consumed via the [Somfy-open-api](https://github.com/tetienne/somfy-open-api). Unfortunately only a few device classes are supported via the official API, thus the need for this wrapper. | ||
|
|
||
| This package is written for the Home Assistant [ha-tahoma](https://github.com/iMicknl/ha-tahoma) integration, but could be used by any Python project interacting with Somfy TaHoma devices. | ||
|
|
||
| # Development | ||
|
|
||
| ## Installation | ||
|
|
||
| * For Linux, install [pyenv](https://github.com/pyenv/pyenv) using [pyenv-installer](https://github.com/pyenv/pyenv-installer) | ||
| * For MacOS, run `brew install pyenv` | ||
| * Don't forget to update your `.bashrc` file (or similar): | ||
| ``` | ||
| export PATH="~/.pyenv/bin:$PATH" | ||
| eval "$(pyenv init -)" | ||
| eval "$(pyenv virtualenv-init -)" | ||
| ``` | ||
| * Install the required [dependencies](https://github.com/pyenv/pyenv/wiki#suggested-build-environment) | ||
| * Install [poetry](https://python-poetry.org): `curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python` | ||
| * Clone this repository | ||
| * `cd python-tahoma-api` | ||
| * Install the required Python version: `pyenv install` | ||
| * Init the project: `poetry install` | ||
| * Run `poetry run pre-commit install` | ||
|
|
||
| ## PyCharm | ||
| As IDE you can use [PyCharm](https://www.jetbrains.com/pycharm/). | ||
|
|
||
| Using snap, run `snap install pycharm --classic` to install it. | ||
|
|
||
| For MacOS, run `brew cask install pycharm-ce` | ||
|
|
||
| Once launched, don't create a new project, but open an existing one and select the **python-tahoma-api** folder. | ||
|
|
||
| Go to *File | Settings | Project: nre-tag | Project Interpreter*. Your interpreter must look like `<whatever>/python-tahoma-api/.venv/bin/python` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15469,4 +15469,4 @@ | |
| } | ||
| }); | ||
|
|
||
| }(jQuery)); | ||
| }(jQuery)); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9884,4 +9884,4 @@ | |
| } | ||
| } | ||
|
|
||
| })(window); | ||
| })(window); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dev on VSCode follows this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the installation part is not linked to any IDE. That's the workflow I usualy follow. You should be able to start from scratch in 5 min only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use PyCharm any ways, so method 2 is good enough for me!