Hello,

I just tested the GNU Health client release candidate using TestPyPI. As I am filling the config files with Ansible I was missing the expected profiles.

Usually the config folders were named '3.8' and '4.0' so I would have expected '4.2' but just got '4'.

Seems like the code expects 3 numbers separated by dots and does not exclude 'rc' or 'b' for beta or release candidate versions.

I Managed to get config folder '4.2' like this:

--- a/gnuhealth/config.py       Wed Jan 25 19:31:19 2023 +0000
+++ b/gnuhealth/config.py       Wed Feb 01 13:09:09 2023 +0100
@@ -34,9 +34,9 @@
         if not isinstance(appdata, str):
             appdata = str(appdata, sys.getfilesystemencoding())
         return os.path.join(appdata, '.config', 'gnuhealth',
-                __version__.rsplit('.', 1)[0])
+                '.'.join(__version__.split('.', 2)[:2]).split('rc')[0].split('b')[0])
     return os.path.join(os.environ['HOME'], '.config', 'gnuhealth',
-            __version__.rsplit('.', 1)[0])
+            '.'.join(__version__.split('.', 2)[:2]).split('rc')[0].split('b')[0])


Before it just removed the last element separated by '.'

I took the approach from the same file to define 'short_version' to rather take the first two elements separated by dots and then added to cut anything starting with 'rc' or 'b'.

Not sure if this would have ever been relevant outside the release candidate version but could be a small improvement.

Best

Gerald


Reply via email to