Skip to content

Commit 717d420

Browse files
authored
Migrate to uv as environment (#1)
* Remove obsolete files * Fix test path * Refactor github workflow * Versions < 3.10 are not supported by pymodbus
1 parent 3ba7daa commit 717d420

File tree

8 files changed

+295
-134
lines changed

8 files changed

+295
-134
lines changed

.devcontainer.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.13",
7+
"postCreateCommand": "curl -LsSf https://astral.sh/uv/install.sh | sh && uv sync",
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
11+
// "forwardPorts": [],
12+
// Configure tool-specific properties.
13+
"customizations": {
14+
"vscode": {
15+
"extensions": [
16+
"ms-python.python",
17+
"github.vscode-pull-request-github",
18+
"ryanluker.vscode-coverage-gutters",
19+
"ms-python.vscode-pylance",
20+
"charliermarsh.ruff"
21+
],
22+
"settings": {
23+
"files.eol": "\n",
24+
"editor.tabSize": 4,
25+
"editor.formatOnPaste": true,
26+
"editor.formatOnSave": true,
27+
"editor.formatOnType": false,
28+
"files.trimTrailingWhitespace": true,
29+
"python.analysis.typeCheckingMode": "basic",
30+
"python.analysis.autoImportCompletions": true,
31+
"python.defaultInterpreterPath": "/usr/local/bin/python",
32+
"[python]": {
33+
"editor.defaultFormatter": "charliermarsh.ruff"
34+
}
35+
}
36+
}
37+
},
38+
"remoteUser": "vscode",
39+
"features": {},
40+
"remoteEnv": {
41+
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin"
42+
}
43+
}

.github/workflows/test-python-package.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v3
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: Install dependencies
24-
run: pip install tox
24+
run: uv sync --locked --all-extras --dev
2525
- name: Run tests
26-
run: tox
26+
run: |
27+
uv run pytest \
28+
-qq \
29+
--durations=10 \
30+
-o console_output_style=count \
31+
-p no:sugar \
32+
test

pyproject.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[project]
2+
name = "python-stiebel-eltron"
3+
dynamic = ["version"]
4+
description = "Python API for interacting with the Stiebel Eltron ISG web gateway via Modbus for controlling integral ventilation units and heat pumps."
5+
readme = "README.md"
6+
authors = [
7+
{ name = "Manuel Stahl"},
8+
{ name = "'Martin Fuchs"}
9+
]
10+
license = { file = "LICENSE" }
11+
classifiers = [
12+
"Programming Language :: Python :: 3.10",
13+
"Programming Language :: Python :: 3.11",
14+
"Programming Language :: Python :: 3.12",
15+
"Programming Language :: Python :: 3.13",
16+
]
17+
requires-python = ">=3.10,<3.14"
18+
dependencies = [
19+
"pymodbus>=3.8.3",
20+
]
21+
22+
[build-system]
23+
requires = ["hatchling"]
24+
build-backend = "hatchling.build"
25+
26+
[dependency-groups]
27+
dev = [
28+
"pytest>=8.3.5",
29+
"pytest-asyncio>=0.26.0",
30+
"pytest-mock>=3.14.0",
31+
"ruff>=0.9.6",
32+
]
33+
34+
[tool.hatch.build.targets.sdist]
35+
packages = ["pystiebeleltron"]
36+
37+
[tool.hatch.build.targets.wheel]
38+
packages = ["pystiebeleltron"]
39+
40+
[tool.hatch.version]
41+
path = "pystiebeleltron/__init__.py"
42+
43+
[tool.ruff]
44+
line-length = 200
45+
46+
[tool.pytest.ini_options]
47+
48+
pythonpath = [
49+
".", "src"
50+
]
51+
testpaths = [
52+
"test"
53+
]

pystiebeleltron/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.1.1"

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.py

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

tox.ini

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

0 commit comments

Comments
 (0)