openenergymonitor / emonhub

Python service linking and decoding input to MQTT & Emoncms
90 stars 83 forks source link

python venv #184

Closed alexandrecuer closed 1 year ago

alexandrecuer commented 2 years ago

Tested on an emonpi with an emontx v3, works fine. As my usage of emonhub is limited to the basic interfacers (EmonHubJeeInterfacer, EmonHubMqttInterfacer) should be tested more deeply

cf https://github.com/openenergymonitor/EmonScripts/issues/171

to install that version on a new setup, using the scripted installations, just modify the install/config.ini so that it uses my modified branch : emonhub_branch=master and git_repo[emonhub]=https://github.com/alexandrecuer/emonhub.git

borpin commented 1 year ago

Does the systemd service file need adjusting?

I am guessing not but checking.

Would this be a good time to switch to a requirements file so we can specify the versions of the python packages?

https://github.com/openenergymonitor/emonhub/blob/4539b9e928e3f7b5bc3dd1922440cf7e725ac6b9/service/emonhub.service#L10

borpin commented 1 year ago

The other issue is migration.

We can't update emonhub.py with the different hashbang without installing the venv. So a migration script would be needed.

Remember older versions as well.

alexandrecuer commented 1 year ago

No the service file does not need any modification.

For older versions, yes it is a breaking change but is it possible to help migrations, without over complicating things ? A possibility could be to change the shebang from the install script. it would be tracked by git as a modification but it is maybe not a big problem....

alexandrecuer commented 1 year ago

not so useful after all