This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 284
/
setup.py
executable file
·142 lines (123 loc) · 4.37 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env python
import sys
from setuptools import setup
from setuptools_rust import Binding, RustExtension
from setup_util.setup_commons import (
path, parse_requirements, get_version,
get_long_description, find_required_packages, PyInstaller,
move_wheel, print_errors, DatabaseMigration)
from golem.docker.manager import DockerManager
from golem.tools.ci import in_appveyor, in_travis
building_wheel = 'bdist_wheel' in sys.argv
building_binary = 'pyinstaller' in sys.argv
building_migration = 'migration' in sys.argv
directory = path.abspath(path.dirname(__file__))
requirements, dependencies = parse_requirements(directory)
setup(
name='golem',
version=get_version(),
platforms=sys.platform,
description='Global, open sourced, decentralized supercomputer',
long_description=get_long_description(directory),
url='https://golem.network',
author='Golem Team',
author_email='contact@golem.network',
license="GPL-3.0",
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Programming Language :: Python :: 3.6',
],
zip_safe=False,
keywords='golem',
packages=find_required_packages(),
install_requires=requirements,
dependency_links=dependencies,
include_package_data=True,
cmdclass={
'pyinstaller': PyInstaller,
'migration': DatabaseMigration
},
entry_points={
'gui_scripts': [
'golemapp = golemapp:start',
],
},
rust_extensions=[
RustExtension(
'rust.golem',
'rust/golem/Cargo.toml',
binding=Binding.RustCPython,
debug=False,
),
],
data_files=[
(path.normpath('../../'), [
'golemapp.py', 'loggingconfig.py'
]),
(path.normpath('../../golem/'), [
path.normpath('golem/CONCENT_TERMS.html'),
]),
(path.normpath('../../golem/'), [
path.normpath('golem/TERMS.html'),
]),
(path.normpath('../../golem/apps'), [
path.normpath('apps/registered.ini'),
path.normpath('apps/registered_test.ini'),
path.normpath('apps/images.ini')
]),
(path.normpath(
'../../golem/golem/envs/docker/benchmark/cpu/minilight'), [
path.normpath(
'golem/envs/docker/benchmark/cpu/minilight/cornellbox.ml.txt'),
]),
(path.normpath(
'../../golem/apps/blender/resources/images/entrypoints/scripts/'
'render_tools/templates'), [
path.normpath(
'apps/blender/resources/images/entrypoints/'
'scripts/render_tools/templates/blendercrop.py.template')]
),
(path.normpath('../../golem/apps/dummy/resources/code_dir'), [
path.normpath('apps/dummy/resources/code_dir/computing.py')
]),
(path.normpath('../../golem/apps/dummy/test_data'), [
path.normpath('apps/dummy/test_data/in.data')
]),
(path.normpath('../../golem/network/concent/resources/ssl/certs'), [
path.normpath('golem/network/concent/resources/ssl/certs/test.crt'),
]),
]
)
if not (in_appveyor() or in_travis() or
building_wheel or building_binary):
docker_manager = DockerManager()
try:
DockerManager().pull_images()
except Exception as exc: # pylint: disable=broad-except
print('Exception occurred:', exc)
DockerManager().build_images()
if building_wheel:
move_wheel()
if not building_migration:
from golem.database.migration.create import latest_migration_exists
if not latest_migration_exists():
raise RuntimeError("Database schema error: latest migration script "
"does not exist")
# test a potential docker package conflict
def _docker_conflict(e: Exception):
raise RuntimeError(
"Suspected conflict in python `docker` library.\n"
"Please run `pip uninstall -y docker docker-py` "
"and re-install golem's requirements. "
) from e
try:
from docker import DockerClient as Client
except ImportError as import_error:
_docker_conflict(import_error)
try:
Client().api
except TypeError as type_error:
_docker_conflict(type_error)