ENB: Harmonize Leo and Pip version numbers (#1242)

46 views
Skip to first unread message

Matt Wilkie

unread,
Jul 25, 2019, 1:15:55 AM7/25/19
to leo-editor
Engineering notebook post about "Harmonize Leo and Pip version numbers #1242". Much of this opening post to mailing list is copied from the issue description. I realized it's better to have the "thinking out loud" parts in the mailing list, where people can chime in more easily,

Leo's self reported and Pip's reported version numbers should agree with each other and they don't. A chicken and egg problem. Part of this is because pip doesn't have (guaranteed) access to Git.


> leo-m --version

Leo 6.0-b2-devel, devel branch, build cecd3edb41
2019-07-24 17:40:09 -0500

> pip show leo
Name: leo
Version: 6.0b1.dev103

Notes:

  • leo-m --version returns version var from leoversion.py (a static string), plus some other info if available:
    • branch (from g.gitBranchName() ?)
    • built from leoGlobals.py g.getGitVersion(), which is parsed from git log -n 1
  • setup.py (and thus pip) version is built from g.gitDescribe(), which is parsed from git describe.

$ leo-m --version

Leo 6.0-b2-devel, devel branch, build 72128bce61
2019-07-24 11:00:48 -0500

$ git log
-n 1 --date=iso
commit
72128bce61ed79d453a161d89d78fb86d3b56d20 (HEAD -> devel, origin/devel)
Author: Edward K. Ream <edreamleo@gmail.com>
Date:   2019-07-24 11:00:48 -0500

   
Fixed #1257 and removed disabled code

$  git describe
--long --tags
v6
.0b1-110-g72128bce6

Mismatches:


Git describe returns different version tag from the static version in leoversion.py. Why?
...because the workflow is:

  1. update static to v6.0-b1 (a master branch release) [b1d9a0e]
  2. create git tag for that v: v6.0-b1-rel [445dfa1]
  3. Initiate development: update static to v6.0-b2-devel to reflect that "we're now working on the next version" [84afef0]

Leo self reports version from "3. Initiate dev". Git reports from it's tag log, which doesn't know about step 3. Put another way, Leo is forward looking and git is backward looking.

So is all that's needed is to add:

  1. create git tag for v6.0-b2-dev in devel branch?

I'm not sure it fits, because of the backward looking nature. ...still thinking...

[many git-reading hours later]: yes, I think this is a good idea. At the cost of adding yet-another-step for the human in the Creating a Release workflow.


-matt

Edward K. Ream

unread,
Jul 25, 2019, 5:15:23 AM7/25/19
to leo-editor
On Thu, Jul 25, 2019 at 12:15 AM Matt Wilkie <map...@gmail.com> wrote:
Engineering notebook post about "Harmonize Leo and Pip version numbers #1242". Much of this opening post to mailing list is copied from the issue description. I realized it's better to have the "thinking out loud" parts in the mailing list, where people can chime in more easily,

I agree.  I use the first comment of an issue to summarize the status of each issue.  That is, I freely edit the first comment to keep it up to date.

Imo, thinking out loud should be done in public whenever possible.

So is all that's needed is to add:

  1. create git tag for v6.0-b2-dev in devel branch?

I'm not sure it fits, because of the backward looking nature. ...still thinking...

[many git-reading hours later]: yes, I think this is a good idea. At the cost of adding yet-another-step for the human in the Creating a Release workflow.

Excellent work.  The extra step is a small price to pay for resolving this issue.

Feel free to update the checklist in leoDist.leo, if you have not already done so.  It would be a good idea to explain why this step is necessary.  In other words, don't rely on my memory ;-)

Edward

Matt Wilkie

unread,
Jul 25, 2019, 4:03:07 PM7/25/19
to leo-editor
Feel free to update the checklist in leoDist.leo, if you have not already done so.  It would be a good idea to explain why this step is necessary.  In other words, don't rely on my memory ;-)

Done, with commit 7ce1b76 .

QQQ
Matt: After merge create dev tag that matches static version added to leoversion.py 4 steps ago. 
    #static version = '6.0-b2-devel'

git checkout devel
git tag -a v6.0-b2-dev -m "Added v6.0-b2-dev tag"
git push --follow-tags
QQQ

I dithered over whether the tag should have "dev" suffix, because it's in the devel branch after all. In end I decided to included it because eventually there will be a b2 release, which would then be tagged "v6.0-b2"

-matt




Matt Wilkie

unread,
Jul 25, 2019, 4:11:05 PM7/25/19
to leo-editor

> pip show leo
Name: leo
Version: 6.0b1.dev103

It's an error to compare pip show and leo --version. This is because pip show reveals the version number when pip install -e was run, not what the current editable version is. To report the actual current editiable version is use:

> python setup.py --version

Creating entry_points for [OS name - system]: nt - Windows
c
:\tools\miniconda3\envs\leo-dev\lib\site-packages\setuptools\dist.py:470: UserWarning: Normalizing '6.0b1-dev112' to '6.0b1.dev112'
  normalized_version
,

6.0b1.dev112

-matt

Edward K. Ream

unread,
Jul 26, 2019, 10:17:14 AM7/26/19
to leo-editor
Many thanks.  I have just closed this item, so I know it is done for now.

Edward
Reply all
Reply to author
Forward
0 new messages