mumuki-python-runner 1.10.1 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63a45a0174c4fd9ea189f010b298016661e44bac15815d8f259f970a7cb2c38a
4
- data.tar.gz: 0fc8a881203087f2b8aa691ae0bee7ea7776b3a2ee6bd658858dedc9dd7c72f7
3
+ metadata.gz: cefaefb1ab84a0218be06bbd134d1543158f3ca2d6fd133899cf95ee7e3cc822
4
+ data.tar.gz: 2971e74902753121aed0b2e30234586dd2e8bd13b6359fd4213ad80ddcf7bbe6
5
5
  SHA512:
6
- metadata.gz: '0049f89840b9ed8199350aa77c2a8ab9763995296568105392a062b3f61374093ec31523bb170c2c28af7a5427fdc8cc1f4cc45bf578b9ef4d6eab0a609ed9b8'
7
- data.tar.gz: '068159a9bb301cde36b9901a52c645425787e43d3840a8cdf9b0ef971cf5dd2450172a33a3556cf2333b76ea314442aa34412f0cc86a40fb9b07df3a6ffecad2'
6
+ metadata.gz: bca878d84b9575df7af3e969dbaaefcca8e3f69341bced7db8191b9c3ca44062a263c57eadc2c015c1a2ecf2c759ebeb312184d8ac577a9bf037e29a89da03ee
7
+ data.tar.gz: cf7ab7483bc64df071e2c0cedf858ccdcad8b74fa178c276cdf3ded1638168fe46c76d2383723f2e838df812e5ee529877c8a4a99f26e175d694f09fc6f2f106
@@ -57,16 +57,22 @@ python
57
57
  failure = test_case.xpath('failure', 'error')
58
58
  error = failure.attribute('type')
59
59
  message = failure.attribute('message')
60
+ assertion_error_message = try_extract_assertion_error(failure)
60
61
 
61
62
  [
62
63
  format_test_name(test_case.attribute('name').to_s),
63
64
  error.nil? ? :passed: :failed,
64
- error.nil? ? '' : "#{error}: #{message}"
65
+ error.nil? ? '' : "#{error}: #{assertion_error_message || message}"
65
66
  ]
66
67
  end
67
68
 
69
+ def try_extract_assertion_error(failure)
70
+ failure.text.split("AssertionError: ")[1]&.rstrip.try do |it|
71
+ it.each_line.count > 1 ? it + "\n" : it
72
+ end
73
+ end
74
+
68
75
  def format_test_name(name)
69
76
  name.sub('test_', '').gsub('_', ' ').capitalize
70
77
  end
71
78
  end
72
-
data/lib/base/version.rb CHANGED
@@ -1,4 +1,4 @@
1
-
2
- module BasePythonVersionHook
3
- VERSION = '1.10.1'
4
- end
1
+
2
+ module BasePythonVersionHook
3
+ VERSION = '1.11.0'
4
+ end
@@ -0,0 +1,31 @@
1
+ ### Login into Colab
2
+
3
+ In order to solve exercises like this, you will need to create an account and login into [`Colab`](https://colab.research.google.com/) first.
4
+
5
+ ### Solving an exercise
6
+
7
+ First, create a cell with the following code:
8
+
9
+ ```python
10
+ !pip install mumuki-xce --quiet
11
+
12
+ from mumuki import IMumuki
13
+ mumuki = IMumuki("#...token...#", "#...locale...#")
14
+ mumuki.visit("#...organization...#", "#...exercise_id...#")
15
+ ```
16
+
17
+ Then create another cell, whose first line must be `%%solution`. Right after it, write down your solution inside it:
18
+
19
+ ```python
20
+ %%solution
21
+
22
+ # your solution goes here
23
+ ```
24
+
25
+ Edit and execute that cell as many times as you need and feel free to do all the tests you need. When you are done, add a new cell after it and enter the following code:
26
+
27
+ ```python
28
+ mumuki.test()
29
+ ```
30
+
31
+ By executing that line you will submit your solution and will get feedback of it. If you make changes to your code, don't forget to re-execute the corresponding cells. Good luck!
@@ -0,0 +1,31 @@
1
+ ### Ingreso a Colab
2
+
3
+ Para poder resolver ejercicios como éste, necesitarás ingresar a [`Colab`](https://colab.research.google.com/). ¡Asegurate de haber iniciado sesión!
4
+
5
+ ### Resolución de un ejercicio
6
+
7
+ Primero, creá una celda con el siguiente código:
8
+
9
+ ```python
10
+ !pip install mumuki-xce --quiet
11
+
12
+ from mumuki import IMumuki
13
+ mumuki = IMumuki("#...token...#", "#...locale...#")
14
+ mumuki.visit("#...organization...#", "#...exercise_id...#")
15
+ ```
16
+
17
+ Luego creá otra celda, cuya primera línea debe ser `%%solution` y comenzá a escribir tu solución dentro de ella:
18
+
19
+ ```python
20
+ %%solution
21
+
22
+ # tu solución va acá
23
+ ```
24
+
25
+ Editá y ejecutá la celda cuantas veces necesites y no dudes en hacer todas las pruebas que hagan falta. Y finalmente, cuando quieras enviar tu solución, escribí en otra celda lo siguiente:
26
+
27
+ ```python
28
+ mumuki.test()
29
+ ```
30
+
31
+ Si hacés modificaciones a tu código, no olvides volver a ejecutar las celdas correspondientes. ¡Éxitos!
@@ -0,0 +1,31 @@
1
+ ### Login no Colab
2
+
3
+ Para resolver exercícios como este, você precisará fazer login no [`Colab`](https://colab.research.google.com/).
4
+
5
+ ### Resolvendo um exercício
6
+
7
+ Primeiro, crie uma célula com o seguinte código:
8
+
9
+ ```python
10
+ !pip install mumuki-xce --quiet
11
+
12
+ from mumuki import IMumuki
13
+ mumuki = IMumuki("#...token...#", "#. . .locale...#")
14
+ mumuki.visit("#...organization...#", "#...exercise_id...#")
15
+ ```
16
+
17
+ Em seguida, crie outra célula, cuja primeira linha deve ser ` %%solution` e comece a escrever sua solução dentro dela:
18
+
19
+ ```python
20
+ %%solution
21
+
22
+ # sua solução vai aqui
23
+ ```
24
+
25
+ Edite e execute a célula quantas vezes precisar e fique à vontade para fazer todos os testes que precisar. E finalmente, quando você quiser enviar sua solução, escreva em outra célula o seguinte:
26
+
27
+ ```python
28
+ mumuki.test()
29
+ ```
30
+
31
+ Se você fizer alterações em seu código, não se esqueça de executar novamente as células correspondentes. Boa sorte!
@@ -0,0 +1,35 @@
1
+ ### Environment setup
2
+
3
+ You will need to use `python` and `pip` in order to solve exercises like this. Please ensure you have those commands locally installed in your computer. Then install `mumuki-xce`:
4
+
5
+ ```shell
6
+ pip install mumuki-xce --quiet
7
+ ```
8
+
9
+ Now you are ready to solve exercises!
10
+
11
+ ### Solving an exercise
12
+
13
+ Just create a new python file with `py` extension, and paste the following code in it:
14
+
15
+ ```python
16
+ from mumuki import Mumuki
17
+ mumuki = Mumuki("#...token...#", "#...locale...#")
18
+ mumuki.visit("#...organization...#", "#...exercise_id...#")
19
+
20
+ # ...place your solution here...
21
+
22
+ mumuki.test()
23
+ ```
24
+
25
+ If you want to submit your solution, just run on your terminal
26
+
27
+ ```bash
28
+ python your_file.py
29
+ ```
30
+
31
+ If you just want to load it into a node interpreter and test and play with your code, run:
32
+
33
+ ```bash
34
+ python -i your_file.py
35
+ ```
@@ -0,0 +1,37 @@
1
+ ### Preparación del entorno
2
+
3
+ Para poder resolver ejercicios como éste, necesitarás utilizar los comandos `python` y `pip`. Antes de comenzar, asegurate de tenerlos instalados. Después, ejecutá el siguiente comando, por única vez (si ya lo hiciste anteriormente, podés saltar al siguente paso):
4
+
5
+ ```shell
6
+ pip install mumuki-xce --quiet
7
+ ```
8
+
9
+ ¡Ya podés empezar a resolver ejercicios!
10
+
11
+ ### Resolución de un ejercicio
12
+
13
+ Creá un archivo con extensión `.py` en tu computadora y adentro copiá el siguiente código:
14
+
15
+ ```python
16
+ from mumuki import Mumuki
17
+ mumuki = Mumuki("#...token...#", "#...locale...#")
18
+ mumuki.visit("#...organization...#", "#...exercise_id...#")
19
+
20
+ # Escribí tu solución acá
21
+
22
+ mumuki.test()
23
+ ```
24
+
25
+ Si querés enviar tu solución, simplemente ejecutá en tu terminal lo siguiente:
26
+
27
+ ```bash
28
+ python tu_archivo.py
29
+ ```
30
+
31
+ Si en cambio querés cargar tu archivo en el intérprete de `python` para probarlo y jugar con sus funciones antes de enviarlas, ejecutá lo siguiente:
32
+
33
+ ```bash
34
+ python -i tu_archivo.py
35
+ ```
36
+
37
+ ¡Éxitos!
@@ -0,0 +1,37 @@
1
+ ### Preparação do ambiente
2
+
3
+ Para resolver exercícios como este, você precisará usar os comandos `python` e `pip`. Antes de começar, certifique-se de tê-los instalados. Então, execute o seguinte comando, apenas uma vez (se você já fez isso antes, você pode pular para o próximo passo):
4
+
5
+ ```shell
6
+ pip install mumuki-xce --quiet
7
+ ```
8
+
9
+ Agora você pode começar a resolver os exercícios!
10
+
11
+ ### Resolvendo um exercício
12
+
13
+ Crie um arquivo com extensão `.py` em seu computador e copie o seguinte código dentro dele:
14
+
15
+ ```python
16
+ from mumuki import Mumuki
17
+ mumuki = Mumuki("#...token...#", " #...locale...#")
18
+ mumuki.visit("#...organization...#", "#...exercise_id...#")
19
+
20
+ # Escreva sua solução aqui
21
+
22
+ mumuki.test()
23
+ ```
24
+
25
+ Se você deseja enviar sua solução, basta executar o seguinte em seu terminal:
26
+
27
+ ```bash
28
+ python your_file.py
29
+ ```
30
+
31
+ Se, em vez disso, você deseja carregar seu arquivo no interpretador `python` para testá-lo e brincar com seu funções primeiro Depois de enviá-los, execute o seguinte:
32
+
33
+ ```bash
34
+ python -i seu_arquivo.py
35
+ ```
36
+
37
+ Boa sorte!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-python-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-22 00:00:00.000000000 Z
11
+ date: 2023-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mumukit
@@ -157,6 +157,12 @@ files:
157
157
  - lib/python3/version.rb
158
158
  - lib/python3_runner.rb
159
159
  - lib/python_runner.rb
160
+ - xce/colab/en/README.md
161
+ - xce/colab/es-ar/README.md
162
+ - xce/colab/pt/README.md
163
+ - xce/visual_studio/en/README.md
164
+ - xce/visual_studio/es-ar/README.md
165
+ - xce/visual_studio/pt/README.md
160
166
  homepage: http://github.com/mumuki/mumuki-python-runner
161
167
  licenses:
162
168
  - MIT