__pkginfo__ should not raise exception even when cwd has a _narval subdirectory draft
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 22 Nov 2016 10:44:19 +0100
changeset 1866 48313facded8
parent 1859 b604269e3d23
child 1867 a3860aa1e1e0
__pkginfo__ should not raise exception even when cwd has a _narval subdirectory
__pkginfo__.py
setup.py
--- a/__pkginfo__.py	Tue Jan 05 17:00:15 2016 +0100
+++ b/__pkginfo__.py	Tue Nov 22 10:44:19 2016 +0100
@@ -58,7 +58,7 @@
 # Note: here, you'll need to add subdirectories if you want
 # them to be included in the debian package
 
-NARVALDIR = '_narval'
+NARVALDIR = join(dirname(__file__), '_narval')
 if isdir(NARVALDIR): # test REQUIRED (to be importable from everywhere)
     data_files.append([join('share', 'narval', 'checkers'),
                        listdir(join(NARVALDIR, 'checkers'))])
--- a/setup.py	Tue Jan 05 17:00:15 2016 +0100
+++ b/setup.py	Tue Nov 22 10:44:19 2016 +0100
@@ -25,7 +25,7 @@
 # see https://packaging.python.org/en/latest/single_source_version.html
 base_dir = dirname(__file__)
 
-pkginfo = {}
+pkginfo = {'__file__': join(base_dir, '__pkginfo__.py')}
 with open(join(base_dir, "__pkginfo__.py")) as f:
     exec(f.read(), pkginfo)
 # get required metadatas