On Monday, January 16, 2023 at 8:50:35 PM UTC-5 Tom Keffer wrote:
at 'station create' time, why not just copy all of the parameterized utils 
into the utils directory, without replacing any parameters?
(by 'parameters' i mean the WEEWX_ROOT, WEEWX_BINDIR, WEEWX_CFGDIR and 
others like them.  btw we need to canonicalize that list...)

weectl station create does exactly this, although in a backwards compatible 
way.

we might have a different interpretation of 'backward compatible'.  when i 
say 'backward compatible', this means that i can take any old weewx config 
file, and it will work, unmodified, with the latest backward-compatible 
release.  there should be no need to modify the config - if there is, then 
that weewx release is not backward compatible.

i realize that the convention for weewx has been to modify a user's config 
file during an upgrade.  to me, this is not "backward compatible", this is 
an upgrade of the config file.

just to clarify: at some point we explicitly separated the 
config-file-upgrade code so that dpkg/rpm could invoke that independently 
of upgrading the weewx code.  now this will be available as 'weectl station 
upgrade' - upgrade the indicated weewx config file - with a separate option 
for explicitly upgrading the skins.

 
Give it a try:

*pip install weewx --user*
*weectl station create*
*sudo cp ~/weewx-data/systemd/weewx.service /etc/systemd/system*

That's it to get a daemon going.

fwiw, this is what i get on an ancient macos (intel) using anaconda3 
(python 3.8):

% which pip
/Volumes/Software/sw/anaconda3/bin/pip
% pip install weewx --user
Requirement already satisfied: weewx in 
./.local/lib/python3.8/site-packages (5.0.0a4)
Requirement already satisfied: PyMySQL<2.0,>=1.0 in 
./.local/lib/python3.8/site-packages (from weewx) (1.0.2)
Requirement already satisfied: configobj>=4.7 in 
/Volumes/Software/sw/anaconda3/lib/python3.8/site-packages (from weewx) 
(5.0.6)
Requirement already satisfied: six<2,>=1 in 
/Volumes/Software/sw/anaconda3/lib/python3.8/site-packages (from weewx) 
(1.15.0)
Requirement already satisfied: Pillow<10.0,>=9.3 in 
./.local/lib/python3.8/site-packages (from weewx) (9.3.0)
Requirement already satisfied: pyusb<2.0.0,>=1.0.2 in 
./.local/lib/python3.8/site-packages (from weewx) (1.2.1)
Requirement already satisfied: pyephem<4.0,>=3.7 in 
./.local/lib/python3.8/site-packages (from weewx) (3.7.7.0)
Requirement already satisfied: CT3<4.0,>=3.1 in 
./.local/lib/python3.8/site-packages (from weewx) (3.3.1)
Requirement already satisfied: pyserial<4.0,>=3.4 in 
./.local/lib/python3.8/site-packages (from weewx) (3.5)
Requirement already satisfied: ephem==3.7.7.0 in 
./.local/lib/python3.8/site-packages (from pyephem<4.0,>=3.7->weewx) 
(3.7.7.0)

% export PATH=/Users/mwall/.local/bin:$PATH
% weectl --version
weectl v5.0.0a4
% weectl station create
The configuration file will be created at /Users/Shared/weewx/weewx.conf.

Give a description of your station. This will be used for the title of any 
reports.
Description [WeeWX station]: 

Specify altitude, with units 'foot' or 'meter'. For example:
35, foot
12, meter
altitude [700, foot]: 

Specify latitude in decimal degrees, negative for south.
latitude [0.0]:
Specify longitude in decimal degrees, negative for west.
longitude [0.0]: 

You can register your station on weewx.com, where it will be included
in a map. If you choose to do so, you will also need a unique URL to 
identify
your station (such as a website, or a WeatherUnderground link).
Include station in the station registry [n]? 

Choose a unit system for your reports. Possible choices are:
'us' (ºF, inHg, in, mph)
'metricwx' (ºC, mbar, mm, m/s)
'metric' (ºC, mbar, cm, km/h)
Later, you can modify your choice, or choose a combination of units.
Your choice [us]: 

Installed drivers include:
0) AcuRite (weewx.drivers.acurite)
1) CC3000 (weewx.drivers.cc3000)
2) FineOffsetUSB (weewx.drivers.fousb)
3) Simulator (weewx.drivers.simulator)
4) TE923 (weewx.drivers.te923)
5) Ultimeter (weewx.drivers.ultimeter)
6) Vantage (weewx.drivers.vantage)
7) WMR100 (weewx.drivers.wmr100)
8) WMR300 (weewx.drivers.wmr300)
9) WMR9x8 (weewx.drivers.wmr9x8)
10) WS1 (weewx.drivers.ws1)
11) WS23xx (weewx.drivers.ws23xx)
12) WS28xx (weewx.drivers.ws28xx)
choose a driver [3]: 

i expected it would have defaulted to $HOME/weewx-data, not 
/Users/Shared/weewx. it succeeded only because i had /Users/Shared/weewx 
and had permissions on that dir leftover from macos testing.

apparently 'weectl station create' does not install the utils:

% ls -la /Users/Shared/weewx
total 40
drwxr-xr-x 4 mwall wheel 128 Jan 16 21:02 .
drwxrwxrwt 8 root wheel 256 Jan 16 21:02 ..
drwxr-xr-x 8 mwall wheel 256 Jan 16 21:02 skins
-rw-r--r-- 1 mwall wheel 19533 Jan 16 21:02 weewx.conf

what should we expect to see in `weewx-data` (i.e., in a virgin WEEWX_ROOT 
after 'station create')?

weewx-data/
weewx-data/weewx.conf  - config file constructed from response to prompts
weewx-data/skins/ - all of the skins that ship with weewx
weewx-data/bin/user/ - the 'user' directory where extensions put python code
weewx-data/util - directories with virgin rc, unit, udev, logrotate, 
logwatch, syslog examples

regarding the directory specifications in the weewx config file:
1) is SQLITE_ROOT relative to WEEWX_ROOT *only* if it is a relative path? 
(where relative path is something that starts with anything other than /)  
so i assume that "SQLITE_ROOT = %(WEEWX_ROOT)s/archive" will become simply 
"SQLITE_ROOT = archive".  however, if weewx is going to be backward 
compatible, then it will still have to do expansion of WEEWX_ROOT when it 
finds %(WEEWX_ROOT)s...
2) are SKIN_ROOT and HTML_ROOT also relative to WEEWX_ROOT? (but only if 
they are a relative path)
3) where do the local, html-ified weewx docs live on a pip install?

> Believe me, I have explored every possibility. It's possible I've missed 
something, but there's been a 
> dead end in every approach I've tried.

i feel your pain!  the first release is easy.  by the 5th release you want 
to start over, punt backward-compatibility, or give up ;)

i can start running v5 through the dpkg and rpm packaging the first week of 
february.  can't wait to try the new virtualbox on apple's m1 hardware...

m

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/2781edc6-f8f6-4a25-886f-23ab09cbe45bn%40googlegroups.com.

Reply via email to