Hi Tom, Really not my place to say what you do with what you have created here, but 40+ years doing production software for many of the largest companies in the US makes me have to say this would not be a good idea. The gain is way smaller than the pain that will follow. Again it is just my opinion. FYI first time I felt I had to say something on a public forum that was not technical. Jerry
On Monday, May 4, 2020 at 2:26:39 PM UTC-7, Tom Keffer wrote: > > Sounds like it would break a LOT of stuff! > > It has been painful enough getting extension writers to embrace Python 3 > and WeeWX 4. But, that transition required them only to rewrite an > extension in Python 3. Old extensions continued to work just fine under > Python 2 and WeeWX V4. > > If I'm understanding your proposal, something like > > import weedb.sqlite > > would become > > import weewx.weedb.sqlite > > That would require hundreds of changes across dozens of extensions. The > upside just doesn't seem worth it. > > -tk > > > > On Mon, May 4, 2020 at 2:12 PM Till Maas <[email protected] <javascript:>> > wrote: > >> Hi Tom, >> >> On Mon, May 04, 2020 at 08:36:57AM -0700, Tom Keffer wrote: >> >> > As you can imagine, there have been many discussions both offline and in >> > weewx-development about these topics. The biggest problem is that weewx >> is >> > a program, not a module, which is what pip typically expects to install. >> > >> > Maybe you're more of a distutils whiz than I am, but, try as I may, I >> could >> > not find a combo that allowed pip to install weewx. So, we gave up and >> went >> > our own way. >> >> sure, I can give it a try. For this, it might be necessary/simpler to >> rename the current setup.py script to make it available for a setuptools >> script that follows normal conventions. Then we can adjust until >> everything is migrated. Would it be important to be able to install >> everything into /home/weewx in the future? Would it suffice to be able >> to install into /home/weewx/.local? >> >> > But, I'm curious when you say that you cannot use "standard approaches" >> > with weewx. For example, I use PyCharm and Eclipse. Both work fine with >> our >> > configuration. Any particular problems? >> >> What is hurting most is that pip install does not work. Therefore a >> custom installation script would be needed to make it available when >> creating a tox config that would run unit tests or pylint/pyflake. >> Also after installing, it needs a custom PYTHONPATH setting. >> >> Therefore it would be nice to start by moving ./bin/weewx to ./weewx in >> the source code. Then adding a build script for creating a module for it >> would be simple. Then it looks like it would be good to move: >> >> ./bin/daemon.py -> ./weewx/daemon.py >> ./bin/six.py should be removed in the future or moved into a >> external_lib directory since it seems to be a copy of the six python >> module. >> >> All the directories like ./bin/weedb could be moved to ./weewx/weedb or >> ./weewx/db to make them part of the module >> >> The code from the tools like ./bin/wee_util could be moved into >> ./weewx/weeutil/main.py >> >> Alternatively, the sub packages for the tools could also be moved along >> weewx, so >> >> ./weeutil/main.py >> ./weewx/... >> >> etc. >> >> I need to look more into the extension and bin/user to propose a change >> for this. >> >> After moving the modules and the main methods, it should be easily >> supported to let setuptools create stubs that will run the main method >> for the modules. >> >> The code from setup.py to create a new config or to update configs >> should probably be moved into their own helper scripts. >> >> To develop drivers, it is most useful to have weewx available as a >> pip-installable module, so I suggest to prepare an example with this, if >> you like the overall idea. >> >> What do you think? >> >> Thanks >> Till >> > -- 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/6622dd69-470a-4de2-98f3-78afb2607d30%40googlegroups.com.
