-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependencies on python2, move to python3
Also replace libmozjs with nodejs.
- Loading branch information
Showing
28 changed files
with
84 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: python | ||
python: | ||
- 2.7 | ||
- 3.7 | ||
|
||
script: py.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:18.04 | ||
FROM ubuntu:20.04 | ||
|
||
MAINTAINER [email protected] | ||
|
||
|
@@ -14,10 +14,10 @@ RUN apt-get update && \ | |
libgmp10 \ | ||
libgmpxx4ldbl \ | ||
openjdk-8-jdk \ | ||
python-minimal \ | ||
python-pip \ | ||
python-plastex \ | ||
python-yaml \ | ||
python3-minimal \ | ||
python3-pip \ | ||
python3-plastex \ | ||
python3-yaml \ | ||
sudo \ | ||
texlive-fonts-recommended \ | ||
texlive-lang-cyrillic \ | ||
|
@@ -26,4 +26,4 @@ RUN apt-get update && \ | |
tidy \ | ||
vim | ||
|
||
RUN pip install git+https://github.com/kattis/problemtools | ||
RUN pip3 install git+https://github.com/ghamerly/problemtools@move-to-py3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
# version of problemtools to be built (default is latest version of | ||
# develop branch on GitHub) | ||
|
||
FROM ubuntu:18.04 | ||
FROM ubuntu:20.04 | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
|
@@ -29,10 +29,7 @@ RUN apt update && \ | |
python3-pytest \ | ||
python3-setuptools \ | ||
python3-yaml \ | ||
python \ | ||
python-pytest \ | ||
python-setuptools \ | ||
python-yaml | ||
python3-setuptools | ||
|
||
RUN mkdir -p /usr/local/problemtools_build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ RUN apt-get update && \ | |
swi-prolog \ | ||
scala \ | ||
sbcl \ | ||
nodejs \ | ||
ocaml-nox \ | ||
rustc \ | ||
; | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Minimalistic problemtools docker image, containing only problemtools | ||
# and its dependencies, no languages (except whichever are | ||
# dependencies of problemtools, e.g. Python 2) | ||
# dependencies of problemtools, e.g. Python 3) | ||
# | ||
# Build requirements: | ||
# - The problemtools .deb package must be available from the host file | ||
|
@@ -10,7 +10,7 @@ | |
# PROBLEMTOOLS_VERSION but this is not checked.) | ||
|
||
ARG PROBLEMTOOLS_VERSION=develop | ||
FROM ubuntu:18.04 | ||
FROM ubuntu:20.04 | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
|
@@ -20,12 +20,10 @@ RUN apt update && \ | |
apt install -y \ | ||
ghostscript \ | ||
libgmpxx4ldbl \ | ||
python-minimal \ | ||
python-pkg-resources \ | ||
python-plastex \ | ||
python-yaml \ | ||
python3-minimal \ | ||
python3-yaml \ | ||
python3-plastex \ | ||
texlive-fonts-recommended \ | ||
texlive-lang-cyrillic \ | ||
texlive-latex-extra \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ Source: kattis-problemtools | |
Section: devel | ||
Priority: optional | ||
Maintainer: Per Austrin <[email protected]> | ||
Build-Depends: debhelper (>= 8.0.0), g++ (>= 4.8), dh-python, python3, python3-setuptools, python3-pytest, python3-yaml, python (>= 2.6.6-3~), python-setuptools, python-pytest, python-yaml, libboost-regex-dev, libgmp-dev, automake, autoconf | ||
Build-Depends: debhelper (>= 8.0.0), g++ (>= 4.8), dh-python, python3, python3-setuptools, python3-pytest, python3-yaml, python3-setuptools, python3-pytest, libboost-regex-dev, libgmp-dev, automake, autoconf | ||
Standards-Version: 3.9.4 | ||
Homepage: https://github.com/Kattis/problemtools | ||
|
||
Package: kattis-problemtools | ||
Architecture: any | ||
Depends: ${shlibs:Depends}, ${python:Depends}, ${python3:Depends}, ${misc:Depends}, python-yaml, plastex, python3-plastex, python-pkg-resources, texlive-plain-generic, texlive-fonts-recommended, texlive-latex-extra, texlive-lang-cyrillic, tidy, ghostscript | ||
Depends: ${shlibs:Depends}, ${python3:Depends}, ${misc:Depends}, python3-plastex, python-pkg-resources, texlive-plain-generic, texlive-fonts-recommended, texlive-latex-extra, texlive-lang-cyrillic, tidy, ghostscript | ||
Recommends: gcc, g++ | ||
Description: Kattis Problem Tools | ||
These are tools to manage and verify problem packages in the | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/env python3 | ||
from sys import stdin | ||
import sys | ||
import re | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
var line; | ||
const readline = require('readline'); | ||
|
||
while (line = readline()) { | ||
const rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
|
||
rl.on('line', (line) => { | ||
var nums = line.split(' '); | ||
var a = parseInt(nums[0]); | ||
var b = parseInt(nums[1]); | ||
var res = Math.abs(a - b); | ||
print(res); | ||
} | ||
console.log(res); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/usr/bin/env python2 | ||
|
||
import sys | ||
|
||
for line in sys.stdin: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#! /usr/bin/python3 | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
|
||
|
15 changes: 15 additions & 0 deletions
15
examples/different/submissions/slow_accepted/different_slow.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/python3 | ||
|
||
import sys | ||
|
||
for line in sys.stdin: | ||
ab = line.split() | ||
a = int(ab[0]) | ||
b = int(ab[1]) | ||
# needless loop just to be slow | ||
x = a | ||
for _ in range(100000000): | ||
x += 1 | ||
diff = abs(a-b) + x - x | ||
|
||
print(diff) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/env python3 | ||
from sys import stdin | ||
import sys | ||
import re | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/env python3 | ||
|
||
print "500" | ||
print("500") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python2 | ||
#!/usr/bin/env python3 | ||
from sys import stdin | ||
import sys | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
print 'Hello World!' | ||
#!/usr/bin/env python3 | ||
|
||
print('Hello World!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#! /usr/bin/env python2 | ||
#! /usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
import re | ||
import os.path | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.