Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install Python packages
run: pip install -e . -r ./requirements_tests.txt
run: pip install -e ".[tests]"

- name: Black Code Formatter
run: black --check .

- name: Run tests
run: pytest --vcr-record=none
run: pytest
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

18 changes: 18 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ For development is recommended to use a ``venv``.
$ source bin/activate
$ python setup.py develop

Running the tests
-----------------

Install the package with the test dependencies and run ``pytest`` from the
root of the repository.

.. code:: bash

$ pip3 install -e ".[test]"
$ pytest

On Nix or NixOS, ``shell.nix`` provides an environment with all test
dependencies.

.. code:: bash

$ nix-shell --run pytest

License
-------

Expand Down
71 changes: 71 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "connect_box"
version = "0.5.0"
description = "Python client for interacting with Compal CH7465LG devices."
readme = "README.rst"
license = "MIT"
authors = [
{ name = "Fabian Affolter", email = "fabian@affolter-engineering.ch" },
]
requires-python = ">=3.13"
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Utilities",
]
dependencies = [
"aiohttp<4",
"attrs",
"defusedxml",
]

[project.optional-dependencies]
tests = [
"black>=24.3",
"flake8>=3.8.4",
"pylint>=2.16.0",
"pytest>=9",
"pytest-asyncio",
"pytest-vcr",
"syrupy>=6",
]

[project.urls]
Homepage = "https://github.com/home-assistant-ecosystem/python-connect-box"
"Bug Tracker" = "https://github.com/home-assistant-ecosystem/python-connect-box/issues"
Download = "https://github.com/home-assistant-ecosystem/python-connect-box/releases"

[tool.hatch.build.targets.wheel]
packages = ["connect_box"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
addopts = "--vcr-record=none"

[tool.isort]
multi_line_output = 4
include_trailing_comma = true
force_grid_wrap = 0
line_length = 88
indent = " "
force_sort_within_sections = true
sections = ["FUTURE", "STDLIB", "INBETWEENS", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
default_section = "THIRDPARTY"
forced_separate = ["tests"]
combine_as_imports = true
use_parentheses = true

[tool.flake8]
max-line-length = 88
ignore = ["E501", "E203"]
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

7 changes: 0 additions & 7 deletions requirements_tests.txt

This file was deleted.

16 changes: 0 additions & 16 deletions setup.cfg

This file was deleted.

43 changes: 0 additions & 43 deletions setup.py

This file was deleted.

28 changes: 28 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
pkgs ? import <nixpkgs> { },
}:

let
python = pkgs.python313.withPackages (
ps: with ps; [
# runtime
aiohttp
attrs
defusedxml
# tests
black
flake8
pylint
pytest
pytest-asyncio
pytest-vcr
syrupy
]
);
in
pkgs.mkShell {
packages = [ python ];
shellHook = ''
export PYTHONPATH="$PWD:$PYTHONPATH"
'';
}
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ async def device_password(vcr):


@pytest.fixture
@pytest.mark.asyncio
async def client(vcr, device_password):
async with aiohttp.ClientSession() as session:
client = ConnectBox(session, device_password)
Expand Down
Loading