redis / redis-om-python

Object mapping, and more, for Redis and Python
MIT License
1.09k stars 108 forks source link

Proper Python 3.11 support #445

Closed YaraslauZhylko closed 1 year ago

YaraslauZhylko commented 1 year ago

I was going to try redis-om out in my project, but turned out that the supported Python versions of redis-om https://github.com/redis/redis-om-python/blob/1e33e2513e4e906e6db28d4a540c99ff48e8336f/pyproject.toml#L37 does not match the Python requirements in my project:

python = "~3.11"

Here's the error message:

$ poetry add redis-om==0.1.1

Updating dependencies
Resolving dependencies... (0.0s)

The current project's Python requirement (>=3.11,<3.12) is not compatible with some of the required packages Python requirement:
  - redis-om requires Python >=3.7,<=3.11, so it will not be satisfied for Python >3.11,<3.12

Because <project name> depends on redis-om (0.1.1) which requires Python >=3.7,<=3.11, version solving failed.

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties

    For redis-om, a possible solution would be to set the `python` property to "3.11"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

Seems like the proper way to support Python 3.11 in redis-om would be to set the Python requirements to:

python = ">=3.7,<3.12"

PR: #446