Skip to content

Commit 36bc700

Browse files
authored
Merge pull request #253 from plugwise/cleanup
Pyproject.toml PEP-621 including versioning & cleanup of separate config files
2 parents ab29c0a + 6e2cf76 commit 36bc700

File tree

13 files changed

+102
-101
lines changed

13 files changed

+102
-101
lines changed

.coveragerc

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
name: Latest release
55

66
env:
7-
CACHE_VERSION: 6
8-
DEFAULT_PYTHON: 3.9
7+
CACHE_VERSION: 7
8+
DEFAULT_PYTHON: 3.10
99

1010
# Only run on merges
1111
on:

.github/workflows/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
name: Latest commit
55

66
env:
7-
CACHE_VERSION: 9
8-
DEFAULT_PYTHON: "3.9"
7+
CACHE_VERSION: 2
8+
DEFAULT_PYTHON: "3.10"
99
PRE_COMMIT_HOME: ~/.cache/pre-commit
1010

1111
on:

.pre-commit-config.yaml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ default_language_version:
99
repos:
1010
# Run manually in CI skipping the branch checks
1111
- repo: https://github.com/PyCQA/isort
12-
rev: 5.10.1
12+
rev: 5.11.4
1313
hooks:
1414
- id: isort
1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v4.2.0
16+
rev: v4.4.0
1717
hooks:
1818
- id: check-executables-have-shebangs
1919
stages: [manual]
2020
- id: no-commit-to-branch
2121
args:
2222
- --branch=main
2323
- repo: https://github.com/asottile/pyupgrade
24-
rev: v3.1.0
24+
rev: v3.3.1
2525
hooks:
2626
- id: pyupgrade
2727
args: [--py39-plus]
2828
- repo: https://github.com/psf/black
29-
rev: 22.10.0
29+
rev: 22.12.0
3030
hooks:
3131
- id: black
3232
args:
3333
- --safe
3434
- --quiet
3535
files: ^((plugwise|tests)/.+)?[^/]+\.py$
3636
- repo: https://github.com/codespell-project/codespell
37-
rev: v2.1.0
37+
rev: v2.2.2
3838
hooks:
3939
- id: codespell
4040
args:
@@ -43,18 +43,19 @@ repos:
4343
- --quiet-level=2
4444
exclude_types: [csv, json]
4545
- repo: https://github.com/PyCQA/flake8
46-
rev: 4.0.1
46+
rev: 6.0.0
4747
hooks:
4848
- id: flake8
4949
additional_dependencies:
50-
- pycodestyle==2.8.0
51-
- pyflakes==2.4.0
50+
- pycodestyle==2.10.0
51+
- pyflakes==3.0.1
5252
- flake8-docstrings==1.6.0
5353
- pydocstyle==6.1.1
54-
- flake8-comprehensions==3.10.0
55-
- flake8-noqa==1.2.8
56-
- mccabe==0.6.1
54+
- flake8-comprehensions==3.10.1
55+
- flake8-noqa==1.3.0
56+
- mccabe==0.7.0
5757
files: ^(plugwise|tests)/.+\.py$
58+
args: ["--verbose", "--append-config=setup.cfg"]
5859
- repo: https://github.com/PyCQA/bandit
5960
rev: 1.7.4
6061
hooks:
@@ -69,11 +70,11 @@ repos:
6970
hooks:
7071
- id: yamllint
7172
- repo: https://github.com/pre-commit/mirrors-prettier
72-
rev: v2.7.1
73+
rev: v3.0.0-alpha.4
7374
hooks:
7475
- id: prettier
7576
- repo: https://github.com/cdce8p/python-typing-update
76-
rev: v0.5.0
77+
rev: v0.5.1
7778
hooks:
7879
# Run `python-typing-update` hook manually from time to time
7980
# to update python typing syntax.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ Changelogs below this line are separated in the former python-plugwise USB-only
496496
### 0.2.12 - Fix available schema's
497497

498498
- Thanks to report from @fsaris
499-
- Adept code to allow for change introducted by firmware 4.x
499+
- Adept code to allow for change introduced by firmware 4.x
500500

