Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a few CI/CD suggestions #120

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: no-commit-to-branch
name: "Don't commit to master branch"
args: [--branch, master]
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
exclude: custom_components/econnect_metronet/manifest.json
- id: mixed-line-ending
- id: trailing-whitespace


- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
Expand Down Expand Up @@ -52,11 +57,24 @@ repos:
hooks:
- id: ruff
exclude: tests/
args: [--line-length=120]
args: [--line-length=120, --fix]
erwindouna marked this conversation as resolved.
Show resolved Hide resolved

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
exclude: tests/
additional_dependencies: [types-requests]

- repo: local
hooks:
- id: pytest
name: pytest
entry: pytest --cov=. --cov-report term-missing
language: system
types: [python]
Comment on lines +70 to +75
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this hook fails currently. I added some config to pyproject.toml, but still no "passed" hook. here is the output of pytest when run from the hook:

============================ no tests ran in 0.34s =============================
============================= test session starts ==============================
platform darwin -- Python 3.12.4, pytest-8.3.4, pluggy-1.5.0
rootdir: /Volumes/Daten/Projects/PyTado
configfile: pyproject.toml
plugins: cov-6.0.0
collected 6 items                                                              

tests/test_tado_interface.py ...                                         [ 50%]
tests/test_hops_zone.py ...                                              [100%]

---------- coverage: platform darwin, python 3.12.4-final-0 ----------
Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
PyTado/__init__.py                      0      0   100%
PyTado/__main__.py                     44     34    23%   13-14, 18-20, 24-26, 30-32, 36-38, 43-92
PyTado/const.py                        53      0   100%
PyTado/exceptions.py                    5      0   100%
PyTado/http.py                        174     27    84%   96-106, 111-113, 118, 188-203, 206, 216, 218, 222-224, 236-241
PyTado/interface/__init__.py            2      0   100%
PyTado/interface/api/__init__.py        3      0   100%
PyTado/interface/api/hops_tado.py     107     72    33%   35, 38, 53-70, 77-80, 94-97, 104-108, 115, 122-123, 136, 144-147, 191-197, 204-208, 229-249, 256, 265-270, 278, 285, 293-303, 310-315
PyTado/interface/api/my_tado.py       258    192    26%   50, 76-78, 85-88, 95, 102-105, 112-119, 142-159, 166-169, 176-179, 186-187, 197-205, 212-219, 229-235, 242-249, 256-262, 269-272, 279-282, 289-292, 299-302, 309-314, 335-365, 372-375, 382, 389, 396-401, 409-416, 423, 430-435, 443-448, 455-460, 468-474, 481-488, 495-500, 507-512, 519-525, 541-563, 570-573, 580-583, 590-595, 602-608
PyTado/interface/interface.py         129     38    71%   17-23, 68, 73, 78, 83, 88, 93, 98, 103, 108, 113, 118, 123, 131, 137, 142, 147, 152, 157, 162, 167, 186, 204, 209, 214, 219, 224, 229, 234, 239, 244, 251, 256, 261, 266, 274, 290
PyTado/logger.py                       22      2    91%   30-31
PyTado/zone/__init__.py                 3      0   100%
PyTado/zone/hops_zone.py               62      8    87%   49, 58-59, 63, 96, 119, 125-128
PyTado/zone/my_zone.py                119     74    38%   78-215
-----------------------------------------------------------------
TOTAL                                 981    447    54%


============================== 6 passed in 1.67s ===============================
============================= test session starts ==============================
platform darwin -- Python 3.12.4, pytest-8.3.4, pluggy-1.5.0
rootdir: /Volumes/Daten/Projects/PyTado
configfile: pyproject.toml
plugins: cov-6.0.0
collected 20 items                                                             

tests/test_my_zone.py ....................                               [100%]

---------- coverage: platform darwin, python 3.12.4-final-0 ----------
Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
PyTado/__init__.py                      0      0   100%
PyTado/__main__.py                     44     34    23%   13-14, 18-20, 24-26, 30-32, 36-38, 43-92
PyTado/const.py                        53      0   100%
PyTado/exceptions.py                    5      0   100%
PyTado/http.py                        174     27    84%   96-106, 111-113, 118, 188-203, 206, 216, 218, 222-224, 236-241
PyTado/interface/__init__.py            2      0   100%
PyTado/interface/api/__init__.py        3      0   100%
PyTado/interface/api/hops_tado.py     107     72    33%   35, 38, 53-70, 77-80, 94-97, 104-108, 115, 122-123, 136, 144-147, 191-197, 204-208, 229-249, 256, 265-270, 278, 285, 293-303, 310-315
PyTado/interface/api/my_tado.py       258    169    34%   50, 76-78, 85-88, 102-105, 112-119, 157, 166-169, 176-179, 186-187, 197-205, 212-219, 229-235, 242-249, 256-262, 269-272, 279-282, 289-292, 299-302, 309-314, 335-365, 372-375, 382, 389, 396-401, 423, 430-435, 443-448, 455-460, 468-474, 481-488, 495-500, 507-512, 519-525, 541-563, 570-573, 580-583, 590-595
PyTado/interface/interface.py         129     38    71%   17-23, 68, 73, 78, 83, 88, 93, 98, 103, 108, 113, 118, 123, 131, 137, 142, 147, 152, 157, 162, 167, 186, 204, 209, 214, 219, 224, 229, 234, 239, 244, 251, 256, 261, 266, 274, 290
PyTado/logger.py                       22      2    91%   30-31
PyTado/zone/__init__.py                 3      0   100%
PyTado/zone/hops_zone.py               62      8    87%   49, 58-59, 63, 96, 119, 125-128
PyTado/zone/my_zone.py                119      4    97%   102, 131, 134, 159
-----------------------------------------------------------------
TOTAL                                 981    354    64%


