forked from cms-dev/cms
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·210 lines (197 loc) · 8.63 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
#!/usr/bin/env python3
# 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.
"""
import os
import re
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py
PACKAGE_DATA = {
"cms.server": [
"static/*.*",
"static/jq/*.*",
"admin/static/*.*",
"admin/static/jq/*.*",
"admin/static/sh/*.*",
"admin/templates/*.*",
"admin/templates/fragments/*.*",
"admin/templates/macro/*.*",
"contest/static/*.*",
"contest/static/css/*.*",
"contest/static/img/*.*",
"contest/static/img/mimetypes/*.*",
"contest/static/js/*.*",
"contest/templates/*.*",
"contest/templates/macro/*.*",
],
"cms.service": [
"templates/printing/*.*",
],
"cms.locale": [
"*/LC_MESSAGES/*.*",
],
"cmsranking": [
"static/img/*.*",
"static/lib/*.*",
"static/*.*",
],
"cmstestsuite": [
"code/*.*",
"tasks/batch_stdio/data/*.*",
"tasks/batch_fileio/data/*.*",
"tasks/batch_fileio_managed/code/*",
"tasks/batch_fileio_managed/data/*.*",
"tasks/communication_fifoio_stubbed/code/*",
"tasks/communication_fifoio_stubbed/data/*.*",
"tasks/communication_many_fifoio_stubbed/code/*",
"tasks/communication_many_fifoio_stubbed/data/*.*",
"tasks/communication_many_stdio_stubbed/code/*",
"tasks/communication_many_stdio_stubbed/data/*.*",
"tasks/communication_stdio/code/*",
"tasks/communication_stdio/data/*.*",
"tasks/communication_stdio_stubbed/code/*",
"tasks/communication_stdio_stubbed/data/*.*",
"tasks/outputonly/data/*.*",
"tasks/outputonly_comparator/code/*",
"tasks/outputonly_comparator/data/*.*",
"tasks/twosteps/code/*.*",
"tasks/twosteps/data/*.*",
"tasks/twosteps_comparator/code/*",
"tasks/twosteps_comparator/data/*.*",
],
}
def find_version():
"""Return the version string obtained from cms/__init__.py"""
path = os.path.join("cms", "__init__.py")
with open(path, "rt", encoding="utf-8") as f:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
f.read(), 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")
# The build command of distutils/setuptools searches the tree
# and compiles a list of data files before run() is called and
# then stores that value. Hence we need to refresh it.
self.data_files = self._get_data_files()
super().run()
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",
"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",
"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",
"Notice=cms.grading.tasktypes.Notice:Notice",
],
"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",
],
"cms.grading.languages": [
"C++11 / g++=cms.grading.languages.cpp11_gpp:Cpp11Gpp",
"C++14 / g++=cms.grading.languages.cpp14_gpp:Cpp14Gpp",
"C++17 / g++=cms.grading.languages.cpp17_gpp:Cpp17Gpp",
"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 / 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 :: 3.8",
"License :: OSI Approved :: "
"GNU Affero General Public License v3",
]
)