File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ def parse(root, describe_command=DEFAULT_DESCRIBE):
25
25
count = revs .count ('\n ' )
26
26
if ret :
27
27
out = rev_node
28
- return meta ('0.0' , distance = count + 1 , node = out )
28
+ git_dirt = do ('git describe --always --dirty' )
29
+ return meta (
30
+ '0.0' ,
31
+ distance = count + 1 ,
32
+ node = out ,
33
+ dirty = git_dirt .endswith ('-dirty' ),
34
+ )
29
35
if ret :
30
36
return
31
37
dirty = out .endswith ('-dirty' )
Original file line number Diff line number Diff line change 1
1
from setuptools_scm import integration
2
2
import pytest
3
+ from datetime import date
3
4
4
5
5
6
@pytest .fixture
@@ -32,6 +33,17 @@ def test_version_from_git(wd):
32
33
assert wd .version .startswith ('0.2' )
33
34
34
35
36
+ @pytest .mark .issue (86 )
37
+ def test_git_dirty_notag (wd ):
38
+ wd .commit_testfile ()
39
+ wd .write ('test.txt' , 'test2' )
40
+ wd ("git add test.txt" )
41
+ assert wd .version .startswith ('0.1.dev1' )
42
+ today = date .today ()
43
+ # we are dirty, check for the tag
44
+ assert today .strftime ('.d%Y%m%d' ) in wd .version
45
+
46
+
35
47
def test_find_files_stop_at_root_git (wd ):
36
48
wd .commit_testfile ()
37
49
wd .cwd .ensure ('project/setup.cfg' )
You can’t perform that action at this time.
0 commit comments