forked from renpy/pygame_sdl2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdistribute.py
executable file
·55 lines (43 loc) · 1.1 KB
/
distribute.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python
import argparse
import os
import glob
import tarfile
# A list of globs matching files to be included in the tarball.
GLOBS = [
"COPYING.*",
"fix_virtualenv.py",
"include/*.pxi",
"include/*.pxd",
"scripts/*.py",
"README.rst",
"sdl2.c",
"setuplib.py",
"setup.py",
"src/*.h",
"src/*.c",
"src/pygame_sdl2/*.h",
"src/pygame_sdl2/*.py",
"src/pygame_sdl2/*.pyx",
"src/pygame_sdl2/*.pxd",
"src/pygame_sdl2/threads/*.py",
]
def main():
ap = argparse.ArgumentParser()
ap.add_argument("version")
ap.add_argument("--dest", default='dist')
args = ap.parse_args()
os.chdir(os.path.dirname(os.path.abspath(__file__)))
files = set()
for pattern in GLOBS:
for fn in glob.glob(pattern):
files.add(fn)
files = list(files)
files.sort()
dest = os.path.join(args.dest, "pygame_sdl2-" + args.version + ".tar.bz2")
tf = tarfile.open(dest, "w:bz2")
for i in files:
tf.add(i, arcname="pygame-sdl2-" + args.version + "/" + i)
tf.close()
if __name__ == "__main__":
main()