Skip to content

Cannot install working REPL from PyPI #28

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

Open
chrullrich opened this issue Feb 16, 2025 · 4 comments
Open

Cannot install working REPL from PyPI #28

chrullrich opened this issue Feb 16, 2025 · 4 comments

Comments

@chrullrich
Copy link

The alleged fix to #22 added a dependency on pymodbus 3.7.0 in a section with "dev" in its name, but since PyPI and pip do not care about that, this still leaves no way to install a working pymodbus with REPL from PyPI without delving deep into dependencies and bug reports.

The documentation says to pip install pymodbus[repl]; this currently results in pymodbus 3.8.6, i.e. the situation of #22. If I do pip install pymodbus-repl instead, I find that this does not work either because pymodbus-repl declares no dependency on (any version of) pymodbus, leaving me with a frontend to nothing.

By the way, what the documentation actually says is

Install as pymodbus optional dependency

$ pip install ".[repl]"

This may work when the cwd is in a working copy of the pymodbus repo, but certainly in no other case.

There should be a dependency on a compatible version of pymodbus here:

> pip show pymodbus-repl
Name: pymodbus_repl
Version: 2.0.4
Summary: REPL (Read-Eval-Print Loop) tool for working with Modbus devices using the Pymodbus library.
Home-page: https://github.com/pymodbus-dev/repl
Author: dhoomakethu
Author-email: [email protected]
License:
Location: (elided)
Requires: prompt-toolkit, pygments, tabulate, typer
Required-by:
@dhoomakethu
Copy link
Contributor

dhoomakethu commented Feb 19, 2025

Refer #26, there's a lot of breaking changes in upstream pymodbus which needs to be caught up.

@chrullrich
Copy link
Author

Thank you for the quick response, but it would have been better had you taken the time to read my report first.

I am not complaining that the REPL does not work with latest pymodbus, but that it is currently very difficult to install a working combination of pymodbus-repl and pymodbus. Because pymodbus-repl does not depend on pymodbus at all, let alone "pymodbus<3.8", neither way of installing from PyPI works:

Fix: Add a dependency on pymodbus<3.8, or whatever the latest compatible version is, to pymodbus-repl.

@dhoomakethu
Copy link
Contributor

Apologies for the incomplete response and the inconvenience caused, to begin with repl was supposed to be a utility from with in the pymodbus code base and was not intended to be distributed independently. Later when it was decided to move it out of pymodbus the assumption was that it will be installed alongside pymodbus and should just work out of the box. That was the reason for not having the dependency defined but only the dev dependency. Pymodbus moved really fast and a lot of helpers and aiders for repl has been removed. 2.0.5 addressed the dev part but was not released to pypi since there was a report that it does not work with 3.7.x either properly.

@chrullrich
Copy link
Author

Update: The latest pymodbus version compatible with pymodbus-repl appears to be 3.7.2, and I was wrong that just adding that dependency to pymodbus-repl will sufficiently fix the problem. When pip install pymodbus[repl] encounters the additional dependency of pymodbus-repl to pymodbus, it will look at earlier versions of pymodbus-repl to find one that works with the pymodbus version it has (the latest one), and will happily install one that doesn't have that dependency, i.e. currently 2.0.4.

Adding an exclusion to pymodbus will probably (I have not tried it) just end up with pip using an earlier version of pymodbus that doesn't have it.

The "correct" way of installing things (pymodbus[repl]) may not be fixable at all other than by updating pymodbus-repl to work with current pymodbus. If that was the intent of your answer, I apologize for misunderstanding.

Installing pymodbus-repl, however, can be fixed by a new release with a dependency on a compatible pymodbus version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants