mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-28 19:22:04 +00:00
Add precommit hooks & tox env to enforce code structure, add azure pipelines
Instead of leveraging hound & travis, add an option for azure pipelines, which may replace the former in the future. This also streamlines the contributing guidelines by: * Adding pre-commit hooks to run isort, black, flake8, mypy * Adding lint environment to allow checks to be run `tox -e lint` This also contains a major cleanup to the SmartStrip handling which was due. After seeing #184 I thought I should push this in as it is for comments before the codebase diverges too much.
This commit is contained in:
47
azure-pipelines.yml
Normal file
47
azure-pipelines.yml
Normal file
@@ -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 pyHS100 --cov-report html
|
||||
displayName: 'Tests'
|
||||
Reference in New Issue
Block a user