501501
### 0.2.11 - Add community requested sensors
502502

plugwise/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""Plugwise module."""
22

3-
__version__ = "0.27.0"
4-
53
from plugwise.smile import Smile
64
from plugwise.stick import Stick

pyproject.toml

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
[build-system]
2+
requires = ["setuptools~=62.3", "wheel~=0.37.1"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "plugwise"
7+
version = "0.27.0"
8+
license = {file = "LICENSE"}
9+
description = "Plugwise Smile (Adam/Anna/P1), Stretch and USB (Stick) module for Python 3."
10+
readme = "README.md"
11+
keywords = ["home", "automation", "plugwise", "module"]
12+
classifiers = [
13+
"Development Status :: 5 - Production/Stable",
14+
"Intended Audience :: Developers",
15+
"License :: OSI Approved :: MIT License",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python :: 3.9",
18+
"Programming Language :: Python :: 3.10",
19+
"Topic :: Home Automation",
20+
]
21+
authors = [
22+
{ name = "Plugwise device owners"}
23+
]
24+
maintainers = [
25+
{ name = "bouwew"},
26+
{ name = "brefra"},
27+
{ name = "CoMPaTech" }
28+
]
29+
requires-python = ">=3.9.0"
30+
dependencies = [
31+
"aiohttp",
32+
"async_timeout",
33+
"crcmod",
34+
"defusedxml",
35+
"munch",
36+
"pyserial",
37+
"python-dateutil",
38+
"semver",
39+
]
40+
41+
[project.urls]
42+
"Source Code" = "https://github.com/plugwise/python-plugwise"
43+
"Bug Reports" = "https://github.com/plugwise/python-plugwise/issues"
44+
45+
[tool.setuptools]
46+
platforms = ["any"]
47+
include-package-data = true
48+
49+
[tool.setuptools.packages.find]
50+
include = ["plugwise*"]
51+
152
[tool.black]
253
target-version = ["py39", "py310"]
354
exclude = 'generated'
@@ -121,6 +172,12 @@ overgeneral-exceptions = [
121172
]
122173

123174
[tool.pytest.ini_options]
175+
asyncio_mode = "strict"
176+
markers = [
177+
# mark a test as a asynchronous io test.
178+
"asyncio",
179+
]
180+
124181
testpaths = [
125182
"tests",
126183
]
@@ -130,7 +187,7 @@ norecursedirs = [
130187
]
131188

132189
[tool.mypy]
133-
python_version = 3.9
190+
python_version = 3.10
134191
show_error_codes = true
135192
follow_imports = "silent"
136193
ignore_missing_imports = true
@@ -157,3 +214,17 @@ exclude = [
157214
"messages",
158215
"connections",
159216
]
217+
218+
[tool.coverage.run]
219+
source = [ "plugwise" ]
220+
omit= [
221+
"*/venv/*",
222+
"setup.py",
223+
"plugwise/connections/*",
224+
"plugwise/controller.py",
225+
"plugwise/messages/*",
226+
"plugwise/nodes/*",
227+
"plugwise/parser.py",
228+
"plugwise/stick.py",
229+
"plugwise/util.py",
230+
]

pytest.ini

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ -f "${my_venv}/bin/activate" ]; then
1212
. "${my_venv}/bin/activate"
1313
# Install commit requirements
1414
pip install wheel
15-
pip install --upgrade -r requirements_commit.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
15+
pip install --upgrade -e . -r requirements_commit.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
1616
# Install pre-commit hook
1717
"${my_venv}/bin/pre-commit" install
1818
else

scripts/setup_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [ -f "${my_venv}/bin/activate" ]; then
1111
# shellcheck disable=SC1091
1212
. "${my_venv}/bin/activate"
1313
# Install test requirements
14-
pip install --upgrade -r requirements_test.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
14+
pip install --upgrade -e . -r requirements_test.txt -c https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/package_constraints.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test.txt -r https://raw.githubusercontent.com/home-assistant/core/dev/requirements_test_pre_commit.txt
1515
# Install pre-commit hook
1616
"${my_venv}/bin/pre-commit" install
1717
else

0 commit comments

Comments
 (0)