I wonder if there is any interest/support for patches to make weewx
follow common python packaging methods, such as
- installing python modules into /usr/lib/pythonX.Y/site-packages
- make it possible to install weewx with pip
- make weewx support normal python modules as extensions
instead/additionally of a custom installation format
--
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/aaf77e00-4470-4c58-bf56-42346b1e410d%40googlegroups.com.
Of course, there is the question of "Ideally how would this be if we
were starting from scratch" and then the questions of "how hard is it to
get from here to there" and "is it worth it".
I was actually looking at the “brew” system, which is Linux and MacOS friendly, just yesterday to see how packages were created in that system. It might be a good candidate?
By using the standard method, it would be also very easy to package for
different distributions, since they are optimised for the default
approach. For example Fedora supports automatically generating the
python dependences based from the information of the pip-compatible
package.
--
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/20200505182444.GF16242%40genius.invalid.
Tom Keffer <tke...@gmail.com> writes:
> In fact, I would appreciate it if you could point me to any non-trivial
> application that pip installs. I couldn't find any. Just libraries.
home assistant
which is sort of like weewx, but more complicated.
My home assistant install, via pip in a venv, has 119 modules.
> Requirements for a pip install:
>
> 1. Ability to install into one directory, such as /home/weewx. It's OK
> if it takes some contorted setting of install directories in order to do
> this, but I like having all state, all libraries, all code, in one spot. It
> makes my life easier.
Is that really a pip requirement? pip can install in a virtualenv, and
for instance I have all homeassistant stuff in a venv in ~/HASS.
As for namespaces, weewx may need to install all modules as weewx/foo
instead of foo. That doesn't seem terrible.
Not sure, what exactly the application needs to be to be non-trivial.
This is a rather big project with several CLI tools:
https://pypi.org/project/ansible/
> Requirements for a pip install:
>
> 1. Ability to install into one directory, such as /home/weewx. It's OK
> if it takes some contorted setting of install directories in order to do
> this, but I like having all state, all libraries, all code, in one spot. It
> makes my life easier.
In my opinion, it would be nice to be able to run weewx from a GIT
working copy and it being pip-installable does not contradict this. So
in general this should work. Not sure, if you also consider helper
configuration like logrotate or init config to be in that directory, but
I guess, not.
> 2. Ability to install in "standard" locations.
> 3. If we install in standard locations, and if the names of the weewx
> modules are not changed (and I don't think they should be), then there is a
> risk of a name collision for common names like 'schema' and 'user. A
> strategy for this.
What is depending on these names? Are these only extensions that weewx
will install and import/execute or also something external? What
locations do things expect them to be? There could be compat package that
contains files in /usr/share/weewx/ that provide the new names. Also the
python path could be adjusted for extensions that weewx loads.
> 4. A "one pass" install, rather than pip, followed by invoking yet
> another program that asks the user for station settings. Right now, we do
> this by invoking wee_config with appropriate parameters from within
> setup.py (this part is not finished in the pip branch).
As long as the "one pass" install does not need to be called setup.py,
it would be rather easy to add a helper like "local-install" that will
then call setup.py/pip and the script to configure the station settings.
Would this be enough?
> 5. Pip allows you to upload a given version number only once. This would
> require an automated version naming tool, otherwise it's a righteous pain
> the butt. I don't know anything about tox. Can it do something like this?
Not sure, what the problem is, here. You will only release for example
4.0.0 only once, wont't you? tox is not the tool to address something
like this, it simplifies running commands for different python
versions/environments.
> 6. Support for our "standard platforms," which generally includes the
> platforms listed in Matthew's compatibility matrix
> <https://github.com/weewx/weewx/wiki/weewx4-compatibility-matrix>.
This is not a problem. I am a little bit sad that Fedora is not
considered a standard platform, though. ;-)
This is not a problem. I am a little bit sad that Fedora is not
considered a standard platform, though. ;-)Matthew would know better than me, but the vast majority of users use CentOS, not Fedora.
On first thought, the best approach for me would be that the recommended
way to install extensions would be that they use pip as well for
installation. Everything that wee_extensions installs, would be best
moved to /var/lib/weewx/user or similar to ensure that it does not
conflict with the packaged files from weewx. Seems like it would be
$HOME/.local/share or $XDG_DATA_HOME if installing per-user. There does
not seem to be a better counter part for /var/lib.
> 4. weewx.conf gets automatically patched by an upgrade. This is a big
> feature of weewx over the standard package upgrades, which merely ask a
> user if they want to "merge" their old config file with an incoming, new
> config file.
What exactly is happening here?
> 5. The modules 'user' and 'schema' would have to move to avoid name
> collisions, to weewx.user and weewx.schema, respectively. To maintain
> backwards compatibility, dynamic imports would automatically try their new
> locations.
There are also six.py, which I guess could be removed and users should
be asked to install it from their distribution or via pip and daemon.py
(which I guess could be moved in the weewx package).
The user directory is the directory where wee_extension adds new
extensions, isn't it?
On first thought, the best approach for me would be that the recommended
way to install extensions would be that they use pip as well for
installation. Everything that wee_extensions installs, would be best
moved to /var/lib/weewx/user or similar to ensure that it does not
conflict with the packaged files from weewx. Seems like it would be
$HOME/.local/share or $XDG_DATA_HOME if installing per-user. There does
not seem to be a better counter part for /var/lib.
> 6. Support for our "standard platforms," which generally includes the
> platforms listed in Matthew's compatibility matrix
> <https://github.com/weewx/weewx/wiki/weewx4-compatibility-matrix>.
>
> Did I miss anything?
The items in ./util are not managed by setup.py, are they?
> Any volunteers?
I would like to contribute. My challenge is that I am rather new to
weewx, so I do not have the full picture, yet.
...which I guess could be removed and users should
be asked to install it from their distribution or via pip....
--
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/rmiy2pztwdj.fsf%40s1.lexort.com.
On Sunday, May 10, 2020 at 8:37:17 AM UTC-7, Till Maas wrote:...which I guess could be removed and users should
be asked to install it from their distribution or via pip....
A good example is trying to do a dpkg or rpm that requires python3-cheetah when your distro does not 'have' such a package. If you install cheetah with pip as a second way to get it onto the system, if your package isn't smart enough to support that, a package installation will fail and you would have to use a --force or a --ignore-dependencies (or the like) switch to force the package to install. Those options cause risk too, and a non-linux person won't understand the risks nor how to deal with adventures if they pop up.
Vince Skahan <vince...@gmail.com> writes:
> A good example is trying to do a dpkg or rpm that requires python3-cheetah
> when your distro does not 'have' such a package. If you install cheetah
> with pip as a second way to get it onto the system, if your package isn't
> smart enough to support that, a package installation will fail and you
> would have to use a --force or a --ignore-dependencies (or the like) switch
> to force the package to install. Those options cause risk too, and a
> non-linux person won't understand the risks nor how to deal with adventures
> if they pop up.
That sounds like a broken packaging system. In order to have weewx, it
first has to have all the dependencies. People doing package
maintenance deal with this as part of package creation.
--
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/087f1bf9-0d44-44c4-989e-ad1e10f59b10%40googlegroups.com.
- (2) stop using the os's python modules. Bundle at least the add-on modules weewx needs 'with' weewx core, located under the weewx tree someplace. Fix up PYTHONPATH or the like as needed.
--
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/edf62268-4126-47f8-a96e-e6f948f0f55b%40googlegroups.com.
Vince, you're the Docker expert. Would it solve some of these problems? Is it widely available?
So the notion that a binary package in rpm, deb, whatever can be
installed on any linux flavor that has the same CPU type is basically
unsound; it would have to be built per OS/release/cpu tuple and ensure
that the dependencies are available in the same package repo that it's
going to go into.
--
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/20200512182837.GE25070%40genius.invalid.
I'm with you, Till, but I still need a volunteer! 😀
--
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/7ade75f4-e9c1-48a3-b4f4-82680aa1204f%40googlegroups.com.
--
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/20200522165330.GG25070%40genius.invalid.