Skip to content

Commit 449d853

Browse files
committed
Merge branch 'release/1.20231016'
2 parents 876690a + 32a6874 commit 449d853

File tree

102 files changed

+1979
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1979
-510
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: python
22
python:
3-
- 2.7
43
- 3.7
54

65
script: py.test

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04
1+
FROM ubuntu:20.04
22

33
MAINTAINER austrin@kattis.com
44

@@ -14,16 +14,16 @@ RUN apt-get update && \
1414
libgmp10 \
1515
libgmpxx4ldbl \
1616
openjdk-8-jdk \
17-
python-minimal \
18-
python-pip \
19-
python-plastex \
20-
python-yaml \
17+
python3-minimal \
18+
python3-pip \
19+
python3-plastex \
20+
python3-yaml \
2121
sudo \
2222
texlive-fonts-recommended \
2323
texlive-lang-cyrillic \
2424
texlive-latex-extra \
25-
texlive-latex-recommended \
25+
texlive-plain-generic \
2626
tidy \
2727
vim
2828

29-
RUN pip install git+https://github.com/kattis/problemtools
29+
RUN pip3 install git+https://github.com/kattis/problemtools

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
all:
1+
all: checktestdata
22
make -C support
33

4-
builddeb:
4+
builddeb: checktestdata
55
dpkg-buildpackage -us -uc -tc -b
6+
7+
checktestdata: support/checktestdata/bootstrap
8+
9+
support/checktestdata/bootstrap:
10+
git submodule update --init

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ A few examples of problem packages can be found in [examples](examples).
2828

2929
## Installing problemtools
3030

31-
There are four recommended ways of installing and running problemtools.
31+
There are four supported ways of installing and running problemtools.
3232
(For non-Linux users, "Method 2" below, to use Docker, is probably the least painful.)
3333

3434
### Method 1: Install the Python package
3535

3636
Run
3737
```
38-
pip install git+https://github.com/kattis/problemtools
38+
pip3 install git+https://github.com/kattis/problemtools
3939
```
4040

