precice / fenics-adapter

preCICE-adapter for the open source computing platform FEniCS
GNU Lesser General Public License v3.0
29 stars 15 forks source link

Use versioneer for __version__ #106

Closed BenjaminRodenberg closed 3 years ago

BenjaminRodenberg commented 3 years ago

Closes #105.

BenjaminRodenberg commented 3 years ago

@IshaanDesai You can check the version via python3 setup.py version, but also after installation of the module using pip3 via pip3 show fenicsprecice. And, of course, using python3 -c "import fenicsprecice; print(fenicsprecice.__version__).

BenjaminRodenberg commented 3 years ago

Reply to @IshaanDesai, https://github.com/precice/fenics-adapter/pull/106#pullrequestreview-536064253

Is the UserWarning relevant? Can it somehow be avoided?

I think the UserWarning is due to the leading v in v0.2+46.g828c874, since this is how we tag our releases v0.2. I would suggest to ignore this warning, since we are using the same tagging in preCICE and the python-bindings, as well.

Using pip3 show fenicsprecice and python3 -c "import fenicsprecice; print(fenicsprecice.__version__)" the version number is: v0.2+46.g828c874. I understand that the later part of the number is picked from the latest commit of the adapter being installed. Is this necessary?

This addiitonal part only shows up, if you install a version that is not tagged. If you install a tagged version (i.e. git tag v0.3; python3 setup.py version;) the version is only v0.3. Additionally it indicates whether your working state is dirty. I think this is a quite useful feature, since it always shows you what you are using on your system.

Note: Don't forget to delete the tag (git tag -d v0.3).