-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify Cylc code to retrieve the version, drop VERSION file and git #2997
Comments
Cylc Version Requirements(in case this helps inform what we need)
Currently
|
@kinow - does your proposal require manually updating the version in One question that comes to mind then is, |
Thanks @hjoliver ! I finished the changes necessary to fix the
Yes, as in
If that's set by |
What I meant above was, if running from a git clone, CYLC_VERSION - in suite jobs - will no longer represent the exact "version" being executed (down to the specific commit) - right? However, I don't suppose that actually matters (we don't actually check out the exact version on job hosts)... in which case I think your proposal is good. Less automatic, but cleaner and more standard. |
(BTW - to state the obvious - the original intent of the current system was to automatically determine cylc version in both git clones and releases (and exactly, to commit level, in clones) without having to manually set it anywhere ... but I agree the associated code has become a mess). |
Oh, you are right @hjoliver. It won't represent the exact version being executed. Hopefully users will be OK assuming 8.0.0 is 8.0.0 no matter whether they are using the version from GitHub tag, rpm, PYPI, etc. I had a look at the documentation and looks like the VERSION and CYLC_VERSION are both mentioned in the .rst files, and also in the INSTALL.md. These files were not updated here, because I think the changes to the documentation will be even more extensive after setup.py |
Users should not be relying on the old VERSION file (I can't think what for, anyway). Most are probably not even aware of it.
Users should not need to see the git tag/commit because the release version is enough to identify the exact source version (it should correspond to a tag in the repository)
Yeah, that's fine with me. |
You might as well update them, unless others @cylc/core disagree with your proposed change (but I don't think they will). ... Can always update again after setup.py etc... |
Will do that tomorrow @hjoliver . Will be a good exercise reviewing the docs too. Travis-CI passed all tests for the branch I linked a few comments ago: https://travis-ci.org/kinow/cylc/builds/505560417 👍 Only missing documentation and approval from others @cylc/core then. |
On version string. If I am reading PEP440 correctly, we should do |
I agree with the proposed change. |
OK, I'll change my new "alpha" tag from 8.0.0-a0 to 8.0a0 (a1 will be the first actual alpha release for testing; a0 just marks(ish) where cylc-8 diverges from cylc-7). I suppose your preference for the short form (rather than 8.0.0a1) is because we're unlikely to ever make a an alpha preview of a bug-fix release? (e.g. 8.2.3a1) |
Yes. User base is not big enough for that! |
Cool! |
Hi!
As per the title, this issue is for the discussion of changing how Cylc version is currently stored and retrieved.
The problem
From what I understand, we have three places to look for the version:
cylc
shell script withcylc version
cylc.version.CYLC_VERSION
constant defined during the script load/importVERSION
file created bymake
and by a utility inetc/dev-bin/create-version-file
The behaviour at the moment is not consistent.
cylc version
uses a functionget_version
from thecylc
shell script. That function looks first atVERSION
file if existent, otherwise does agit describe --abbrev=4 --always
(plus -dirty suffix). If no version found, printsNo version is set, cylc must be built first. Aborting...
cylc.version.CYLC_VERSION
first looks atgit
usingetc/dev-bin/get-repo-version
script which usesgit describe --always --abbrev=4 --tags HEAD
(plus -dirty suffix). If no version found, then it looks for theVERSION
file. Finally, if still no version found, it returns "UNKNOWN".VERSION
file is created bymake
, using a utility which won't create the file if the directory contains the folder.git
. Otherwise gets the version from the parent directory name.Furthermore, Cylc's
profile-battery
command usescylc version
command twice, once to fetch the location of Cylc, and later to get its major version. There are a few I/O operations that could be saved, plus some code in thecylc.profiling
package to be reviewed.A possible solution
I have some working code, mixed with a possible fix for the
cylc.profiling
package (see #2991). My plan is to get this code, isolate what's related to the version part of Cylc, and then prepare a pull request.That would require to:
VERSION
filex.y.z-12345
is not parsed by setuptools without some extra hacking)lib/cylc/__init__.py
, creating__version__ = '8.0.0-a0
(as in the current git tag, or maybe8.0.a0
[would this one be equivalent to 8.0.0 alpha @matthewrmshin ?])VERSION
filecylc.version
module, replacing everything by something likeimport cylc.__version__ as CYLC_VERSION
or soRisks:
VERSION
file would have a different behaviour. Though that will change anyway once they use PYPI, Conda, RPM, virtualenv, etc.git
tag/commit when installing Cylc via PYPI, Anaconda, etc... but we can still add it back to the Web GUI, or even in the command line (just import thecylc.__version__
and append the git commit?)lib/cylc/__init__.py
. I think that's common among Python projects, and already in use inisodatetime
Thoughts?
Cheers
Bruno
The text was updated successfully, but these errors were encountered: