Skip to content

Commit

Permalink
Merge branch 'XKNX:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bacherd authored Oct 20, 2023
2 parents 18c591e + 7da615b commit a7be5f3
Show file tree
Hide file tree
Showing 30 changed files with 1,230 additions and 294 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -36,6 +36,8 @@ jobs:
branch: update/pre-commit-hooks
title: Update pre-commit hooks
commit-message: "update pre-commit hooks"
labels: |
dependencies
body: |
Update versions of pre-commit hooks to latest version.
Run tests locally to check for conflicts since PRs from GitHub Actions don't trigger workflows.
2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
repos:
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude_types: [csv, json]
- repo: https://github.com/asottile/pyupgrade
rev: v3.9.0
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black
args:
- --safe
- --quiet
files: ^((xknxproject|test)/.+)?[^/]+\.py$
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
files: ^(xknxproject|examples|docs)/.+\.py$
Expand All @@ -33,19 +33,19 @@ repos:
- --resolve-all-configs
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.0.278'
rev: 'v0.0.292'
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
- id: trailing-whitespace
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.5.1
rev: v0.6.0
hooks:
# Run `pre-commit run --hook-stage manual python-typing-update --all-files` manually
# from time to time to update python typing syntax.
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools~=62.3"]
requires = ["setuptools>=62.3"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -14,8 +14,8 @@ classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
"cryptography>=40.0.0",
"pyzipper>=0.3.6",
"striprtf>=0.0.26",
]
description = "A library to gather information from ETS project files used for KNX"
dynamic = ["version"]
Expand All @@ -35,7 +35,7 @@ version = {attr = "xknxproject.__version__.__version__"}
include = ["xknxproject*"]

[tool.black]
target-version = ["py39", "py310", "py311"]
target-version = ["py39", "py310", "py311", "py312"]
exclude = "generated"


Expand Down
2 changes: 1 addition & 1 deletion requirements_production.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cryptography==41.0.2
pyzipper==0.3.6
striprtf==0.0.26
18 changes: 9 additions & 9 deletions requirements_testing.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-r requirements_production.txt
pre-commit==3.3.3
pre-commit==3.5.0
isort==5.12.0
flake8==6.0.0
pylint==2.17.4
pytest==7.4.0
flake8==6.1.0
pylint==3.0.1
pytest==7.4.2
pytest-cov==4.1.0
pytest-icdiff==0.6
ruff==0.0.280
setuptools==68.0.0
tox==4.6.4
mypy==1.4.1
pytest-icdiff==0.8
ruff==0.1.0
setuptools==68.2.2
tox==4.11.3
mypy==1.6.0
3 changes: 3 additions & 0 deletions script/refresh_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
("module-definition-test", "test", "de-DE"),
("xknx_test_project", "test", None),
("test_project-ets4", "test", "de-DE"),
("testprojekt-ets6-functions", None, "de-DE"),
("ets6_free", None, "de-DE"),
("ets6_two_level", None, "de-DE"),
]

for file_name, password, language in file_names:
Expand Down
Binary file added test/resources/ets6_free.knxproj
Binary file not shown.
Binary file added test/resources/ets6_two_level.knxproj
Binary file not shown.
Binary file modified test/resources/module-definition-test.knxproj
Binary file not shown.
175 changes: 175 additions & 0 deletions test/resources/stubs/ets6_free.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"info": {
"project_id": "P-0310",
"name": "ets6_free",
"last_modified": "2023-09-11T19:49:52.8053929Z",
"group_address_style": "Free",
"guid": "4eb10284-c66c-42a0-9622-48adb78753a3",
"created_by": "ETS6",
"schema_version": "22",
"tool_version": "6.1.5686.0",
"xknxproject_version": "3.3.0",
"language_code": "de-DE"
},
"communication_objects": {},
"topology": {
"0": {
"name": "",
"description": null,
"lines": {
"0": {
"name": "",
"description": null,
"devices": [],
"medium_type": "Twisted Pair (TP)"
}
}
},
"1": {
"name": "",
"description": null,
"lines": {
"0": {
"name": "",
"description": null,
"devices": [],
"medium_type": "Twisted Pair (TP)"
},
"1": {
"name": "",
"description": null,
"devices": [],
"medium_type": "Twisted Pair (TP)"
}
}
}
},
"devices": {},
"group_addresses": {
"3": {
"name": "whatever",
"identifier": "GA-3",
"raw_address": 3,
"address": "3",
"project_uid": 16,
"dpt": null,
"data_secure": false,
"communication_object_ids": [],
"description": "",
"comment": ""
},
"2": {
"name": "bar",
"identifier": "GA-2",
"raw_address": 2,
"address": "2",
"project_uid": 14,
"dpt": null,
"data_secure": false,
"communication_object_ids": [],
"description": "",
"comment": ""
},
"1": {
"name": "foo",
"identifier": "GA-1",
"raw_address": 1,
"address": "1",
"project_uid": 12,
"dpt": null,
"data_secure": false,
"communication_object_ids": [],
"description": "",
"comment": ""
},
"1025": {
"name": "one_more",
"identifier": "GA-4",
"raw_address": 1025,
"address": "1025",
"project_uid": 21,
"dpt": null,
"data_secure": false,
"communication_object_ids": [],
"description": "",
"comment": ""
}
},
"group_ranges": {
"1...512": {
"name": "Group 1",
"address_start": 1,
"address_end": 512,
"group_addresses": [
"1"
],
"comment": "",
"group_ranges": {
"2...128": {
"name": "Group 1.1",
"address_start": 2,
"address_end": 128,
"group_addresses": [
"2"
],
"comment": "",
"group_ranges": {
"3...33": {
"name": "Group 1.1.1",
"address_start": 3,
"address_end": 33,
"group_addresses": [
"3"
],
"comment": "",
"group_ranges": {}
}
}
}
}
},
"513...1024": {
"name": "Empy Main",
"address_start": 513,
"address_end": 1024,
"group_addresses": [],
"comment": "",
"group_ranges": {}
},
"1025...1536": {
"name": "Only Sub",
"address_start": 1025,
"address_end": 1536,
"group_addresses": [],
"comment": "",
"group_ranges": {
"1025...1151": {
"name": "Sub",
"address_start": 1025,
"address_end": 1151,
"group_addresses": [
"1025"
],
"comment": "",
"group_ranges": {}
}
}
}
},
"locations": {
"et6_free": {
"type": "Building",
"identifier": "P-0310-0_BP-1",
"name": "et6_free",
"usage_id": null,
"usage_text": "",
"number": "",
"description": "",
"project_uid": 9,
"devices": [],
"spaces": {},
"functions": []
}
},
"functions": {}
}
Loading

0 comments on commit a7be5f3

Please sign in to comment.