comparison setup.py @ 545:067d3d80ff2e

Sort out setup.py imports, use find_packages()
author Stefano Rivera <stefano@rivera.za.net>
date Sun, 10 Apr 2011 00:41:43 +0200
parents 4e8be9c52952
children 366e58e8d057
comparison
equal deleted inserted replaced
544:badc218d1eba 545:067d3d80ff2e
1 import os
2
3 # usage: python setup.py command 1 # usage: python setup.py command
4 # 2 #
5 # sdist - build a source dist 3 # sdist - build a source dist
6 # py2exe - build an exe 4 # py2exe - build an exe
7 # py2app - build an app 5 # py2app - build an app
8 # cx_freeze - build a linux binary (not implemented) 6 # cx_freeze - build a linux binary (not implemented)
9 # 7 #
10 # the goods are placed in the dist dir for you to .zip up or whatever... 8 # the goods are placed in the dist dir for you to .zip up or whatever...
9
10 import glob
11 import os
12 import shutil
13 import sys
14
15 from setuptools import setup, find_packages, Extension
16 try:
17 import py2exe
18 except:
19 pass
20
11 21
12 22
13 APP_NAME = 'skaapsteker' 23 APP_NAME = 'skaapsteker'
14 DESCRIPTION = open('README.txt').read() 24 DESCRIPTION = open('README.txt').read()
15 CHANGES = open('CHANGES.txt').read() 25 CHANGES = open('CHANGES.txt').read()
67 77
68 78
69 cmdclass = {} 79 cmdclass = {}
70 PACKAGEDATA = { 80 PACKAGEDATA = {
71 'cmdclass': cmdclass, 81 'cmdclass': cmdclass,
72 82 'packages': find_packages(),
73 'package_dir': {'skaapsteker': 'skaapsteker',
74 },
75 'packages': ['skaapsteker',
76 ],
77 'scripts': ['scripts/skaapsteker'], 83 'scripts': ['scripts/skaapsteker'],
78 } 84 }
79 85
80 PACKAGEDATA.update(METADATA) 86 PACKAGEDATA.update(METADATA)
81 87
82
83 from distutils.core import setup, Extension
84 try:
85 import py2exe
86 except:
87 pass
88
89 import sys
90 import glob
91 import os
92 import shutil
93 88
94 try: 89 try:
95 cmd = sys.argv[1] 90 cmd = sys.argv[1]
96 except IndexError: 91 except IndexError:
97 print 'Usage: setup.py install|py2exe|py2app|cx_freeze' 92 print 'Usage: setup.py install|py2exe|py2app|cx_freeze'
173 168
174 # build the py2app target 169 # build the py2app target
175 if cmd == 'py2app': 170 if cmd == 'py2app':
176 dist_dir = os.path.join('dist',METADATA['py2app.target']+'.app') 171 dist_dir = os.path.join('dist',METADATA['py2app.target']+'.app')
177 data_dir = os.path.join(dist_dir,'Contents','Resources') 172 data_dir = os.path.join(dist_dir,'Contents','Resources')
178 from setuptools import setup
179 173
180 src = 'run_game.py' 174 src = 'run_game.py'
181 dest = METADATA['py2app.target']+'.py' 175 dest = METADATA['py2app.target']+'.py'
182 shutil.copy(src,dest) 176 shutil.copy(src,dest)
183 177