-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·213 lines (199 loc) · 9.32 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Contest Management System - http://cms-dev.github.io/
# Copyright © 2010-2013 Giovanni Mascellani <[email protected]>
# Copyright © 2010-2018 Stefano Maggiolo <[email protected]>
# Copyright © 2010-2012 Matteo Boscariol <[email protected]>
# Copyright © 2013 Luca Wehrstedt <[email protected]>
# Copyright © 2014 Artem Iglikov <[email protected]>
# Copyright © 2015 William Di Luigi <[email protected]>
# Copyright © 2016 Myungwoo Chun <[email protected]>
# Copyright © 2016 Masaki Hara <[email protected]>
# Copyright © 2016 Peyman Jabbarzade Ganje <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Build and installation routines for CMS.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# setuptools doesn't seem to like this:
# from __future__ import unicode_literals
from future.builtins.disabled import * # noqa
from future.builtins import * # noqa
import io
import re
import os
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py
PACKAGE_DATA = {
"cms.server": [
os.path.join("static", "*.*"),
os.path.join("static", "jq", "*.*"),
os.path.join("admin", "static", "*.*"),
os.path.join("admin", "static", "jq", "*.*"),
os.path.join("admin", "static", "sh", "*.*"),
os.path.join("admin", "templates", "*.*"),
os.path.join("admin", "templates", "fragments", "*.*"),
os.path.join("admin", "templates", "views", "*.*"),
os.path.join("contest", "static", "*.*"),
os.path.join("contest", "static", "css", "*.*"),
os.path.join("contest", "static", "img", "*.*"),
os.path.join("contest", "static", "img", "mimetypes", "*.*"),
os.path.join("contest", "static", "js", "*.*"),
os.path.join("contest", "templates", "*.*"),
],
"cms.service": [
os.path.join("templates", "printing", "*.*"),
],
"cms.locale": [
os.path.join("*", "LC_MESSAGES", "*.*"),
],
"cmsranking": [
os.path.join("static", "img", "*.*"),
os.path.join("static", "lib", "*.*"),
os.path.join("static", "*.*"),
],
"cmstestsuite": [
os.path.join("code", "*.*"),
os.path.join("tasks", "batch_stdio", "data", "*.*"),
os.path.join("tasks", "batch_fileio", "data", "*.*"),
os.path.join("tasks", "batch_fileio_managed", "code", "*"),
os.path.join("tasks", "batch_fileio_managed", "data", "*.*"),
os.path.join("tasks", "communication", "code", "*"),
os.path.join("tasks", "communication", "data", "*.*"),
os.path.join("tasks", "communication2", "code", "*"),
os.path.join("tasks", "communication2", "data", "*.*"),
os.path.join("tasks", "outputonly", "data", "*.*"),
os.path.join("tasks", "outputonly_comparator", "code", "*"),
os.path.join("tasks", "outputonly_comparator", "data", "*.*"),
os.path.join("tasks", "twosteps", "code", "*.*"),
os.path.join("tasks", "twosteps", "data", "*.*"),
os.path.join("tasks", "twosteps_comparator", "code", "*"),
os.path.join("tasks", "twosteps_comparator", "data", "*.*"),
],
}
def find_version():
"""Return the version string obtained from cms/__init__.py"""
path = os.path.join("cms", "__init__.py")
version_file = io.open(path, "rt", encoding="utf-8").read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match is not None:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
# We piggyback the translation catalogs compilation onto build_py since
# the po and mofiles will be part of the package data for cms.locale,
# which is collected at this stage.
class build_py_and_l10n(build_py):
def run(self):
self.run_command("compile_catalog")
# Can't use super here as in Py2 it isn't a new-style class.
build_py.run(self)
setup(
name="cms",
version=find_version(),
author="The CMS development team",
author_email="[email protected]",
url="https://github.com/cms-dev/cms",
download_url="https://github.com/cms-dev/cms/archive/master.tar.gz",
description="A contest management system and grader "
"for IOI-like programming competitions",
packages=find_packages(),
package_data=PACKAGE_DATA,
cmdclass={"build_py": build_py_and_l10n},
scripts=["scripts/cmsLogService",
"scripts/cmsScoringService",
"scripts/cmsEvaluationService",
"scripts/cmsWorker",
"scripts/cmsResourceService",
"scripts/cmsChecker",
"scripts/cmsContestWebServer",
"scripts/cmsAdminWebServer",
"scripts/cmsProxyService",
"scripts/cmsPrintingService",
"scripts/cmsRankingWebServer",
"scripts/cmsInitDB",
"scripts/cmsDropDB"],
entry_points={
"console_scripts": [
"cmsRunTests=cmstestsuite.RunTests:main",
"cmsAddAdmin=cmscontrib.AddAdmin:main",
"cmsAddParticipation=cmscontrib.AddParticipation:main",
"cmsAddStatement=cmscontrib.AddStatement:main",
"cmsAddSubmission=cmscontrib.AddSubmission:main",
"cmsAddTeam=cmscontrib.AddTeam:main",
"cmsAddTestcases=cmscontrib.AddTestcases:main",
"cmsAddUser=cmscontrib.AddUser:main",
"cmsCleanFiles=cmscontrib.CleanFiles:main",
"cmsComputeComplexity=cmscontrib.ComputeComplexity:main",
"cmsDumpExporter=cmscontrib.DumpExporter:main",
"cmsDumpImporter=cmscontrib.DumpImporter:main",
"cmsDumpUpdater=cmscontrib.DumpUpdater:main",
"cmsExportSubmissions=cmscontrib.ExportSubmissions:main",
"cmsImportContest=cmscontrib.ImportContest:main",
"cmsImportDataset=cmscontrib.ImportDataset:main",
"cmsImportTask=cmscontrib.ImportTask:main",
"cmsImportTeam=cmscontrib.ImportTeam:main",
"cmsImportUser=cmscontrib.ImportUser:main",
"cmsRWSHelper=cmscontrib.RWSHelper:main",
"cmsRemoveContest=cmscontrib.RemoveContest:main",
"cmsRemoveParticipation=cmscontrib.RemoveParticipation:main",
"cmsRemoveStatement=cmscontrib.RemoveStatement:main",
"cmsRemoveSubmissions=cmscontrib.RemoveSubmissions:main",
"cmsRemoveTask=cmscontrib.RemoveTask:main",
"cmsRemoveUser=cmscontrib.RemoveUser:main",
"cmsSpoolExporter=cmscontrib.SpoolExporter:main",
"cmsMake=cmstaskenv.cmsMake:main",
],
"cms.grading.tasktypes": [
"Batch=cms.grading.tasktypes.Batch:Batch",
"Communication=cms.grading.tasktypes.Communication:Communication",
"OutputOnly=cms.grading.tasktypes.OutputOnly:OutputOnly",
"TwoSteps=cms.grading.tasktypes.TwoSteps:TwoSteps",
],
"cms.grading.scoretypes": [
"Sum=cms.grading.scoretypes.Sum:Sum",
"GroupMin=cms.grading.scoretypes.GroupMin:GroupMin",
"GroupMul=cms.grading.scoretypes.GroupMul:GroupMul",
"GroupThreshold=cms.grading.scoretypes.GroupThreshold:GroupThreshold",
"GroupMinTruncation=cms.grading.scoretypes.GroupMinTruncation:GroupMinTruncation",
],
"cms.grading.languages": [
"C++14 / g++=cms.grading.languages.cpp14_gpp:Cpp14Gpp",
"C++11 / g++=cms.grading.languages.cpp11_gpp:Cpp11Gpp",
"C11 / gcc=cms.grading.languages.c11_gcc:C11Gcc",
"C# / Mono=cms.grading.languages.csharp_mono:CSharpMono",
"Haskell / ghc=cms.grading.languages.haskell_ghc:HaskellGhc",
"Java 1.4 / gcj=cms.grading.languages.java14_gcj:Java14Gcj",
"Java / JDK=cms.grading.languages.java_jdk:JavaJDK",
"Pascal / fpc=cms.grading.languages.pascal_fpc:PascalFpc",
"PHP=cms.grading.languages.php:Php",
"Python 2 / CPython=cms.grading.languages.python2_cpython:Python2CPython",
"Python 3 / CPython=cms.grading.languages.python3_cpython:Python3CPython",
"Rust=cms.grading.languages.rust:Rust",
],
},
keywords="ioi programming contest grader management system",
license="Affero General Public License v3",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: "
"GNU Affero General Public License v3",
]
)