============================== 20 passed in 4.78s ==============================
============================= test session starts ==============================
platform darwin -- Python 3.12.4, pytest-8.3.4, pluggy-1.5.0
rootdir: /Volumes/Daten/Projects/PyTado
configfile: pyproject.toml
plugins: cov-6.0.0
collected 5 items                                                              

tests/test_http.py .....                                                 [100%]

---------- coverage: platform darwin, python 3.12.4-final-0 ----------
Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
PyTado/__init__.py                      0      0   100%
PyTado/__main__.py                     44     34    23%   13-14, 18-20, 24-26, 30-32, 36-38, 43-92
PyTado/const.py                        53      0   100%
PyTado/exceptions.py                    5      0   100%
PyTado/http.py                        174     27    84%   96-106, 111-113, 118, 188-203, 206, 216, 218, 222-224, 236-241
PyTado/interface/__init__.py            2      0   100%
PyTado/interface/api/__init__.py        3      0   100%
PyTado/interface/api/hops_tado.py     107     72    33%   35, 38, 53-70, 77-80, 94-97, 104-108, 115, 122-123, 136, 144-147, 191-197, 204-208, 229-249, 256, 265-270, 278, 285, 293-303, 310-315
PyTado/interface/api/my_tado.py       258    192    26%   50, 76-78, 85-88, 95, 102-105, 112-119, 142-159, 166-169, 176-179, 186-187, 197-205, 212-219, 229-235, 242-249, 256-262, 269-272, 279-282, 289-292, 299-302, 309-314, 335-365, 372-375, 382, 389, 396-401, 409-416, 423, 430-435, 443-448, 455-460, 468-474, 481-488, 495-500, 507-512, 519-525, 541-563, 570-573, 580-583, 590-595, 602-608
PyTado/interface/interface.py         129     38    71%   17-23, 68, 73, 78, 83, 88, 93, 98, 103, 108, 113, 118, 123, 131, 137, 142, 147, 152, 157, 162, 167, 186, 204, 209, 214, 219, 224, 229, 234, 239, 244, 251, 256, 261, 266, 274, 290
PyTado/logger.py                       22      2    91%   30-31
PyTado/zone/__init__.py                 3      0   100%
PyTado/zone/hops_zone.py               62      8    87%   49, 58-59, 63, 96, 119, 125-128
PyTado/zone/my_zone.py                119     74    38%   78-215
-----------------------------------------------------------------
TOTAL                                 981    447    54%


============================== 5 passed in 1.68s ===============================
============================= test session starts ==============================
platform darwin -- Python 3.12.4, pytest-8.3.4, pluggy-1.5.0
rootdir: /Volumes/Daten/Projects/PyTado
configfile: pyproject.toml
plugins: cov-6.0.0
collected 4 items                                                              

tests/test_my_tado.py ....                                               [100%]

---------- coverage: platform darwin, python 3.12.4-final-0 ----------
Name                                Stmts   Miss  Cover   Missing
-----------------------------------------------------------------
PyTado/__init__.py                      0      0   100%
PyTado/__main__.py                     44     34    23%   13-14, 18-20, 24-26, 30-32, 36-38, 43-92
PyTado/const.py                        53      0   100%
PyTado/exceptions.py                    5      0   100%
PyTado/http.py                        174     27    84%   96-106, 111-113, 118, 188-203, 206, 216, 218, 222-224, 236-241
PyTado/interface/__init__.py            2      0   100%
PyTado/interface/api/__init__.py        3      0   100%
PyTado/interface/api/hops_tado.py     107     72    33%   35, 38, 53-70, 77-80, 94-97, 104-108, 115, 122-123, 136, 144-147, 191-197, 204-208, 229-249, 256, 265-270, 278, 285, 293-303, 310-315
PyTado/interface/api/my_tado.py       258    170    34%   50, 76-78, 85-88, 95, 102-105, 112-119, 157, 166-169, 176-179, 186-187, 197-205, 212-219, 229-235, 242-249, 256-262, 269-272, 279-282, 289-292, 299-302, 309-314, 335-365, 372-375, 382, 389, 396-401, 423, 430-435, 443-448, 455-460, 468-474, 481-488, 495-500, 507-512, 519-525, 541-563, 570-573, 580-583, 590-595
PyTado/interface/interface.py         129     38    71%   17-23, 68, 73, 78, 83, 88, 93, 98, 103, 108, 113, 118, 123, 131, 137, 142, 147, 152, 157, 162, 167, 186, 204, 209, 214, 219, 224, 229, 234, 239, 244, 251, 256, 261, 266, 274, 290
PyTado/logger.py                       22      2    91%   30-31
PyTado/zone/__init__.py                 3      0   100%
PyTado/zone/hops_zone.py               62      8    87%   49, 58-59, 63, 96, 119, 125-128
PyTado/zone/my_zone.py                119     74    38%   78-215
-----------------------------------------------------------------
TOTAL                                 981    425    57%


============================== 4 passed in 2.14s ===============================

- id: prettier
name: prettier
entry: prettier
language: system
types: [python, json, yaml, markdown]
Loading