Comments (5)
I have exactly the same issue.
from homeassistant-stubs.
For some reason, a method is being generated with a hyphen in the name (__mypy-replace
), see https://github.com/KapJI/homeassistant-stubs/blob/main/homeassistant-stubs/components/sensor/__init__.pyi#L26
Still seeing this issue on 2023.8.3
from homeassistant-stubs.
I did a quick test and can tell the stub is generated correctly with MyPy 1.4.1
When MyPy is upgraded to 1.5.0 or 1.5.1 the extra function is generated causing the syntax error:
def __mypy-replace(
So it's definitely some regression bug in stubgen code.
Don't have time to create a bug report now at mypy.
Might be an idea for @KapJI to fix MyPy dependency to 1.4.1 for the time being so at least the stubs can be generated correctly now.
As things are completely broken atm.
from homeassistant-stubs.
Thanks for escalating it with mypy team!
from homeassistant-stubs.
Version 2023.11.2
was published which uses mypy 1.7.0. It has multiple improvements for dataclass stubs. Give it a try.
from homeassistant-stubs.
Related Issues (9)
- v2022.4.4 still requires homeassistant 2022.4.2 in some places HOT 1
- Syntax errors in generated stubs HOT 1
- Check installation on Windows HOT 2
- `Generic[_T]` lost on `DataUpdateCoordinator` HOT 2
- `total=False` lost on `DeviceInfo` HOT 6
- `homeassistant.components.text` missing library stubs or py.typed marker HOT 2
- Syntax error in latest HOT 2
- Generation is broken due to stubgen bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homeassistant-stubs.