forked from karton/karton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
81 lines (70 loc) · 2.41 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Copyright (C) 2017 Marco Barisione
#
# Released under the terms of the GNU LGPL license version 2.1 or later.
import os
import sys
from distutils.core import setup
from karton import __version__
long_description = '''
Karton is a tool which can transparently run Linux programs on macOS,
a different Linux distro, or a different architecture.
To do this, you just need to tell Karton which distro to use, which
packages to install, and which directories to make accessible. This is
called an image.
Then you can run your commands inside the image just by adding
"karton run image-name" in front of your commands.
Underneath, Karton uses Docker to allow running programs and manage
semi-persistent containers.
'''.strip()
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers = [
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Environment :: MacOS X',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
]
config = {
# Info about the package:
'name': 'karton',
'description': 'Run Linux programs on macOS, a different Linux distro, or a different architecture',
'long_description': long_description,
'version': __version__,
'author': 'Marco Barisione',
'author_email': '[email protected]',
'url': 'https://github.com/karton/karton',
'download_url': 'https://github.com/karton/karton',
'license': 'LPGL 2.1 or later',
'platforms': ['Linux', 'macOS'],
'classifiers': classifiers,
# Installation stuff:
'packages': ['karton'],
'scripts': ['scripts/karton'],
'package_data': {
'': [
'container-code/command_runner.py',
'container-code/session_runner.py',
],
},
}
can_run = False
try:
with open('MANIFEST.in') as manifest_in_file:
first_line = manifest_in_file.readline().strip()
if first_line == '# This file was generated by Makefile.':
can_run = True
except:
pass
if can_run:
setup(**config)
else:
sys.stderr.write(
'No MANIFEST.in found (or it\'s invalid).\n'
'Try running "make MANIFEST.in" first.\n')
raise SystemExit(1)