weewx version 5 not updating weewx.con version information.

93 views
Skip to first unread message

Greg

unread,
Jul 19, 2023, 7:26:29 PM7/19/23
to weewx-development
Hi,

I have weewx V5 installed and all is running fine but when I do an upgrade
pip install --upgrade weewx then version doesn't change in the weewx.conf. I assume it is supposed to be changed?

I am running 5.0.0.b9 but the weewx.conf shows:
# Do not modify this. It is used when installing and updating weewx.
version = 5.0.0b6

Do I have to do something extra as I have the weewx set up to use /opt/weewx/weewx-data/weewx.conf file

Thanks

Tom Keffer

unread,
Jul 19, 2023, 7:40:41 PM7/19/23
to Greg, weewx-development
The pip upgrade upgrades the code base, not the station data. The configuration file, weewx.conf, is part of the latter.

To upgrade the station data, you use "weectl station upgrade". By default, this upgrades the documentation, examples, and utility files, but it can also (optionally) upgrade the configuration file and skins. Because we work hard at backwards compatibility, that should be necessary only rarely.

It's best to think of the version number in weewx.conf (and, for that matter, the skin.conf's) as "Installed by", not the current version.

If you want the current version, use

weectl --version

You're not the first to get confused by this. I'm thinking at the very least to put a comment in weewx.conf stating that the version number is the "Installed by" number. Or, even removing it completely.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/39ea8a71-dd6e-44e2-8711-b76cd80de198n%40googlegroups.com.

Greg Reive

unread,
Jul 19, 2023, 7:48:44 PM7/19/23
to Tom Keffer, weewx-development
Ok, thanks for the clarification.

That's the bit I didn't understand. As the file says do not modify it is used when installing and updating.
I assumed updating meant that the version would get updated in this file as well.

 Does it have any other purpose? If not, just remove it?

I am easily confused. 😀

--
¯\_(ツ)_/¯

Tom Keffer

unread,
Jul 19, 2023, 7:54:24 PM7/19/23
to Greg Reive, weewx-development
The version number is useful if and when "weectl station upgrade" is called upon to update weewx.conf. Then the utility knows where to start and what upgrades might be needed.

Vince Skahan

unread,
Jul 19, 2023, 9:34:58 PM7/19/23
to weewx-development
Wild thought here - why not drop a file someplace within the installed code base (possibly 'weewx.version' or .version or the like) with a version identifier, and then it wouldn't need to be in weewx.conf.......

Tom Keffer

unread,
Jul 19, 2023, 9:53:20 PM7/19/23
to Vince Skahan, weewx-development
We already have this.

weewx.__version__ 

has the current version, which can be printed out using

weectl --version

-tk

Vince Skahan

unread,
Jul 19, 2023, 10:20:00 PM7/19/23
to weewx-development
Guess I'm not understanding what's what and where in which use case....and pip vs. packaged might make my brain hurt if I think a bit too hard there....

Looking at a pip-installed venv setup, it looks like the 'code' puts the version string in site-packages/weewx/__init__.py so shouldn't all the utilities always report that string ?   For example - when you set registration true, does it use that string for the version, or does it use the value in weewx.conf ?   Is the weewx.conf string used anywhere by any code at runtime ?

Maybe rename the weewx.conf version string to something different to try to make it less confusing ???

Tom Keffer

unread,
Jul 20, 2023, 7:29:19 AM7/20/23
to Vince Skahan, weewx-development
The value in weewx.conf is only used to keep track of which version created it. That's useful if and when it ever comes time to upgrade it. It's also useful for support: given a version number, we know what features to expect in the file.

Registration uses the value weewx.__version__



Reply all
Reply to author
Forward
0 new messages