hahow / pika-stubs

PEP-484 stubs for Pika
https://pypi.org/project/pika-stubs/
MIT License
7 stars 2 forks source link

Pip install fails #1

Open JonnoFTW opened 3 years ago

JonnoFTW commented 3 years ago

I have:

Running

pip install pika-stubs

Fails with the following error:

$ pip install pika-stubs
ERROR: Could not find a version that satisfies the requirement pika-stubs (from versions: none)
ERROR: No matching distribution found for pika-stubs
velovix commented 3 years ago

This is because, according to the setup.cfg, pika-stubs requires Python 3.8 or higher. I'm not sure if the package actually uses any functionality that's only available in 3.8, but pip won't let you install a package that says it's not compatible with your Python version.

blem14 commented 3 years ago

I am using pika for Python 3.6 and while coding in PyCharm, it keeps giving me popup to install pika-stubs to "make code insight better", but I can't, since it's for 3.8+. There are multiple devs in my project and we all use PyCharm, so this would be questioned as soon as I push the pika into our requirements. I would really want to add pika-stubs to requirements too, so if that's possible, please lower the required Python version.

JonnoFTW commented 3 years ago

@blem14 this is exactly the problem I was having and why I opened this issue.

upsetbit commented 3 years ago

Since this issue is frozen for a couple of months, I took the liberty of doing something: https://github.com/caian-org/pika-stubs

MyPy is very strict on the package name: for a package named X, it will only accept a stub called "X-stubs". Since pika-stubs is already published, I could only install through a wheel file. It worked for me.

@JonnoFTW @blem14 @velovix take a look and see if this helps.

andersk commented 3 years ago

I'm not sure if the package actually uses any functionality that's only available in 3.8,

Mypy supports new Python features in stubs even when running on older Python versions. And at runtime, by definition, type stubs are not used or even imported at all. So there should be no reason not to relax this restriction.

@caiertl Have you considered opening a pull request?