Skip to content

Python version dependencies are not correctly handled on VOLTTRON startup. #308

@davidraker

Description

@davidraker

Describe the bug
VOLTTRON attempts to create a pyproject.toml file on startup, and will crash if any packages in the python environment are misaligned with volttron's version dependency. Additionally, poetry always seems to believe volttron has a dependency on python>=3.10,<3.11, even though the pyproject.tomls all seem to list python>=3.10,<4.0.

To Reproduce
Steps to reproduce the behavior:

  1. Install volttron and a package which has a dependency on python 3.11 or greater:
    $ pip install volttron
    $ pip install matplotlib

  2. Start volttron. Observe the error (after a minute or so).
    $ volttron -vv
    ...a minute or so of logs....
    RuntimeError: Unable to update pyproject.toml in /home/vuzer/.volttron with venv's current list of libs. ('Error from poetry command:', '\nThe current project's supported Python range (>=3.10,<3.11) is not compatible with some of the required packages Python requirement:\n - contourpy requires Python >=3.11, so it will not be installable for Python >=3.10,<3.11\n\nBecause volttron depends on contourpy (1.3.3) which requires Python >=3.11, version solving failed.\n\n * Check your dependencies Python requirement: The Python requirement can be specified via the python or markers properties\n\n For contourpy, a possible solution would be to set the python property to ""\n\n https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,\n https://python-poetry.org/docs/dependency-specification/#using-environment-markers\n\n'))

  3. Note that the pyproject.toml file was created, but does not include all packages in the python environment:
    $ cat .volttron/pyproject.toml

  4. Start volttron a second time. Observe that there are no errors because the (incomplete) pyproject.toml file already exists.

Expected behavior

  • VOLTTRON should never have a dependency of python <3.11.
  • The incomplete pyproject.toml should not be left in the VOLTTRON_HOME
  • VOLTTRON should start even if there are incompatible packages in the environment. They may be irrelevant to VOLTTRON.
  • If possible, in cases where there is a real conflict, VOLTTRON should provide meaningful output that indicates where the conflict has arisen.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions