@@ -15,6 +15,7 @@ import tarfile
1515import tempfile
1616import textwrap
1717import urllib .request
18+ import zipfile
1819from typing import Any , Dict , List , Optional , Sequence , Set , Union
1920
2021import apt
@@ -600,7 +601,7 @@ def _main() -> None:
600601 root .copyfromhost (filename )
601602
602603 with RemoteFile (
603- 'https://raw.githubusercontent.com/omegaup/libkarel/master /libkarel.py' ,
604+ 'https://raw.githubusercontent.com/omegaup/libkarel/v0.0.99 /libkarel.py' ,
604605 '9b67427877bb8ba5bbf3bbde9dcf828c81d3f2cd' ) as remote_file :
605606 root .install ('/usr/lib/python2.7/libkarel.py' , remote_file .path )
606607
@@ -615,9 +616,24 @@ def _main() -> None:
615616 root .copyfromhost (filename )
616617
617618 with RemoteFile (
618- 'https://raw.githubusercontent.com/omegaup/libkarel/master/libkarel.py' ,
619- '9b67427877bb8ba5bbf3bbde9dcf828c81d3f2cd' ) as remote_file :
620- root .install ('/usr/lib/python3.8/libkarel.py' , remote_file .path )
619+ 'https://files.pythonhosted.org/packages/97/20/a73731474363a3998d7b9097632be23ab17c4ad551aea4f1234fd964e524/libkarel-1.0.2-py3-none-any.whl' ,
620+ '1585263c50bf3956350fd617258b48ca05013776' ) as remote_file :
621+ with zipfile .ZipFile (remote_file .path ) as z :
622+ z .extractall (os .path .join (PYTHON3_ROOT , 'dist-packages' ))
623+ logging .info ('Precompiling libkarel.' )
624+ subprocess .check_call ([
625+ '/usr/bin/python3' ,
626+ '-m' ,
627+ 'py_compile' ,
628+ os .path .join (PYTHON3_ROOT , 'dist-packages/libkarel/__init__.py' ),
629+ os .path .join (PYTHON3_ROOT , 'dist-packages/libkarel/libkarel.py' ),
630+ os .path .join (PYTHON3_ROOT , 'dist-packages/libkarel/kareltest.py' ),
631+ ])
632+ root .copyfromhost (os .path .join (PYTHON3_ROOT , 'dist-packages/libkarel' ))
633+ root .copyfromhost (
634+ os .path .join (PYTHON3_ROOT ,
635+ 'dist-packages/libkarel-1.0.2.dist-info' ))
636+ logging .info ('Done.' )
621637
622638 with Chroot (
623639 os .path .join (args .target , 'root-ruby' ), RUBY_ROOT ,
0 commit comments