homeassistant-stubs


Namehomeassistant-stubs JSON
Version 2024.4.4 PyPI version JSON
download
home_pagehttps://github.com/KapJI/homeassistant-stubs
SummaryPEP 484 typing stubs for Home Assistant Core
upload_time2024-04-24 01:35:44
maintainerNone
docs_urlNone
authorRuslan Sayfutdinov
requires_python<3.13,>=3.12
licenseMIT
keywords homeassistant typing pep484
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![CI](https://github.com/KapJI/homeassistant-stubs/actions/workflows/ci.yaml/badge.svg)](https://github.com/KapJI/homeassistant-stubs/actions/workflows/ci.yaml)
[![PyPI version](https://img.shields.io/pypi/v/homeassistant-stubs)](https://pypi.org/project/homeassistant-stubs/)

# PEP 484 stubs for Home Assistant Core

This is unofficial stub-only package generated from [Home Assistant Core](https://github.com/home-assistant/core) sources.
You can use it to enable type checks against Home Assistant code in your custom component or AppDaemon app.

## How to use

Add it to dev dependencies of your project.
I recommend to use [Poetry](https://python-poetry.org/) for managing dependencies:

```shell
poetry add --group dev homeassistant-stubs
```

Please note that only stubs from strictly typed modules are added in this package.
This includes all core modules and some components.
Generic components like `sensor`, `light` or `media_player` are already typed.

If your project imports not yet typed components, `mypy` will be unable to find that module.
The best thing you can do to fix this is to submit PR to HA Core which adds type hints for these components.
After that stubs for these components will become available in this package.

## Motivation

Home Assistant maintainers don't want to distribute typing information with `homeassistant` package
([[1]](https://github.com/home-assistant/core/pull/28866),
[[2]](https://github.com/home-assistant/core/pull/47796)).
The reason is that [PEP 561](https://www.python.org/dev/peps/pep-0561/#packaging-type-information)
says that `py.typed` marker is applied recursively and the whole package must support type checking.
But many of the Home Assistant components are currently not type checked.

## How it works

- `update_stubs.py` script extracts list of strictly typed modules from Home Assistant configs.
- Then it runs `stubgen` which is shipped with `mypy` to generate typing stubs.
- New versions are generated and published automatically every 12 hours.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/KapJI/homeassistant-stubs",
    "name": "homeassistant-stubs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.12",
    "maintainer_email": null,
    "keywords": "homeassistant, typing, pep484",
    "author": "Ruslan Sayfutdinov",
    "author_email": "ruslan@sayfutdinov.com",
    "download_url": "https://files.pythonhosted.org/packages/44/81/e0b427cd40750d199f8a7fe8b5a19bf3ddb74b3eb6fd7783dcfeda383ae6/homeassistant_stubs-2024.4.4.tar.gz",
    "platform": null,
    "description": "[![CI](https://github.com/KapJI/homeassistant-stubs/actions/workflows/ci.yaml/badge.svg)](https://github.com/KapJI/homeassistant-stubs/actions/workflows/ci.yaml)\n[![PyPI version](https://img.shields.io/pypi/v/homeassistant-stubs)](https://pypi.org/project/homeassistant-stubs/)\n\n# PEP 484 stubs for Home Assistant Core\n\nThis is unofficial stub-only package generated from [Home Assistant Core](https://github.com/home-assistant/core) sources.\nYou can use it to enable type checks against Home Assistant code in your custom component or AppDaemon app.\n\n## How to use\n\nAdd it to dev dependencies of your project.\nI recommend to use [Poetry](https://python-poetry.org/) for managing dependencies:\n\n```shell\npoetry add --group dev homeassistant-stubs\n```\n\nPlease note that only stubs from strictly typed modules are added in this package.\nThis includes all core modules and some components.\nGeneric components like `sensor`, `light` or `media_player` are already typed.\n\nIf your project imports not yet typed components, `mypy` will be unable to find that module.\nThe best thing you can do to fix this is to submit PR to HA Core which adds type hints for these components.\nAfter that stubs for these components will become available in this package.\n\n## Motivation\n\nHome Assistant maintainers don't want to distribute typing information with `homeassistant` package\n([[1]](https://github.com/home-assistant/core/pull/28866),\n[[2]](https://github.com/home-assistant/core/pull/47796)).\nThe reason is that [PEP 561](https://www.python.org/dev/peps/pep-0561/#packaging-type-information)\nsays that `py.typed` marker is applied recursively and the whole package must support type checking.\nBut many of the Home Assistant components are currently not type checked.\n\n## How it works\n\n- `update_stubs.py` script extracts list of strictly typed modules from Home Assistant configs.\n- Then it runs `stubgen` which is shipped with `mypy` to generate typing stubs.\n- New versions are generated and published automatically every 12 hours.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "PEP 484 typing stubs for Home Assistant Core",
    "version": "2024.4.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/KapJI/homeassistant-stubs/issues",
        "Homepage": "https://github.com/KapJI/homeassistant-stubs",
        "Release Notes": "https://github.com/KapJI/homeassistant-stubs/releases",
        "Repository": "https://github.com/KapJI/homeassistant-stubs"
    },
    "split_keywords": [
        "homeassistant",
        " typing",
        " pep484"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9b4a0cc6dc314d510771cdb03677f483afa0ce117d8188fb89deb3cb278102c",
                "md5": "f45992d880166aee585d3c54b321287e",
                "sha256": "39fd714debfed9a8ae0d6d801da2a97aefc43aadcb68eb0124bf7c298771801f"
            },
            "downloads": -1,
            "filename": "homeassistant_stubs-2024.4.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f45992d880166aee585d3c54b321287e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.12",
            "size": 2459307,
            "upload_time": "2024-04-24T01:35:39",
            "upload_time_iso_8601": "2024-04-24T01:35:39.957035Z",
            "url": "https://files.pythonhosted.org/packages/d9/b4/a0cc6dc314d510771cdb03677f483afa0ce117d8188fb89deb3cb278102c/homeassistant_stubs-2024.4.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4481e0b427cd40750d199f8a7fe8b5a19bf3ddb74b3eb6fd7783dcfeda383ae6",
                "md5": "cd6548368e54f78beb54ee0bab471051",
                "sha256": "c07934475a953637f213e1c3c954e1d21811a54d626ff80fdf715004e95e3389"
            },
            "downloads": -1,
            "filename": "homeassistant_stubs-2024.4.4.tar.gz",
            "has_sig": false,
            "md5_digest": "cd6548368e54f78beb54ee0bab471051",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.12",
            "size": 957756,
            "upload_time": "2024-04-24T01:35:44",
            "upload_time_iso_8601": "2024-04-24T01:35:44.560473Z",
            "url": "https://files.pythonhosted.org/packages/44/81/e0b427cd40750d199f8a7fe8b5a19bf3ddb74b3eb6fd7783dcfeda383ae6/homeassistant_stubs-2024.4.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-24 01:35:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "KapJI",
    "github_project": "homeassistant-stubs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "homeassistant-stubs"
}
        
Elapsed time: 0.28390s