Navigation Menu

Skip to content

Commit

Permalink
Added support for tox and made coveralls work (#85)
Browse files Browse the repository at this point in the history
* Added support for tox
* Added an image for coveralls
* Added modules pytest-timeout, coveralls, pytest-cov
* Create install-aiocoap.sh (We are referencing this file in the readme and tests won't run without the file so I'm putting it back again.)
  • Loading branch information
Patrik committed Oct 28, 2017
1 parent d67b240 commit 472cdac
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -18,9 +18,10 @@ install:
- pip install -r requirements.txt
- pip install -r requirements_test.txt
- python3 setup.py develop
- pip install -U tox coveralls
language: python
script:
- py.test
- flake8
after_success:
- coveralls
- travis_wait tox
after_success: coveralls
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -18,6 +18,7 @@ Table of contents:
3. [Implement in your own Python platform](#3-implement-in-your-own-python-platform)
4. [Docker support](#4-docker-support)
5. [Acknowledgements](#5-acknowledgements)
6. [Coverage](#6-coverage)

## 1. Installation
In order to use the code, you first need to install [libcoap](https://github.com/obgm/libcoap)(sync), or cython3, [tinydtls](https://git.fslab.de/jkonra2m/tinydtls) and [aiocoap](https://github.com/chrysn/aiocoap) depending on which functionality you're interested in, as per the following instructions (you might have to use sudo for some commands to work).
Expand Down Expand Up @@ -73,3 +74,6 @@ There is a Docker script available to bootstrap a dev environment. Run `./script
This is an implementation based on analysis [I](https://github.com/ggravlingen/) found [here](https://bitsex.net/software/2017/coap-endpoints-on-ikea-tradfri/) by [vidarlo](https://bitsex.net/).

A lot of work was also put in by Paulus Schoutsen ([@balloob](https://github.com/balloob)) who took the initial code concept into this library. Further work was done by Lewis Juggins ([@lwis](https://github.com/lwis)) to take the library to 2.0 with support for asyncio and 3.0 with more effective management of dependencies and consistency around return types. Lennart Buhl [@r41d](https://github.com/r41d) and Maciej Sokołowski [@matemaciek](https://github.com/matemaciek) made sure the library is supporting RGB bulbs.

## 6. Coverage
[![Coverage Status](https://coveralls.io/repos/github/ggravlingen/pytradfri/badge.svg?branch=master)](https://coveralls.io/github/ggravlingen/pytradfri?branch=master)
3 changes: 3 additions & 0 deletions requirements_test.txt
@@ -1,2 +1,5 @@
pytest>=3.2.3
flake8
pytest-timeout>=1.2.0
coveralls
pytest-cov
7 changes: 7 additions & 0 deletions script/install-aiocoap.sh
@@ -0,0 +1,7 @@
-#!/bin/sh
-cd ../..
-git clone https://github.com/chrysn/aiocoap
-cd aiocoap
-git reset --hard 3286f48f0b949901c8b5c04c0719dc54ab63d431
-python3 -m pip install --upgrade pip setuptools
-python3 -m pip install .
25 changes: 25 additions & 0 deletions tox.ini
@@ -0,0 +1,25 @@
[tox]
envlist = py34, py35, py36, lint, requirements, typing
skip_missing_interpreters = True

[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/pytradfri
whitelist_externals = /usr/bin/env
install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages}
commands =
py.test --timeout=30 --duration=10 --cov --cov-report= {posargs}
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements_test.txt

[testenv:lint]
basepython = python3
ignore_errors = True
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements_test.txt
commands =
flake8
pylint pytradtri
pydocstyle pytradtri tests

0 comments on commit 472cdac

Please sign in to comment.