-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLN: remove checks for python < 3.8 #44223
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @twoertwein for the cleanup
(If we wanted to generate stub files in the future instead of making pandas a pytyped library, we may want to generate those stubs from the inline types using stubgen instead of manually curating those files. In #28142 there has been some suggestion that pandas takes on the microsoft pyright types. IMO having pandas maintaining stubs files would allow this to happen much sooner than pandas will be ready to be a pytyped library. If that were to be the situation we may want to keep the types for the deprecated python versions on master around a bit longer. There is quite a few ifs here, so am also happy to merge this.)
I think that would be great (for cython), but are there tools that can do that for cython/c-extensions? If I read #28142 and pyright's recommendations correctly: prefer inline annotations, but fallback to pyi files (for cython and so on).
#43744 contains the first(?) batch of pyi files from microsoft for cython files in _libs.
I don't think I understand: does pandas plan to release type annotations for previous releases of pandas? Many typing features require 3.8 which is also luckily the oldest supported version of pandas. |
Sorry that I was not explicit here. If we created stubs (big if) automatically we would probably want to use stubgen on the python code and then also probably copy the cython stubs into the package since these are already curated. (Rather than have a completely seperate repo) So pandas master would be the source of truth. And yes, we are currently on the path of eventually making pandas a pytyped library. Which is why I'm happy that this cleanup is merged. (but OTOH there is also no harm keeping these stub files as is for now)
We have started to integrate the types, but the task is not complete until microsoft stop bundling pandas types with pyright. (I may have my config incorrect, but I cannot use pyright in vs code when developing pandas code since goto definition always goes to the type libraries and not the code that I am working with)
stubs (as opposed to inline types) are not restricted by python versions for type annotation syntax. Type checking tends to happen using the latest version of a type checker which normally supports all type annotations syntax. Stub files tend to contain types annotations for all supported/previous versions of a software package. When pandas becomes a pytyped library only that version of pandas has type annotations. If (big if) pandas released stubs, all code using previous versions of pandas could also be checked. (if we decided too of course) |
For my personal projects, I run |
Good tip. (maybe can put that in the docs somewhere) I was referring to working with pandas itself. So the open folder is pandas. Not sure how to fool mypy and pylance in this case. I just use Jedi for the language server instead. |
I would hope that |
Ahh yes. maybe could add a py.typed file locally and then update (and merge to master) gitignore so that pandas devs could have a pytped file locally that doesn't get accidently merged to master. |
thanks @twoertwein |
No description provided.