|
25 | 25 | include doc/*
|
26 | 26 | include pcbasic/data/USAGE.txt
|
27 | 27 | include pcbasic/data/*/*
|
28 |
| -prune test |
29 | 28 | """
|
30 | 29 | #
|
31 | 30 | HERE = os.path.abspath(os.path.dirname(__file__))
|
@@ -73,24 +72,45 @@ def run(self):
|
73 | 72 | f.write(
|
74 | 73 | 'include pcbasic/lib/README.md\n'
|
75 | 74 | 'include pcbasic/compat/*.c\n'
|
| 75 | + 'prune test\n' |
76 | 76 | )
|
77 | 77 | self.run_command('build_docs')
|
78 | 78 | sdist.sdist.run(self)
|
79 | 79 | os.remove(os.path.join(HERE, 'MANIFEST.in'))
|
80 | 80 |
|
81 | 81 |
|
| 82 | +class SDistDevCommand(sdist.sdist): |
| 83 | + """Custom sdist_dev command.""" |
| 84 | + |
| 85 | + def run(self): |
| 86 | + """Run sdist_dev command.""" |
| 87 | + with open(os.path.join(HERE, 'MANIFEST.in'), 'w') as f: |
| 88 | + f.write(DUNMANIFESTIN) |
| 89 | + f.write( |
| 90 | + 'include pcbasic/lib/*\n' |
| 91 | + 'include pcbasic/lib/*/*\n' |
| 92 | + 'include pcbasic/compat/*.c\n' |
| 93 | + 'recursive-include test *' |
| 94 | + ) |
| 95 | + self.run_command('build_docs') |
| 96 | + sdist.sdist.run(self) |
| 97 | + os.remove(os.path.join(HERE, 'MANIFEST.in')) |
| 98 | + |
82 | 99 |
|
83 | 100 | class BuildPyCommand(build_py.build_py):
|
84 | 101 | """Custom build_py command."""
|
85 | 102 |
|
86 | 103 | def run(self):
|
87 |
| - """ Run sdist command. """ |
88 |
| - print 'writing manifest' |
| 104 | + """Run build_py command.""" |
89 | 105 | with open(os.path.join(HERE, 'MANIFEST.in'), 'w') as f:
|
90 | 106 | f.write(DUNMANIFESTIN)
|
| 107 | + f.write('prune test\n') |
91 | 108 | # include DLLs on Windows
|
92 | 109 | if sys.platform == 'win32':
|
93 |
| - f.write('include pcbasic/lib/*.dll\n') |
| 110 | + if platform.architecture()[0] == '64bit': |
| 111 | + f.write('include pcbasic/lib/win32_x64/*.dll\n') |
| 112 | + else: |
| 113 | + f.write('include pcbasic/lib/win32_x86/*.dll\n') |
94 | 114 | build_py.build_py.run(self)
|
95 | 115 | os.remove(os.path.join(HERE, 'MANIFEST.in'))
|
96 | 116 |
|
@@ -186,6 +206,7 @@ def run(self):
|
186 | 206 | cmdclass={
|
187 | 207 | 'build_docs': BuildDocCommand,
|
188 | 208 | 'sdist': SDistCommand,
|
| 209 | + 'sdist_dev': SDistDevCommand, |
189 | 210 | 'build_py': BuildPyCommand,
|
190 | 211 | },
|
191 | 212 |
|
|
0 commit comments