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/20200504211237.GB16242%40genius.invalid.

Reply via email to