forked from niklasb/webkit-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
39 lines (35 loc) · 1.13 KB
/
setup.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
from distutils.core import setup, Command
from distutils.command.build import build as _build
import os, sys
import shutil
class build(_build):
sub_commands = _build.sub_commands + [('build_server', lambda self: True)]
class build_server(Command):
description = 'custom build command'
user_options = []
def initialize_options(self):
self.cwd = None
def finalize_options(self):
self.cwd = os.getcwd()
def run(self):
if os.environ.get('READTHEDOCS', None) == 'True':
# won't build on readthedocs.org
return
assert os.getcwd() == self.cwd, 'Must be in package root.'
os.system('qmake && make')
try:
os.remove('build/lib/webkit_server')
except: pass
shutil.move('src/webkit_server', 'build/lib')
setup(name='webkit-server',
version='0.8',
description='a Webkit-based, headless browser instance',
author='Niklas Baumstark',
author_email='[email protected]',
license='MIT',
url='https://github.com/niklasb/webkit-server',
py_modules=['webkit_server'],
cmdclass={
'build': build,
'build_server': build_server,
})