1
mirror of https://github.com/home-assistant/core synced 2024-07-30 21:18:57 +02:00
Commit Graph

46 Commits

Author SHA1 Message Date
Ville Skyttä
3e6b9a17cc Run mypy in pre-commit (#27339)
* Move mypy files config to setup.cfg

* Add mypy in pre-commit
2019-10-08 14:45:24 -07:00
Ville Skyttä
49a5dda7a8 Upgrade pydocstyle to 4.0.0, do not run in tox (#25667)
* Upgrade pydocstyle to 4.0.0 and flake8-docstrings to 1.3.1

http://www.pydocstyle.org/en/4.0.0/release_notes.html#july-6th-2019

* Address pydocstyle D413's

* tox: do not run pydocstyle

Does not seem to add any value over flake8-docstrings (and would have
needed a D202 exclusion).
2019-08-04 17:05:43 +02:00
Ville Skyttä
3cf8964c06 Python < 3.6 remainder cleanups (#25607) 2019-07-31 12:21:15 -07:00
Paulus Schoutsen
0f174250cc
Update PR template (#23520)
* Update PR template

* Update config, PR template
2019-05-07 14:18:40 -07:00
Ian
6fb5b8467b Fix tox.ini lint target (#23359)
tox fails due to being unable to reference the `script` module when
trying to run `script/gen_requirements_all.py`. Instead it needs to be
run as a module.
2019-04-24 21:30:46 -07:00
cgtobi
b8b3f4e88f Fix pytest durations parameter (#22658)
* Fix durations parameter

* Update config.yml
2019-04-02 09:31:29 -07:00
Jason Hu
de4d1f2c19
Config CircleCI workflow (#22590)
* Add mypyrc to control typing check, add mypy to circle

* Add translation upload circlci job
2019-04-01 07:12:59 -07:00
Jason Hu
38a93afa66
Make pytest in tox quite (#21727) 2019-03-06 22:27:46 -08:00
Pascal Vizeli
c60627c699
GitHub Workflow (#21643)
* Fix tox.ini

* Update main.workflow

* Update tox.ini

* Update main.workflow

* Update main.workflow

* Update tox.ini

* Try only with one

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow
2019-03-04 12:36:50 +01:00
Ville Skyttä
d45f25ce2c Add more type hints to helpers (#20811)
* Add type hints to helpers.aiohttp_client

* Add type hints to helpers.area_registry
2019-02-07 13:34:14 -08:00
Ville Skyttä
58bb6f2e99 Add type hints to helpers.condition (#20266) 2019-01-21 00:03:12 +01:00
Ville Skyttä
9411fca955 Add more type hints to helpers (#18350)
* Add type hints to helpers.entityfilter

* Add type hints to helpers.deprecation
2018-11-11 17:39:50 +01:00
Ville Skyttä
922f34f72d Add more type hints to helpers (#18196)
* Test typing for helpers.__init__ and temperature

* Add type hints to helpers.sun

* Add type hints to helpers.signal

* Add type hints to helpers.entity_values

* Add type hints to helpers.dispatcher
2018-11-04 22:46:42 +01:00
Ville Skyttä
c9c707e368
Start type annotating/testing helpers (#17858)
* Add type hints to helpers.intent and location

* Test typing for helpers.icon, json, and typing

* Add type hints to helpers.state

* Add type hints to helpers.translation
2018-10-28 21:12:52 +02:00
Paulus Schoutsen
5a22e7d211
Fail if dirty (#16839)
* Fail if dirty

* Update check_dirty

* Update text

* Fix comment

* Add -e

* Update dirty script
2018-09-25 20:47:51 +02:00
Ville Skyttä
d4b7057a3d Use posargs in tox lint env (#16646)
Allows linting specified files or dirs only.
2018-09-19 15:48:04 +02:00
Ville Skyttä
649f17fe47 Add type hints to homeassistant.auth (#15853)
* Always load users in auth store before use

* Use namedtuple instead of dict for user meta

* Ignore auth store tokens with invalid created_at

* Add type hints to homeassistant.auth
2018-08-16 22:25:41 +02:00
Jason Hu
8ef2cfa364 Try to fix coveralls unstable result (#15800)
* Create one tox env for code coverage report

pytest-cov generated report in project root folder, not tox env folder.

* Add cov tox env to travis

* Coveralls seems expecting all build jobs upload

* Only upload coverage after cov env success
2018-08-06 10:51:37 +02:00
Andrey
e60f9ca392
More typing (#15449)
## Description:

More typing improvements.

Switch to using `mypy.ini` for flexibility

Add `warn_return_any` check except in `homeassistant.util.yaml` that does typing hacks. Fix some type annotations as resulting from this check and ignore others were fixing is hard.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-13 20:14:45 +03:00
Andrey
c2fe0d0120
Make typing checks more strict (#14429)
## Description:

Make typing checks more strict: add `--strict-optional` flag that forbids implicit None return type. This flag will become default in the next version of mypy (0.600)

Add `homeassistant/util/` to checked dirs.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-13 13:24:51 +03:00
Andrey
23f1b49e55 Add python 3.8-dev to travis and tox (#15347)
* Add Python 3.8-dev tox tests.

* Allow failures on 3.8-dev

* Allow failures on 3.8-dev take2

* Only run on pushes to dev
2018-07-13 11:37:03 +02:00
Andrey
02238b6412 Add python 3.7 to travis and tox (#14523)
* Add python 3.7 to travis and tox

* Use pyyaml from github

* Don't version constraints

* Fix version tag

* Change to new pyyaml release

* Python 3.7 requires xenial

* Fix namespace detection

* Use correct RegEx type

* Update pexpect to 4.6

* Use correct validation for dictionaries

* Disable Py37 incompatible packages

* Upgrade all pexpect to 4.6

* Add explicit None as default param
2018-07-07 10:48:02 -04:00
Ville Skyttä
4d93a9fd38 Pass tox posargs to pylint (#15226) 2018-07-02 12:47:20 +03:00
Ville Skyttä
4d63baf705 Invoke pytest instead of py.test per upstream recommendation, #dropthedot (#14434)
http://blog.pytest.org/2016/whats-new-in-pytest-30/
https://twitter.com/hashtag/dropthedot
2018-05-13 12:11:55 +02:00
Andrey
7aec098a05 Bring back typing check. Meanwhile just for homeassistant/*.py (#14410)
* Bring back typing check. Meanwhile just for homeassistant/.py

* Change follow-imports to silent. Add a few more checks.
2018-05-12 17:44:53 -04:00
Martin Hjelmare
304137e7ff Fix name of tox pylint env (#14402) 2018-05-12 10:07:10 +02:00
cdce8p
da832dbda2 Removed py34 (#12648) 2018-02-25 08:05:20 +01:00
Ben
bf3329e9a9 update mypy commandline arguments (#11638) 2018-01-15 22:41:49 +01:00
Paulus Schoutsen
6e63a4ed8a
Fix broken tests (#11395)
* Do not leave remember the milk config file behind

* Fix exception in service causing service timeout

* Change max service timeout to 9 to catch services timing out

* Fix Google Sync service test

* Update and pin test requirements
2018-01-01 14:30:09 -08:00
Ben Randall
81f1a65fae Add workaround for running tox on Windows platforms (#11188)
* Add workaround for running tox on Windows platforms

* Remove install_command override
2017-12-20 11:50:31 +01:00
Paulus Schoutsen
3f5c748560
Reorganize lint travis builds (#10670)
* tox cleanup

* 1 tox step

* Revert pytest sugar changes

* Tox: make pylint its own task

* Bump Travis to 30 minutes timeout
2017-11-19 17:39:24 -08:00
Paulus Schoutsen
e49b970665 Block dependencies that depend on enum34 (#8698)
* Block dependencies that depend on enum34

* Remove uninstalling enum34

* Update validation script

* Add constraints to tox.ini

* Upgrade yeelight to version that uses enum-compat

* Disable sensor.skybeacon

* Lint
2017-08-04 23:06:10 -07:00
Paulus Schoutsen
e1d1385358 Fix travis 2017-05-07 16:55:22 -07:00
Paulus Schoutsen
bafc04ca42 Update tox.ini 2017-05-07 16:53:28 -07:00
Paulus Schoutsen
5717c87097 Update tox.ini 2017-05-07 16:51:46 -07:00
Paulus Schoutsen
aa6339818e Test only dependencies (#7472)
* Generate requirements file for tests

* Update tox

* Update validate

* Lint

* Tweak order in travis.yml to run longest job first
2017-05-06 22:37:31 -07:00
Johan Bloemberg
7be3414785 Only set LANG=C.UTF8 during install. (#5648) 2017-01-31 19:30:53 -08:00
Paulus Schoutsen
9eed03108f Run tests on Python 3.6 (#5162)
* Run tests on Python 3.6

* Fix dsmr test

* Fix async util tests

* Fix rest sensor test
2017-01-03 21:33:48 +01:00
Michaël Arnauts
c864ea60c9 Improve development workflow in docker (#5079)
* Allow bower install of frontend components as root. Needed for frontend development in docker since everything runs as root in the docker image.

* Improve development workflow in docker

* Use LANG=C.UTF-8 in tox. Fixes installation of libraries with UTF-8 in it's readme.

* Install mysqlclient psycopg2 uvloop after requirements_all.txt again, but with a --no-cache-dir this time. Allows bootstrap_frontend to be executed in a different path like the other scripts.
2017-01-02 22:04:09 +01:00
Paulus Schoutsen
914a868fbd Add websocket API (#4582)
* Add websocket API

* Add identifiers to interactions

* Allow unsubscribing event listeners

* Add support for fetching data

* Clean up handling code websockets api

* Lint

* Add Home Assistant version to auth messages

* Py.test be less verbose in tox
2016-11-26 18:23:28 -08:00
Paulus Schoutsen
87fe83dcb9 Fix slow tests (#3444)
* Fix RFXtrx tests

* Report slow tests on CI

* Minor rfxtrx clean up

* rfxtrx test tweak
2016-09-18 21:40:37 -07:00
Paulus Schoutsen
c21a956895 Speed up MyPy test (#2584) 2016-07-21 23:54:25 -07:00
Fabian Heredia Montiel
08226a4864 Type Hints - __main__ (#2574)
* Add __main__ type hints

* Fix most errors of __main__

* Add ignore for script.run()

* Add type annotations for from_config_dict and from_config_file

* Fix errors

* Fix requirement error

* Add mypy type check to tests

* Enable travis typing check

* Messed up the tox deps

* Laxer type checker
2016-07-20 22:38:52 -07:00
Paulus Schoutsen
14a9b9fe3f Add pep257 checking 2016-03-09 23:34:28 -08:00
Flyte
a3e8994fcc Execute all lint tests even if flake8 reports errors. 2016-02-15 10:00:46 +00:00
Sean Dague
97c0f5bb5a convert testing infrastructure to tox
This converts the testing infrastructure to tox for both locally
testing and travis. This is nearly equivalent to the previous testing
with the only exception that linting fails with the first tool to fail
and won't process all of them.

Slightly tricky thing is that tox resets *all* of the environment for
it's subprocess runs by default. A couple of the dependencies we have
will not install in non UTF8 locales: temper-python & XBee.
2016-02-14 13:04:42 -05:00