setuptools_scm icon indicating copy to clipboard operation
setuptools_scm copied to clipboard

question about GitWorkdir.is_dirty

Open j3mdamas opened this issue 3 years ago • 8 comments
trafficstars

Hello,

First of all, thanks for this project. I think that taking versions from the VCS is an essential feature.

I was doing some experiments, specially using editable pip installs (but it applies to normal installs as well), and I saw that when one installs from a source repository that has untracked files, the release version in "clean". I saw that this was encoded on purpose by adding --untracked-files=no to the porcelain command. What is the reason behind this? If I have an untracked file called foo.py in my source directory, that file is present on the installed package (i.e., in site-packages) so in practice that install is not version x.y.z, but x.y.z-dirty. Perhaps I am missing something.

Thanks in advance, João

j3mdamas avatar Nov 03 '22 15:11 j3mdamas

i beleivethis is a potential oversight for accounting of version files

RonnyPfannschmidt avatar Nov 03 '22 15:11 RonnyPfannschmidt

I think the fix would be to remove the --untracked-files=no from that function, but I don't have the overview to see what other possible impacts.

j3mdamas avatar Nov 03 '22 16:11 j3mdamas

i did some digging, it was added to be in line with git describe

more work is needed to determine where to add this

RonnyPfannschmidt avatar Nov 03 '22 16:11 RonnyPfannschmidt

I see. It is true that, if the term "dirty" is taken from the git describe, it does not account for untracked files. But I believe the automatic version generation should have a way to account for the untracked files as well, since in fact they go with the installation, even if the term should be something else.

j3mdamas avatar Nov 03 '22 17:11 j3mdamas

In that case, we cannot use git describe as is anyway

So more investigation is required before changing

RonnyPfannschmidt avatar Nov 03 '22 17:11 RonnyPfannschmidt

Sure, makes sense. I may be able to contribute about this in the future if that's an option.

j3mdamas avatar Nov 04 '22 11:11 j3mdamas

sure, i wont be able to work on this soonish

RonnyPfannschmidt avatar Nov 04 '22 16:11 RonnyPfannschmidt

Hi, Please feel free to close if you think it's the best. I've changed from setuptools_scm to bumpver and I'll focus more on that tool. Thank you for the feedback to my question, João

j3mdamas avatar Mar 21 '23 12:03 j3mdamas