Skip to content
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

pymodbus.server requires redis in 3.1.2 #1319

Closed
beenje opened this issue Jan 30, 2023 · 6 comments · Fixed by #1320
Closed

pymodbus.server requires redis in 3.1.2 #1319

beenje opened this issue Jan 30, 2023 · 6 comments · Fixed by #1320

Comments

@beenje
Copy link

beenje commented Jan 30, 2023

Versions

  • Python: 3.11
  • OS: Linux
  • Pymodbus: 3.1.2
  • Modbus Hardware (if used):

Pymodbus Specific

  • Server: tcp/rtu/ascii - sync/async
  • Client: tcp/rtu/ascii - sync/async

Description

Running pymodbus.server --help raises an exception when redis isn't installed.

pymodbus.server --help
Traceback (most recent call last):
  File "/home/conda/feedstock_root/build_artifacts/pymodbus_1675064514324/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/bin/pymodbus.server", line 7, in <module>
    from pymodbus.repl.server.main import app
  File "/home/conda/feedstock_root/build_artifacts/pymodbus_1675064514324/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.11/site-packages/pymodbus/repl/server/main.py", line 16, in <module>
    from pymodbus.server.reactive.default_config import DEFAULT_CONFIG
  File "/home/conda/feedstock_root/build_artifacts/pymodbus_1675064514324/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.11/site-packages/pymodbus/server/__init__.py", line 5, in <module>
    from pymodbus.server.async_io import (
  File "/home/conda/feedstock_root/build_artifacts/pymodbus_1675064514324/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.11/site-packages/pymodbus/server/async_io.py", line 12, in <module>
    from pymodbus.datastore import ModbusServerContext
  File "/home/conda/feedstock_root/build_artifacts/pymodbus_1675064514324/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.11/site-packages/pymodbus/datastore/__init__.py", line 3, in <module>
    from pymodbus.datastore.database.redis_datastore import RedisSlaveContext
  File "/home/conda/feedstock_root/build_artifacts/pymodbus_1675064514324/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.11/site-packages/pymodbus/datastore/database/__init__.py", line 2, in <module>
    from pymodbus.datastore.database.redis_datastore import RedisSlaveContext
  File "/home/conda/feedstock_root/build_artifacts/pymodbus_1675064514324/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho/lib/python3.11/site-packages/pymodbus/datastore/database/redis_datastore.py", line 5, in <module>
    import redis
ModuleNotFoundError: No module named 'redis'

See https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=649693&view=logs&jobId=656edd35-690f-5c53-9ba3-09c10d0bea97&j=656edd35-690f-5c53-9ba3-09c10d0bea97&t=e5c8ab1d-8ff9-5cae-b332-e15ae582ed2d

With 3.1.1, redis was an optional dependency.
I'd not expect this to change with a patch release.

Is this a bug that was introduced in 3.1.2?

@Stausssi
Copy link

Same goes for python imports from pymodbus.datastore. Both redis and sqlalchemy are mandatory with 3.1.2

@janiversen
Copy link
Collaborator

Ups my mistake, I will fix that fast.

@janiversen
Copy link
Collaborator

Can you please test newest dev, I just added a fix and report back. If successful then I will make 3.1.3

@janiversen janiversen reopened this Jan 30, 2023
@Stausssi
Copy link

The import problems with redis and sqlalchemy are fixed. pymodbus.server --help now fails due to typer not being installed.

@janiversen
Copy link
Collaborator

typer is an optional package (see requirements.txt line 28. pymodbus.server is part of the repl package.

@janiversen
Copy link
Collaborator

Thanks for testing, I will make the .3 release today or tomorrow, I have another urgent problem to solve first.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants