-
-
Notifications
You must be signed in to change notification settings - Fork 567
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add azure pipeline for tests, and enforce black, flake8 and isort for…
… commits (#566) * use azure pipeline instead of travis [skip ci] * add flake8, isort to precommit hooks, format files * remove unnecessary .hound.yml, adjust line lengths and disable mypy temporarily * try 88 instead of 100 for max line length. * miio.discover has to be defined separately to have access to all devices * adjust manifest, add pytest-cov * second try for cov report
- Loading branch information
Showing
56 changed files
with
283 additions
and
182 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
trigger: | ||
- master | ||
pr: | ||
- master | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
strategy: | ||
matrix: | ||
Python36: | ||
python.version: '3.6' | ||
Python37: | ||
python.version: '3.7' | ||
# Python38: | ||
# python.version: '3.8' | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '$(python.version)' | ||
displayName: 'Use Python $(python.version)' | ||
|
||
- script: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pytest pytest-azurepipelines pytest-cov | ||
displayName: 'Install dependencies' | ||
|
||
- script: | | ||
pre-commit run black --all-files | ||
displayName: 'Code formating (black)' | ||
|
||
- script: | | ||
pre-commit run flake8 --all-files | ||
displayName: 'Code formating (flake8)' | ||
|
||
#- script: | | ||
# pre-commit run mypy --all-files | ||
# displayName: 'Typing checks (mypy)' | ||
|
||
- script: | | ||
pre-commit run isort --all-files | ||
displayName: 'Order of imports (isort)' | ||
|
||
- script: | | ||
pytest --cov miio --cov-report html | ||
displayName: 'Tests' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
# flake8: noqa | ||
from miio.airconditioningcompanion import AirConditioningCompanion | ||
from miio.airconditioningcompanion import AirConditioningCompanionV3 | ||
from miio.airconditioningcompanion import ( | ||
AirConditioningCompanion, | ||
AirConditioningCompanionV3, | ||
) | ||
from miio.airdehumidifier import AirDehumidifier | ||
from miio.airfresh import AirFresh | ||
from miio.airhumidifier import AirHumidifier | ||
from miio.airdehumidifier import AirDehumidifier | ||
from miio.airpurifier import AirPurifier | ||
from miio.airqualitymonitor import AirQualityMonitor | ||
from miio.aqaracamera import AqaraCamera | ||
from miio.ceil import Ceil | ||
from miio.chuangmi_camera import ChuangmiCamera | ||
from miio.chuangmi_ir import ChuangmiIr | ||
from miio.chuangmi_plug import Plug, PlugV1, PlugV3, ChuangmiPlug | ||
from miio.chuangmi_plug import ChuangmiPlug, Plug, PlugV1, PlugV3 | ||
from miio.cooker import Cooker | ||
from miio.device import Device, DeviceException, DeviceError | ||
from miio.fan import Fan, FanV2, FanSA1, FanZA1, FanZA4, FanP5 | ||
from miio.device import Device, DeviceError, DeviceException | ||
from miio.fan import Fan, FanP5, FanSA1, FanV2, FanZA1, FanZA4 | ||
from miio.philips_bulb import PhilipsBulb | ||
from miio.philips_eyecare import PhilipsEyecare | ||
from miio.philips_moonlight import PhilipsMoonlight | ||
from miio.powerstrip import PowerStrip | ||
from miio.protocol import Message, Utils | ||
from miio.toiletlid import Toiletlid | ||
from miio.pwzn_relay import PwznRelay | ||
from miio.toiletlid import Toiletlid | ||
from miio.vacuum import Vacuum, VacuumException | ||
from miio.vacuumcontainers import ( | ||
VacuumStatus, | ||
ConsumableStatus, | ||
DNDStatus, | ||
CleaningDetails, | ||
CleaningSummary, | ||
ConsumableStatus, | ||
DNDStatus, | ||
Timer, | ||
VacuumStatus, | ||
) | ||
from miio.waterpurifier import WaterPurifier | ||
from miio.wifirepeater import WifiRepeater | ||
from miio.wifispeaker import WifiSpeaker | ||
from miio.yeelight import Yeelight | ||
from miio.aqaracamera import AqaraCamera | ||
|
||
from miio.discovery import Discovery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.