4141
Or if you don't want a system-wide installation,
4242
```
43-
pip install --user git+https://github.com/kattis/problemtools
43+
pip3 install --user git+https://github.com/kattis/problemtools
4444
```
4545
With this second option, in order to get the command line scripts, you need
4646
to make sure that the local user bin path used (e.g., on Linux,
@@ -153,18 +153,18 @@ problemtools' configuration:
153153
154154
1. `languages.yaml`. Use it to override problemtools' default
155155
programming language configuration. For instance, while the
156-
problemtools default is to use the CPython `/usr/bin/python2`
157-
interpreter for Python 2, many contests, as well as the Kattis
158-
online judge, use Pypy as the interpreter for Python 2. To change
156+
problemtools default is to use the CPython `/usr/bin/python3`
157+
interpreter for Python 3, many contests, as well as the Kattis
158+
online judge, use Pypy as the interpreter for Python 3. To change
159159
this on your machine, you can simply place a file
160160
`/etc/kattis/problemtools/languages.yaml` (or
161161
`~/.config/problemtools/languages.yaml` if you only want to make the
162162
change for your user) containing the following:
163163
164164
```yaml
165-
python2:
166-
name: 'Python 2 w/Pypy'
167-
run: '/usr/bin/pypy "{mainfile}"'
165+
python3:
166+
name: 'Python 3 w/Pypy'
167+
run: '/usr/bin/pypy3 "{mainfile}"'
168168
```
169169
Here, overriding the name of the language is not strictly
170170
necessary, but it is often helpful to clearly indicate that Pypy is
@@ -196,28 +196,28 @@ problemtools' configuration:
196196
197197
## Requirements and compatibility
198198
199-
To build and run the tools, you need Python 2 with the YAML and PlasTeX libraries,
199+
To build and run the tools, you need Python 3 with the YAML and PlasTeX libraries,
200200
and a LaTeX installation.
201201
202202
### Ubuntu
203203
204204
The dependencies needed to *build/install* problemtools can be installed with:
205205
206-
sudo apt install automake g++ make libboost-regex-dev libgmp-dev libgmp10 libgmpxx4ldbl python python-pytest python-setuptools python-yaml
206+
sudo apt install automake g++ make libboost-regex-dev libgmp-dev libgmp10 libgmpxx4ldbl python3 python3-pytest python3-setuptools python3-yaml python3-plastex
207207
208208
And the dependencies needed to *run* problemtools can be installed with:
209209
210-
sudo apt install ghostscript libgmpxx4ldbl python-minimal python-pkg-resources python-plastex python-yaml texlive-fonts-recommended texlive-generic-recommended texlive-lang-cyrillic texlive-latex-extra texlive-latex-recommended tidy
210+
sudo apt install ghostscript libgmpxx4ldbl python3-minimal python-pkg-resources python3-plastex python3-yaml texlive-fonts-recommended texlive-lang-cyrillic texlive-latex-extra texlive-plain-generic tidy
211211
212212
### Fedora
213213
214214
On Fedora, these dependencies can be installed with:
215215
216-
sudo dnf install boost-regex gcc gmp-devel gmp-c++ python2 python2-pyyaml texlive-latex texlive-collection-fontsrecommended texlive-fancyhdr texlive-subfigure texlive-wrapfig texlive-import texlive-ulem texlive-xifthen texlive-overpic texlive-pbox tidy ghostscript
216+
sudo dnf install boost-regex gcc gmp-devel gmp-c++ python3 python3-pyyaml texlive-latex texlive-collection-fontsrecommended texlive-fancyhdr texlive-subfigure texlive-wrapfig texlive-import texlive-ulem texlive-xifthen texlive-overpic texlive-pbox tidy ghostscript
217217
218218
Followed by:
219219
220-
pip2 install --user plastex
220+
pip3 install --user plastex
221221
222222
### Other platforms
223223

admin/docker/Dockerfile.build

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# version of problemtools to be built (default is latest version of
66
# develop branch on GitHub)
77

8-
FROM ubuntu:18.04
8+
FROM ubuntu:22.04
99

1010
LABEL maintainer="austrin@kattis.com"
1111

@@ -29,10 +29,7 @@ RUN apt update && \
2929
python3-pytest \
3030
python3-setuptools \
3131
python3-yaml \
32-
python \
33-
python-pytest \
34-
python-setuptools \
35-
python-yaml
32+
python3-setuptools
3633

3734
RUN mkdir -p /usr/local/problemtools_build
3835

admin/docker/Dockerfile.full

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,22 @@ ENV DEBIAN_FRONTEND=noninteractive
1111

1212
RUN apt-get update && \
1313
apt-get install -y \
14-
mono-complete \
15-
ghc haskell-platform \
16-
libmozjs-52-dev \
17-
gccgo \
1814
fp-compiler \
19-
php-cli \
20-
swi-prolog \
21-
scala \
22-
sbcl \
15+
gfortran \
16+
gnucobol \
17+
gccgo \
18+
ghc haskell-platform \
19+
gnustep-devel gnustep gnustep-make gnustep-common gobjc \
20+
libgmp3-dev \
21+
libmozjs-78-dev \
22+
lua5.4 \
23+
mono-complete \
24+
nodejs \
2325
ocaml-nox \
26+
php-cli \
27+
pypy \
2428
rustc \
25-
;
29+
sbcl \
30+
scala \
31+
swi-prolog \
32+
;

admin/docker/Dockerfile.icpc

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Basic problemtools docker image, containing problemtools and the
2-
# "ICPC languages" (C, C++, Java, Python 2, Python 3, and Kotlin)
2+
# "ICPC languages" (C, C++, Java, Kotlin, and Python 3)
33
#
4-
# Build requirements:
5-
# - Kotlin must be available from the host file system under
6-
# artifacts/kotlin/kotlinc.zip
74

85
ARG PROBLEMTOOLS_VERSION=develop
96
FROM problemtools/minimal:${PROBLEMTOOLS_VERSION}
@@ -12,31 +9,29 @@ LABEL maintainer="austrin@kattis.com"
129

1310
ENV DEBIAN_FRONTEND=noninteractive
1411

15-
# Install C++, Java, PyPy and Python 3
12+
# Install C++, Java, Kotlin, and PyPy 3 via their ppa repository
1613
RUN apt update && \
14+
apt install -y software-properties-common && \
15+
add-apt-repository ppa:pypy/ppa && \
16+
apt update && \
1717
apt install -y \
18-
g++ \
19-
openjdk-11-jdk \
20-
pypy \
21-
python3
22-
23-
# Install Kotlin
24-
WORKDIR /usr/local
25-
COPY artifacts/kotlin/kotlinc.zip /tmp
26-
RUN unzip /tmp/kotlinc.zip
27-
RUN ln -s /usr/local/kotlinc/bin/* bin/
18+
gcc g++ \
19+
openjdk-11-jdk openjdk-11-jre \
20+
kotlin \
21+
pypy3
2822

2923
# Reconfigure problemtools:
30-
# - Use PyPy for Python 2
31-
# - Use /usr/local/bin rather than /usr/bin for Kotlin
24+
# - Use PyPy for Python 2 (not available in this image but in the full one)
25+
# - Use PyPy for Python 3
3226
RUN mkdir -p /etc/kattis/problemtools
3327
RUN echo " \n\
3428
python2: \n\
3529
name: 'Python 2 w/PyPy'\n\
3630
run: '/usr/bin/pypy \"{mainfile}\"'\n\
3731
\n\
38-
kotlin: \n\
39-
compile: '/usr/local/bin/kotlinc -d {path}/ -- {files}' \n\
40-
run: '/usr/local/bin/kotlin -Dfile.encoding=UTF-8 -J-XX:+UseSerialGC -J-Xss64m -J-Xms{memlim}m -J-Xmx{memlim}m -cp {path}/ {Mainclass}Kt' " > /etc/kattis/problemtools/languages.yaml
32+
python3: \n\
33+
name: 'Python 3 w/PyPy'\n\
34+
run: '/usr/bin/pypy3 \"{mainfile}\"'\n\
35+
\n" > /etc/kattis/problemtools/languages.yaml
4136

42-
WORKDIR /
37+
WORKDIR /

admin/docker/Dockerfile.minimal

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Minimalistic problemtools docker image, containing only problemtools
22
# and its dependencies, no languages (except whichever are
3-
# dependencies of problemtools, e.g. Python 2)
3+
# dependencies of problemtools, e.g. Python 3)
44
#
55
# Build requirements:
66
# - The problemtools .deb package must be available from the host file
@@ -10,7 +10,7 @@
1010
# PROBLEMTOOLS_VERSION but this is not checked.)
1111

1212
ARG PROBLEMTOOLS_VERSION=develop
13-
FROM ubuntu:18.04
13+
FROM ubuntu:22.04
1414

1515
LABEL maintainer="austrin@kattis.com"
1616

@@ -20,17 +20,14 @@ RUN apt update && \
2020
apt install -y \
2121
ghostscript \
2222
libgmpxx4ldbl \
23-
python-minimal \
2423
python-pkg-resources \
25-
python-plastex \
26-
python-yaml \
2724
python3-minimal \
2825
python3-yaml \
26+
python3-plastex \
2927
texlive-fonts-recommended \
30-
texlive-generic-recommended \
3128
texlive-lang-cyrillic \
3229
texlive-latex-extra \
33-
texlive-latex-recommended \
30+
texlive-plain-generic \
3431
tidy
3532

3633
RUN mkdir -p /usr/local/artifacts

admin/update_docker.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/bin/bash
22
set -e
33

4-
KOTLIN_VERSION=1.3.50
5-
6-
74
TAG=develop
85
UPDATE_LATEST=false
96
if [ "$1" != "" ]; then
@@ -28,16 +25,6 @@ rm -rf artifacts/deb/*
2825
sudo docker run --rm -v "$(pwd)/artifacts/:/artifacts" problemtools/build:${TAG} cp -r /usr/local/problemtools_build/deb /artifacts
2926
sudo chown -R $USER:$USER artifacts/
3027

31-
# Get Kotlin since it is not available through apt
32-
# ===============================================
33-
mkdir -p artifacts/kotlin
34-
curl -L -o artifacts/kotlin/kotlinc.zip https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip
35-
36-
# FIXME(?): The "-linux-x64" version sounds correct but seems broken
37-
#curl -L -o artifacts/kotlin/kotlinc.zip https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}-linux-x64.zip
38-
39-
# ===============================================
40-
4128

4229
# Build the actual problemtools images
4330
# ===============================================
@@ -52,6 +39,7 @@ for IMAGE in minimal icpc full; do
5239
fi
5340
done
5441

42+
5543
# Push to Docker Hub
5644
# ===============================================
5745
sudo docker login

admin/update_version.py.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ else
1111
# remove leading 'v' from git tag
1212
VERSION=${VERSION:1}
1313
# PEP440 compliance: change "-{#commits}-{last commit ID}" suffix to ".dev{#commits}"
14-
VERSION=$(echo $VERSION | sed -r "s/-(.*)-.*$/.dev\1/g")
14+
VERSION=$(echo $VERSION | sed -r "s/-([^-]*)-[^-]*$/.dev\1/g")
1515
fi
1616

1717
cat <<EOF > $ROOT/problemtools/_version.py

0 commit comments

Comments
 (0)