Skip to content

Commit 79da73e

Browse files
committed
REL: exclude gitarchive.cfg from package files
- move gitarchive.cfg to repository root - exclude it from source distribution tarball - exclude it from installation with package data - fix test for expanded .gitarchive.cfg in setup.py
1 parent 1bfbfa4 commit 79da73e

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
/.travis.yml export-ignore
44
/conda-recipe/ export-ignore
55
/devutils export-ignore
6-
gitarchive.cfg export-subst
6+
.gitarchive.cfg export-subst

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ recursive-exclude doc/manual Makefile *.py *.texinfo
99
recursive-exclude doc/manual *.aux *.cp *.cps *.err *.log *.toc *.vr *.vrs
1010
recursive-include icons *.png *.ico
1111
recursive-exclude icons *.m *.xcf
12-
global-exclude .gitattributes .gitignore .DS_Store
12+
global-exclude .gitattributes .gitignore .gitarchive.cfg
13+
global-exclude .DS_Store
1314

1415
# Avoid user content in setup.cfg to make distribution reproducible.
1516
exclude setup.cfg

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# It must reside in the same directory as version.py.
2020
MYDIR = os.path.dirname(os.path.abspath(__file__))
2121
versioncfgfile = os.path.join(MYDIR, 'src/diffpy/pdfgui/version.cfg')
22-
gitarchivecfgfile = versioncfgfile.replace('version.cfg', 'gitarchive.cfg')
22+
gitarchivecfgfile = os.path.join(MYDIR, '.gitarchive.cfg')
2323

2424
def gitinfo():
2525
from subprocess import Popen, PIPE
@@ -42,7 +42,7 @@ def getversioncfg():
4242
g = vd0.copy()
4343
cp0 = RawConfigParser(vd0)
4444
cp0.read(gitarchivecfgfile)
45-
if '$Format:' not in cp0.get('DEFAULT', 'commit'):
45+
if len(cp0.get('DEFAULT', 'commit')) > 20:
4646
g = cp0.defaults()
4747
mx = re.search(r'\btag: v(\d[^,]*)', g.pop('refnames'))
4848
if mx:

0 commit comments

Comments
 (0)