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

63 Commits

Author SHA1 Message Date
Ruslan Sayfutdinov
575a460c65
Fix local mypy workflow (#48433)
* Fix local mypy workflow

* Run mypy directly
2021-03-30 17:18:29 +02:00
Ville Skyttä
b38af0821b
Fix version of pip in tox (#46656) 2021-02-16 12:26:41 -10:00
Ville Skyttä
43474762b2
Drop remaining Python < 3.8 support (#44743)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-01-04 11:47:29 +01:00
Martin Hjelmare
f454b4154b
Fix and clean tox.ini (#40789) 2020-09-30 17:07:59 +02:00
Ville Skyttä
27f3c0a302
Skip install on tox pylint (#39260)
We're not operating on the installed package anyway, and necessary
dependencies are handled with tox deps.

As a nice bonus side effect, doing this sidesteps breakage caused by
pip's (up to 20.2.2 at least) behavior of prepending site-packages to
sys.path in certain cases, which in turn results in failures e.g. if a
version of typing that is incompatible with the (now overridden)
stdlib is installed there. And that combined with also pip's behavior
of installing a default build system consisting of setuptools and
wheel under the hood when it sees our pyproject.toml without a
build-system defined would provoke the breakage before we have a
chance to uninstall typing. (There are ways around this too, but
skipping the install makes the issue moot at least with our current
dependency set.)
2020-08-27 16:57:58 +02:00
Paulus Schoutsen
34c2579507
Constraints pt3 (#37803) 2020-07-13 15:55:20 +02:00
Ville Skyttä
3d08601796
Use package constraints in tox lint (#37500)
Otherwise fails with
pip._vendor.pkg_resources.ContextualVersionConflict: (importlib-metadata
1.7.0 (.../.tox/lint/lib/python3.7/site-packages),
Requirement.parse('importlib-metadata==1.6.0'), {'homeassistant'})
2020-07-05 11:04:00 +02:00
Ville Skyttä
3832c8efd9
Remove pytest-xdist from tox now that it's in requirements_test.txt (#37455) 2020-07-04 10:03:29 +02:00
Ville Skyttä
3259ba6116
Fix hassfest validate invocation in Tox (#34428) 2020-04-19 17:43:49 +02:00
Ville Skyttä
dc5ca461a9
Run mypy through a pyenv/virtualenv enabler wrapper script (#30922) 2020-02-01 07:12:46 -08:00
Christian Clauss
df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Ville Skyttä
d4c80f160c Add bandit, use to catch known vulnerable XML parsing (#28341)
* Add bandit to pre-commit and CI, use to catch known vulnerable XML parsing

* Use defusedxml instead of direct xml.etree to parse XML

* Move config to tests/bandit.yaml
2019-11-18 09:10:15 +01:00
Ville Skyttä
a48d426f18 Travis and tox config improvements (#28667)
* Use travis_wait only with pylint

pylint is the only job that is expected to be silent for extended time.
For others such a silence is a sign of a problem and using travis_wait
just lengthens the wait, and makes things harder to follow and debug,
because it also suppresses output in the web UI.

* Use pytest-xdist in tox

Similarly as in Azure.
2019-11-13 08:50:35 +01:00
Ville Skyttä
7e6bcb85b7 Don't fail tox pylint if PYLINT_ARGS is not set (#28403)
Closes https://github.com/home-assistant/home-assistant/issues/28342
2019-11-04 08:12:15 +01:00
Ville Skyttä
a8dff2f2d0 pre-commit: ship default and full configs (#28463)
For now, the only difference between the two is mypy.
2019-11-02 12:21:09 -07:00
Ville Skyttä
6a731a68cd Parallelize pylint everywhere (#28149)
* Run 2 pylint jobs by default

* Run pylint with autodetected number of jobs in Travis

Gives a ~25% speedup there at the moment.
2019-10-23 13:18:41 -07:00
Ville Skyttä
103ffacea7 Use pre-commit in CI and tox (#27743) 2019-10-18 12:20:26 -07:00
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