You are not logged in.

#1 2022-04-26 14:41:02

chibo
Member
Registered: 2018-04-27
Posts: 87

No stubs for python-lxml

(module) lxml
⟠  lxml: [ module ]    Docs

Stub file not found for "lxml"PylancereportMissingTypeStubs


> The stub file for lxml.html was not available until version 0.2.0 (released in May 2021). You can just pip install lxml-stubs --upgrade.
https://stackoverflow.com/questions/505 … -in-python

extra/python-lxml 4.8.0-1 (1.1 MiB 4.2 MiB) (Installed)

Offline

#2 2022-04-26 15:10:40

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: No stubs for python-lxml

Well your output makes no sense. Where did it come from? What's the actual issue?

Even that last line doesn't seem to be from pacman.

Last edited by Scimmia (2022-04-26 16:31:49)

Offline

#3 2022-04-27 13:18:28

chibo
Member
Registered: 2018-04-27
Posts: 87

Re: No stubs for python-lxml

python-lxml it's obviously Python library, it's pretty easy to distinguish by "python-*" pattern you know..

so problem shows up in Python with Pylance (in VSCode in my example, but it's doesn't matter)


> Even that last line doesn't seem to be from pacman.
give a try maybe..?

Offline

#4 2022-04-27 13:28:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,461

Re: No stubs for python-lxml

So no real information to add.

python-lxml is fine.

% python
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml.html
>>> quit()

I guess I just don't know what python output looks like? Or don't know what pacman output looks like? Sure, then, good luck.

Offline

#5 2022-04-27 13:39:17

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: No stubs for python-lxml

with Pylance

The python code works fine, but it looks like pylance tries to use static type information for some code verification or so. That requires an additional package for lxml, since the lxml metadata is not part of the typeshed package anymore.
https://github.com/lxml/lxml-stubs

Last edited by progandy (2022-04-27 13:40:45)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2022-04-29 04:28:44

chibo
Member
Registered: 2018-04-27
Posts: 87

Re: No stubs for python-lxml

progandy wrote:

with Pylance

The python code works fine, but it looks like pylance tries to use static type information for some code verification or so. That requires an additional package for lxml, since the lxml metadata is not part of the typeshed package anymore.
https://github.com/lxml/lxml-stubs

Finally! Someone that have some understanding..

so, since the typing is a thing now (almost a whole 3.10 update was related to Typing module)  ->  would be nicer to ship these packages together

Last edited by chibo (2022-04-29 08:07:53)

Offline

#7 2022-04-29 10:06:44

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: No stubs for python-lxml

pylance doesn't appear to be present in archlinux repos, are there other programs that need this information that are ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#8 2022-04-30 11:06:25

chibo
Member
Registered: 2018-04-27
Posts: 87

Re: No stubs for python-lxml

Lone_Wolf wrote:

pylance doesn't appear to be present in archlinux repos, are there other programs that need this information that are ?

mypy

Offline

#9 2022-04-30 11:45:34

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: No stubs for python-lxml

mypy appears to be used for testing code by multiple other tools.

If there is proof/examples/usecases that those tests would benefit from archlinux having lxml-stubs in repos, a feature request to add lxml-stubs might have a chance to get accepted.

If the benefit is hard to proof (or the request is denied) , an aur package could be an alternative.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#10 2022-05-02 07:01:03

chibo
Member
Registered: 2018-04-27
Posts: 87

Re: No stubs for python-lxml

Lone_Wolf wrote:

mypy appears to be used for testing code by multiple other tools.

If there is proof/examples/usecases that those tests would benefit from archlinux having lxml-stubs in repos, a feature request to add lxml-stubs might have a chance to get accepted.

If the benefit is hard to proof (or the request is denied) , an aur package could be an alternative.

w/o stubs - you have no type hinting, errors all over the code, it's so bad so you have to change python language server from pylance(pyright) to jedi

https://user-images.githubusercontent.c … 8ab477.jpg


Mod Edit - Replaced oversized image with link.
CoC - Pasting pictures and code

Last edited by Slithery (2022-05-02 11:28:36)

Offline

#11 2022-05-02 09:48:27

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: No stubs for python-lxml

That shows pylance benefits from stub files, but pylance is not in archlinux repositories .

To have any chance for python stub packages in archlinux repos there needs to be a clear advantage for archlinux that offsets the work needed to add them.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#12 2022-05-02 10:22:47

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,407
Website

Re: No stubs for python-lxml

Please don't post oversized images... neutral

Last edited by Alad (2022-05-02 10:24:01)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

Board footer

Powered by FluxBB