Skip to content

Commit c7f49fc

Browse files
committed
package also CHANGELOG.md; use new mechanism for packaging data directories
1 parent 1fc2981 commit c7f49fc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

setup.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,16 @@ def ext_math(extName):
104104
)
105105

106106
# http://stackoverflow.com/questions/13628979/setuptools-how-to-make-package-contain-extra-data-folder-and-all-folders-inside
107-
datadir = "examples"
108-
datafiles = [(root, [os.path.join(root, f) for f in files if f.endswith(".py")])
109-
for root, dirs, files in os.walk(datadir)]
107+
datadirs = ("examples",)
108+
dataexts = (".py", ".pyx", ".pxd", ".c", ".sh", ".lyx", ".pdf")
109+
datafiles = []
110+
getext = lambda filename: os.path.splitext(filename)[1]
111+
for datadir in datadirs:
112+
datafiles.extend( [(root, [os.path.join(root, f) for f in files if getext(f) in dataexts])
113+
for root, dirs, files in os.walk(datadir)] )
114+
115+
datafiles.append( ('.', ["README.md", "LICENSE.md", "TODO.md", "CHANGELOG.md"]) )
110116

111-
datafiles.append( ('.', ["README.md", "LICENSE.md", "TODO.md"]) )
112117

113118
#########################################################
114119
# Utility modules

0 commit comments

Comments
 (0)