-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·59 lines (44 loc) · 1.29 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
import os
import sys
import subprocess
from contextlib import contextmanager
from distutils.core import setup, Command
@contextmanager
def chdir(d):
cwd= os.getcwd()
os.chdir(d)
try: yield
finally: os.chdir(cwd)
class ParrotCommand(Command):
description = 'proxy for a parrot distutils command'
user_options = []
path = 'objects'
command = ''
def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
with chdir(self.path):
proc = subprocess.Popen(
['winxed', '--nowarn', 'setup.winxed', self.command],
stdout=subprocess.PIPE)
print(proc.communicate()[0].decode(sys.getdefaultencoding()))
class ParrotBuild(ParrotCommand):
command = 'build'
class ParrotClean(ParrotCommand):
command = 'clean'
class ParrotTest(ParrotCommand):
command = 'test'
setup(
name = 'puffin',
packages = ['puffin'],
version = '0.0.0',
description = 'Python3 on Parrot',
author = 'Lucian Branescu Mihaila',
author_email = '[email protected]',
url = 'http://bitbucket.org/lucian1900/puffin',
cmdclass = {'buildp': ParrotBuild,
'cleanp': ParrotClean,
'testp': ParrotTest,
},
)