Closed thebaptiste closed 1 year ago
My initial thinking on this is that we should stop trying to use setuptools-git-versioning and rely on a hard-coded version string like the starting_version that is already in pyproject.toml. The starting_version string is supposed to be a fall-back, but that fall-back doesn't appear to work robustly so I wonder if we should just stop trying to get the version dynamically and always use this hard-coded string. I think our nightly ESMPy testing would detect if we've forgotten to update that hard-coded string.
I'm not positive, but I think that using the version from esmf.mk wouldn't be as robust, in that you might be inadvertently pointing to an ESMF build from a different ESMF version than the one from which you're installing ESMPy: I think the current logic would detect that but using a version from esmf.mk would not.
What do others think about this?
@billsacks I wonder, do we understand why it is that "that fall-back doesn't appear to work robustly"? I agree it does seem to have issues, but I don't understand enough about the implemented mechanism to say what is causing it, or how it could be fixed. In general though, I like the idea of trying to figure out the version from Git if possible, and if not have a fall-back. In a way that is what we do on the ESMF library side. That said, I am open to a simpler solution if it is more robust. It would be nice to hear from @rokuingh for his thoughts on this, too.
I don't understand it, but @rokuingh and I found that it wasn't working (at least on my Mac) when there were problems with a different scenario - problems installing setuptools-git-versioning. I do agree that getting the version from git is nice in that it gives more fine-grained version info; the main downside I see (besides possible added complexity) is that it means that our testing isn't covering this fall-back (unless we add a test that specifically tests this fall-back mechanism).
We have been unable to reproduce this issue: Our Docker container is built using the tarball and has no problems installing ESMPy in this usage (see https://github.com/esmf-org/esmf-containers/blob/feature/esmf-buildenv/esmf-build-release/linux-ubuntu/Dockerfile#L52). I also just tried a local build & install of ESMF and ESMPy on my Mac from the 8.4.0 tarball (using python 3.10.7, pip 22.3 and setuptools-git-versioning 1.12.0) and had no problems: the ESMPy installation correctly picked up this version info from pyproject.toml:
starting_version = "8.4.0" # this is a backup for pip <= 22.0 where git-versioning doesn't work
Since we can't reproduce this issue here, I'm going to close it. If you need further support, please reach out to esmf_support@ucar.edu and include any details you think would be helpful for us to be able to reproduce your issue. However, our lead ESMPy developer is on leave so we may not be able to give a quick reply.
Hello I'm trying to pip install esmf 8.4.0 with the tar.gz file, I mean not using git. It doesn't work, I have this error :
My esmf.mk file starts with (see ESMF_VERSION_STRING and ESMF_VERSION_STRING_GIT)
I'm on python 3.10.7 with pip 22.2.2
I think pyproject.toml is not ok for an usage without git, it can't set the version. May be it should use in this case ESMF_VERSION_STRING in esmf.mk. It would be great that both usages with and without git work.
Regards