You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+27-11
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,28 @@
1
1
# Contributing and pull request process
2
2
3
-
To contribute, please send an email to contestms-discuss@googlegroups.com, or ping us on gitter with what you plan to do (unless uncontroversial and/or small), so that we can agree on the best way to implement it.
4
-
5
-
We appreciate small commits that do one thing, but also that, when possible, each commit doesn't break the master branch. Please use your best judgement for the size of the commit according to these guidelines. If a commit breaks master, we at least require to push together all commits until master is fixed.
6
-
7
-
We also appreciate a tidy history, so after you write all your code, consider tidying up the commits to reflect what you did at the end, which is usually a simplified version of the process that you followed to reach the final state. Moreover, each commit should not have PEP 8 or pyflakes warnings (see below for how to make sure you don't introduce any).
8
-
9
-
If your change involves more than one commit, please create a PR for each of them, unless for very small and obvious commits (read: fixing typos, comments, a few obvious lines), or unless some commit breaks master.
10
-
11
-
During the review, please address all comments by creating one or more 'fixup' commits on top of the branch (no forced push). At the end, either you or one of the owners can squash appropriately the fixups.
3
+
To contribute, please send an email to contestms-discuss@googlegroups.com, or
4
+
ping us on [Telegram](https://t.me/contestms) with what you plan to do (unless
5
+
uncontroversial and/or small), so that we can agree on the best way to implement
6
+
it.
7
+
8
+
We appreciate small commits that do one thing, but also that, when possible,
9
+
each commit doesn't break the master branch. Please use your best judgement for
10
+
the size of the commit according to these guidelines. If a commit breaks master,
11
+
we at least require to push together all commits until master is fixed.
12
+
13
+
We also appreciate a tidy history, so after you write all your code, consider
14
+
tidying up the commits to reflect what you did at the end, which is usually a
15
+
simplified version of the process that you followed to reach the final state.
16
+
Moreover, each commit should not have PEP 8 or pyflakes warnings (see below for
17
+
how to make sure you don't introduce any).
18
+
19
+
If your change involves more than one commit, please create a PR for each of
20
+
them, unless for very small and obvious commits (read: fixing typos, comments, a
21
+
few obvious lines), or unless some commit breaks master.
22
+
23
+
During the review, please address all comments by creating one or more 'fixup'
24
+
commits on top of the branch (no forced push). At the end, either you or one of
25
+
the owners can squash appropriately the fixups.
12
26
13
27
# Code style
14
28
@@ -17,9 +31,11 @@ For Python code, we generally follow [PEP 8](https://www.python.org/dev/peps/pep
17
31
We get around Python flexible type system in several ways:
18
32
* we try to avoid "magic" (e.g., generating or changing classes on the fly);
19
33
* we are fairly verbose with naming, trying to help the reader with following the types;
20
-
* we follow our type annotation system for method and function docstrings (planning to switch to [PEP 484](https://www.python.org/dev/peps/pep-0484/)); see later for the format.
34
+
* we follow our type annotation system for method and function docstrings
35
+
(planning to switch to [PEP 484](https://www.python.org/dev/peps/pep-0484/));
36
+
see later for the format.
21
37
22
-
We support Python 3 only, requiring at least version 3.8.
38
+
We support Python 3 only, requiring at least version 3.9.
[](https://gitter.im/cms-dev/cms?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://t.me/contestms)
9
+
10
+
[🌍 Help translate CMS in your language!](https://cms-dev.oneskyapp.com/collaboration/project?id=392655)
9
11
10
12
Introduction
11
13
------------
@@ -47,25 +49,23 @@ Support
47
49
To learn how to install and use CMS, please read the **documentation**,
48
50
available at <https://cms.readthedocs.org/>.
49
51
50
-
If you have questions or need help troubleshooting some problem,
51
-
contact us in the **chat** at [gitter](https://gitter.im/cms-dev/cms),
52
-
or write on the **support mailing list**
53
-
<contestms-support@googlegroups.com>, where no registration is required
Copy file name to clipboardExpand all lines: docs/Installation.rst
+54-32
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ These are our requirements (in particular we highlight those that are not usuall
16
16
17
17
* `GNU compiler collection <https://gcc.gnu.org/>`_ (in particular the C compiler ``gcc``);
18
18
19
-
* `Python <http://www.python.org/>`_ >= 3.8;
19
+
* `Python <http://www.python.org/>`_ >= 3.9;
20
20
21
21
* `libcg <http://libcg.sourceforge.net/>`_;
22
22
23
23
* `TeX Live <https://www.tug.org/texlive/>`_ (only for printing);
24
24
25
25
* `a2ps <https://www.gnu.org/software/a2ps/>`_ (only for printing).
26
26
27
-
You will also require a Linux kernel with support for control groups and namespaces. Support has been in the Linux kernel since 2.6.32. Other distributions, or systems with custom kernels, may not have support enabled. At a minimum, you will need to enable the following Linux kernel options: ``CONFIG_CGROUPS``, ``CONFIG_CGROUP_CPUACCT``, ``CONFIG_MEMCG`` (previously called as ``CONFIG_CGROUP_MEM_RES_CTLR``), ``CONFIG_CPUSETS``, ``CONFIG_PID_NS``, ``CONFIG_IPC_NS``, ``CONFIG_NET_NS``. It is anyway suggested to use Linux kernel version at least 3.8.
27
+
You will also require a Linux kernel with support for `cgroupv2 <https://docs.kernel.org/admin-guide/cgroup-v2.html>`_.
28
28
29
29
Then you require the compilation and execution environments for the languages you will use in your contest:
30
30
@@ -34,9 +34,9 @@ Then you require the compilation and execution environments for the languages yo
34
34
35
35
* `Free Pascal <http://www.freepascal.org/>`_ (for Pascal, with executable ``fpc``);
36
36
37
-
* `Python <http://www.python.org/>`_ >= 3.8 (for Python, with executable ``python3``; in addition you will need ``zip``);
37
+
* `Python <http://www.python.org/>`_ (for Python, with executable ``python3``; in addition you will need ``zip``);
38
38
39
-
* `PHP <http://www.php.net>`_ >= 5 (for PHP, with executable ``php``);
39
+
* `PHP <http://www.php.net>`_ (for PHP, with executable ``php``);
40
40
41
41
* `Glasgow Haskell Compiler <https://www.haskell.org/ghc/>`_ (for Haskell, with executable ``ghc``);
42
42
@@ -71,7 +71,8 @@ The above commands provide a very essential Pascal environment. Consider install
71
71
Arch Linux
72
72
----------
73
73
74
-
On Arch Linux, unofficial AUR packages can be found: `cms <http://aur.archlinux.org/packages/cms>`_ or `cms-git <http://aur.archlinux.org/packages/cms-git>`_. However, if you do not want to use them, the following command will install almost all dependencies (some of them can be found in the AUR):
74
+
On Arch Linux, the following command will install almost all dependencies (some
75
+
of them can be found in the AUR):
75
76
76
77
.. sourcecode:: bash
77
78
@@ -136,33 +137,17 @@ Installing CMS and its Python dependencies
136
137
137
138
There are a number of ways to install CMS and its Python dependencies:
138
139
139
-
Method 1: Global installation with pip
140
-
--------------------------------------
141
-
142
-
There are good reasons to install CMS and its Python dependencies via pip (Python Package Index) instead of your package manager (e.g. apt-get). For example: two different Linux distro (or two different versions of the same distro) may offer two different versions of ``python-sqlalchemy``. When using pip, you can choose to install a *specific version* of ``sqlalchemy`` that is known to work correctly with CMS.
143
-
144
-
Assuming you have ``pip`` installed, you can do this:
This command installs python dependencies globally. Note that on some distros, like Arch Linux, this might interfere with the system package manager. If you want to perform the installation in your home folder instead, then you can do this instead:
153
-
154
-
.. sourcecode:: bash
155
-
156
-
export SETUPTOOLS_USE_DISTUTILS="stdlib"
157
-
pip3 install --user -r requirements.txt
158
-
python3 setup.py install --user
159
-
160
-
Method 2: Virtual environment
140
+
Method 1: Virtual environment
161
141
-----------------------------
162
142
163
-
An alternative method to perform the installation is with a `virtual environment <https://virtualenv.pypa.io/en/latest/>`_, which is an isolated Python environment that you can put wherever you like and that can be activated/deactivated at will.
143
+
The recommended method to install CMS is via a `virtual environment
144
+
<https://virtualenv.pypa.io/en/latest/>`_, which is an isolated Python
145
+
environment that you can put wherever you like and that can be
146
+
activated/deactivated at will.
164
147
165
-
You will need to create a virtual environment somewhere in your filesystem. For example, let's assume that you decided to create it under your home directory (as ``~/cms_venv``):
148
+
You will need to create a virtual environment somewhere in your filesystem. For
149
+
example, let's assume that you decided to create it under your home directory
150
+
(as ``~/cms_venv``):
166
151
167
152
.. sourcecode:: bash
168
153
@@ -174,7 +159,10 @@ To activate it:
174
159
175
160
source ~/cms_venv/bin/activate
176
161
177
-
After the activation, the ``pip`` command will *always* be available (even if it was not available globally, e.g. because you did not install it). In general, every python command (python, pip) will refer to their corresponding virtual version. So, you can install python dependencies by issuing:
162
+
After the activation, the ``pip`` command will *always* be available (even if it
163
+
was not available globally, e.g. because you did not install it). In general,
164
+
every python command (python, pip) will refer to their corresponding virtual
165
+
version. So, you can install python dependencies by issuing:
178
166
179
167
.. sourcecode:: bash
180
168
@@ -184,14 +172,48 @@ After the activation, the ``pip`` command will *always* be available (even if it
184
172
185
173
.. note::
186
174
187
-
Once you finished using CMS, you can deactivate the virtual environment by issuing:
175
+
Once you finished using CMS, you can deactivate the virtual environment by
176
+
issuing:
188
177
189
178
.. sourcecode:: bash
190
179
191
180
deactivate
192
181
193
-
Method 3: Using your distribution's system packages
182
+
Method 2: Using the Docker image
183
+
--------------------------------
184
+
185
+
See :doc:`here <Docker image>` for more information. This method is the
186
+
recommended way for running tests locally and for local development. It hasn't
187
+
been tested in production yet, so use it at your own risk.
188
+
189
+
Method 3: Global installation with pip
190
+
--------------------------------------
191
+
192
+
There are good reasons to install CMS and its Python dependencies via pip
193
+
instead of your package manager (e.g. apt-get). For example: two different Linux
194
+
distro (or two different versions of the same distro) may offer two different
195
+
versions of ``python-sqlalchemy``. When using pip, you can choose to install a
196
+
*specific version* of ``sqlalchemy`` that is known to work correctly with CMS.
197
+
198
+
Assuming you have ``pip`` installed, you can do this:
This command installs python dependencies globally. Note that on some distros, like Arch Linux, this might interfere with the system package manager. If you want to perform the installation in your home folder instead, then you can do this instead:
207
+
208
+
.. sourcecode:: bash
209
+
210
+
export SETUPTOOLS_USE_DISTUTILS="stdlib"
211
+
pip3 install --user -r requirements.txt
212
+
python3 setup.py install --user
213
+
214
+
Method 4: Using your distribution's system packages
0 commit comments