Exahilosys / survey

A simple library for creating beautiful interactive prompts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different versions installed with pip depending on python version

RobLOlson opened this issue · comments

py -3.10 -m pip install survey installs survey==3.4.0

whereas

py -3.11 -m pip install survey installs survey==4.3.0

Is this intended?

commented

That's curious, it's not intended but I can understand why it may be happening.

The 4.* release requires python 3.11, whereas the 3.* is happy with python 3.10. I guess pip is trying to install the latest viable version, rather than the latest (and if the respective python version is not supported, fail with an error). I'm unsure on how to force the latter behavior from the package's end.

commented

That's curious, it's not intended but I can understand why it may be happening.

The 4.* release requires python 3.11, whereas the 3.* is happy with python 3.10. I guess pip is trying to install the latest viable version, rather than the latest (and if the respective python version is not supported, fail with an error). I'm unsure on how to force the latter behavior from the package's end.

Why it requires Python 3.11?

commented

A few features from python 3.11 are used:

  1. StrEnum
  2. weakref_slot for dataclasses.dataclass
  3. typing.Unpack

That being said, most of these have workarounds to achieve 3.10 compatibility:

  1. Can be replaced with (str, enum.Enum)
  2. Can be replaced with a simple class implementing __weakref__ in __slots__.

However, [3.] has no way of being handled in python 3.10. But, since it is only used in 2 instances - 1 of them being a private function and the other being the signature typehint for Visual.funnel_enter (an internal mechanism) - They could be removed.

These changes are now part v4.4.0, which is on pypi.