-
Notifications
You must be signed in to change notification settings - Fork 383
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
Define fallback version string for non-git-aware shells #1111
Comments
Well I'm not sure why you use scm to define your version and not hardcode it into a file. Is there a reason? |
Setuptools_scm reads the "source code management" (here git) to deduce a version info. In git it reads the last tag in the form "vMajor.Minor.Patch...". Why someone wants to use it: you do not have to change a file and add a tag. The reason why pymeasure did it, I do not know, as it predates my participation. I guess it is the above mentioned reason. |
well it makes sense indeed, I think my particular case where i use git wrapped into github desktop (and not shell aware) is a bit particular to make a modification of the code for this. However a fallback version like 0.0.0 would be nice (it is actually what happens when I removed the setuptools_scm bits within the pyproject.toml for the installation to work) |
The original reason was a user request for a more accurate/precise version (e.g. when living on pymeasure master branch and working in notebooks, if I remember correctly). That we do not need to manually update some version file is an additional benefit. First, please check if this still occurs with setuptools_scm 8.1.0. Then, if we get a precise description of what is going wrong in the OP's case, maybe we can adapt the logic or call in https://github.com/pymeasure/pymeasure/blob/master/pymeasure/__init__.py#L30 to cover that case and fall into the fallback branch. |
Hello,
I actually run into another issue when trying to install from the cloned repository.
If you do so:
and if your shell is not aware of git (which was my case) then the installation complains it cannot find the version because it cannot find git. It troubled me for quite some time before I realized this. So if you install using pip the repo code (from a zip) of from a clone but with unaware git app, the installation will fail...
Originally posted by @seb5g in #893 (comment)
Should we define a fallback version for setuptools_scm?
According to pypa/setuptools-scm#549, the fallback is for authors (us), while the environment variable is for packages (or users).
The text was updated successfully, but these errors were encountered: