rbx.cp 0.5.28__py3-none-any.whl → 0.5.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,7 +104,7 @@ class Statement(BaseModel):
104
104
  type: StatementType = Field(description='Type of the input statement file.')
105
105
 
106
106
  steps: List[ConversionStep] = Field(
107
- [],
107
+ default=[],
108
108
  discriminator='type',
109
109
  description="""
110
110
  Describes a sequence of conversion steps that should be applied to the statement file.
@@ -116,7 +116,7 @@ certain conversion steps to happen.
116
116
  )
117
117
 
118
118
  configure: List[ConversionStep] = Field(
119
- [],
119
+ default=[],
120
120
  discriminator='type',
121
121
  description="""
122
122
  Configure how certain conversion steps should happen when applied to the statement file.
@@ -127,7 +127,7 @@ configure them in case they are applied.
127
127
  )
128
128
 
129
129
  assets: List[str] = Field(
130
- [],
130
+ default=[],
131
131
  description="""
132
132
  Assets relative to the package directory that should be included while building
133
133
  the statement. Files will be included in the same folder as the statement file, preserving
@@ -135,4 +135,6 @@ their relativeness. Can be glob pattern as well, such as `imgs/*.png`.
135
135
  """,
136
136
  )
137
137
 
138
- language: str = Field('en', description='Language this is statement is written in.')
138
+ language: str = Field(
139
+ default='en', description='Language this is statement is written in.'
140
+ )
rbx/box/stresses.py CHANGED
@@ -9,7 +9,11 @@ from pydantic import BaseModel
9
9
  from rbx import console
10
10
  from rbx.box import checkers, package, validators
11
11
  from rbx.box.code import SanitizationLevel, compile_item, run_item
12
- from rbx.box.generators import generate_standalone
12
+ from rbx.box.generators import (
13
+ GenerationMetadata,
14
+ expand_generator_call,
15
+ generate_standalone,
16
+ )
13
17
  from rbx.box.retries import Retrier
14
18
  from rbx.box.schema import CodeItem, GeneratorCall, Stress, Testcase
15
19
  from rbx.box.solutions import compile_solutions, get_outcome_style_verdict
@@ -123,9 +127,12 @@ def run_stress(
123
127
  input_path = runs_dir / '.stress' / 'input'
124
128
  input_path.parent.mkdir(parents=True, exist_ok=True)
125
129
 
126
- expanded_generator_call = generate_standalone(
127
- stress.generator,
128
- input_path,
130
+ expanded_generator_call = expand_generator_call(stress.generator)
131
+ generate_standalone(
132
+ GenerationMetadata(
133
+ generator_call=expanded_generator_call,
134
+ copied_to=Testcase(inputPath=input_path),
135
+ ),
129
136
  generator_digest=generator_digest,
130
137
  validator_digest=compiled_validator[1]
131
138
  if compiled_validator is not None
rbx/box/testcases.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import pathlib
2
2
  import shutil
3
- from typing import List
3
+ from typing import List, Tuple
4
4
 
5
5
  import typer
6
6
  from pydantic import BaseModel
@@ -11,6 +11,22 @@ from rbx.box.package import get_build_testgroup_path, get_build_tests_path
11
11
  from rbx.box.schema import Testcase, TestcaseGroup
12
12
 
13
13
 
14
+ class TestcaseEntry(BaseModel):
15
+ group: str
16
+ index: int
17
+
18
+ def key(self) -> Tuple[str, int]:
19
+ return self.group, self.index
20
+
21
+ def __str__(self) -> str:
22
+ return f'{self.group}/{self.index}'
23
+
24
+ @classmethod
25
+ def parse(cls, spec: str) -> 'TestcaseEntry':
26
+ group, index = spec.split('/')
27
+ return TestcaseEntry(group=group.strip(), index=int(index))
28
+
29
+
14
30
  class TestcaseData(BaseModel):
15
31
  input: str
16
32
  output: str
@@ -267,7 +267,6 @@ class StupidSandbox(SandboxBase):
267
267
  (caused by the sandbox itself), False otherwise
268
268
 
269
269
  """
270
-
271
270
  self.exec_num += 1
272
271
 
273
272
  logger.debug(
rbx/utils.py CHANGED
@@ -98,12 +98,18 @@ def save_ruyaml(path: pathlib.Path, yml: ruyaml.YAML, data: ruyaml.Any):
98
98
  yml.dump(data, f)
99
99
 
100
100
 
101
- def confirm_on_status(status: Optional[rich.status.Status], *args, **kwargs) -> bool:
101
+ @contextlib.contextmanager
102
+ def no_progress(status: Optional[rich.status.Status]):
102
103
  if status:
103
104
  status.stop()
104
- res = rich.prompt.Confirm.ask(*args, **kwargs, console=console)
105
+ yield
105
106
  if status:
106
107
  status.start()
108
+
109
+
110
+ def confirm_on_status(status: Optional[rich.status.Status], *args, **kwargs) -> bool:
111
+ with no_progress(status):
112
+ res = rich.prompt.Confirm.ask(*args, **kwargs, console=console)
107
113
  return res
108
114
 
109
115
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rbx.cp
3
- Version: 0.5.28
3
+ Version: 0.5.30
4
4
  Summary:
5
5
  Author: Roberto Sales
6
6
  Requires-Python: >=3.9,<4.0
@@ -32,9 +32,6 @@ Requires-Dist: textual (>=0.79.1,<0.80.0)
32
32
  Requires-Dist: typer (>=0.15.1,<0.16.0)
33
33
  Description-Content-Type: text/markdown
34
34
 
35
- <p align="center">
36
- <img src="docs/rbx_transparent.png" width="240px">
37
- </p>
38
35
  <p align="center">
39
36
  <em>The go-to CLI tool for competitive programmers and setters.</em>
40
37
  </p>
@@ -2,10 +2,10 @@ rbx/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  rbx/annotations.py,sha256=Z3jBUyZoXkrz34jko3Rft0bnMME6nWb0vsV5I3HlgR0,3064
3
3
  rbx/autoenum.py,sha256=cusv8ClXRlDVvhZ8eDrtYcL_2peXlHugAey_ht8roXk,12025
4
4
  rbx/box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- rbx/box/builder.py,sha256=0TiRQJoHqLHAI8QwBrscbaJmhdcmialVtP_oEkfHcs0,3260
5
+ rbx/box/builder.py,sha256=eynVPyRdpYtSNmr8MP7-8jspNH74lj-DclwtiIcJrvM,3280
6
6
  rbx/box/cd.py,sha256=9a_SOnzoJBXxxffp4Wbf3UKXIwKuN3Hvj7K6SocALwE,1194
7
7
  rbx/box/checkers.py,sha256=VpgDzevOK7hrffG2zJGxquNiu-a9Fl3wquLn7xadcK0,6285
8
- rbx/box/code.py,sha256=sD3kpQaPU8_E5TJFjRL-tgGxz-qyC0oKsyykgQArbJA,11606
8
+ rbx/box/code.py,sha256=XtdSq1Xq7BmCikDWURJl8l588oigjbr9ZU-aCnIEszc,13122
9
9
  rbx/box/compile.py,sha256=OJLthDQ921w9vyoE6Gk1Df54i5RwtRJ2YG-8XEfefcs,2489
10
10
  rbx/box/conftest.py,sha256=sEmciXSeDC-wmrZ1JSxbsUenKNP_VWW32mrCun2pY3I,1070
11
11
  rbx/box/contest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -13,16 +13,17 @@ rbx/box/contest/build_contest_statements.py,sha256=OvKTE2O1UchiBRPzbU94KdIn0whT0
13
13
  rbx/box/contest/contest_package.py,sha256=OaUbpBtkhkgOPzJ1ccI_Vq4FMSaJvZm3gMOKfVY8oy4,3032
14
14
  rbx/box/contest/contest_utils.py,sha256=TDE7I6YQJlu4dQd68wzOp019bNgqiT0RlM-LMQMjL9w,301
15
15
  rbx/box/contest/main.py,sha256=fFYeZn8KTLt9j-OFFkcBeQWw8RsTLUauFV6drM2hT48,7404
16
- rbx/box/contest/schema.py,sha256=rxzjJasMWPKKhvSJs4eW4A2oCiA4gXgfF-MzqsbPslQ,4914
16
+ rbx/box/contest/schema.py,sha256=JMAig5WpaOahNgAHxA9vX4zYeVYDxpjKP_PFGvmmkE0,4954
17
17
  rbx/box/contest/statements.py,sha256=Pe4uo1hxvEON8O11VAzsOP3DxUel0vmwiAmolh4ltEs,2910
18
- rbx/box/creation.py,sha256=mVHVVj8ozX9D5qpkLewE5WSjF6HtTm74Pkwubk-bATg,2259
18
+ rbx/box/creation.py,sha256=YOWn0zUFvt3ABGIYdc-bn_49UIhBzcDMarL7yjI1hqc,2662
19
19
  rbx/box/deferred.py,sha256=II3X9e87JCOZtmspnHh-n4PFqh-FsH_oc0XJHZ9ZYVQ,691
20
20
  rbx/box/download.py,sha256=MFP-R26JiYGAP89I0TK-0fYc69Fsd20tsBqgtRCy5AE,2234
21
21
  rbx/box/environment.py,sha256=47NtyuVC6zSQKAtQaXPEXvqcD-KJiuWRpWF8pYvcG4c,11158
22
- rbx/box/extensions.py,sha256=gIC73VbF1897er3iIMhaIw6GE8o1t43M7q97Iz7-_lg,503
23
- rbx/box/generators.py,sha256=bzURQrNEscCO8_3BYXCyGK9ZneX4-eOJZP5JJV28f3I,16350
24
- rbx/box/generators_test.py,sha256=mQqHepAMYa6zV_PseQALI0nIX6AdQktt6lh94muFhNw,1758
25
- rbx/box/main.py,sha256=PZYbC2k6f2pMIuj1-X_yEANCWYstkIXJ7Bg0Szi37YA,23293
22
+ rbx/box/extensions.py,sha256=Von8kIeXvNFTkGlMRMTvL2HIHPwlkuiMswr-ydbGV1w,519
23
+ rbx/box/formatting.py,sha256=3phFRHzqVXj4Ok1yDhCq6Clbw6KlqwJNpMhs--oTWFI,405
24
+ rbx/box/generators.py,sha256=PAFnCpvyb692piN_YL7cPZJpPwSXcmlzh99QWHRybfY,20594
25
+ rbx/box/generators_test.py,sha256=BqWf-A0u0ifZJZlvrMuOHOHQPfMox2Jy6540GmnTnkc,1753
26
+ rbx/box/main.py,sha256=4H6NG1kgkDhWtO4f1R6s_uEjw-Ijr7j4Ms1nzZQvM90,23583
26
27
  rbx/box/package.py,sha256=SSckCXo7Zh412_qjYhSNwConjhR0Sk8911qGJU34Hac,11851
27
28
  rbx/box/packaging/boca/extension.py,sha256=hQhcbocNfW2ESv5RalS1wf6uvOoOfOnR_gHvbXUbSzY,852
28
29
  rbx/box/packaging/boca/packager.py,sha256=FOhSRg5K5Y4qNB0WyTR3DKgrpObf9I0JbyGpJHOtxpo,10673
@@ -38,22 +39,23 @@ rbx/box/presets/lock_schema.py,sha256=6sRPnyePOC8yy-5WcD5JRZdDJHf8loqbvpQ1IPiOU9
38
39
  rbx/box/presets/schema.py,sha256=mZmSPkQsw7eQM0lQN6er1MO_LiW1ObwwAZFDK0F5fxE,1962
39
40
  rbx/box/retries.py,sha256=z7cIh1QmLVUsTr3Attt_28dbwNg6KWTwpulcWCFwMPo,4667
40
41
  rbx/box/sanitizers/warning_stack.py,sha256=RI97_GJgdjTKIXY_r0EKp5h0qQQSDSdNDh5K7zINrqs,2861
41
- rbx/box/schema.py,sha256=mPEOchzoGDwk_S9wUw1DKqwJWJ0S5GTxQnZIlm9BFwo,13709
42
- rbx/box/setter_config.py,sha256=sg38rzTuT0RNANNV558cSCORvovOK6EIz_ioVzaTkGI,4223
43
- rbx/box/solutions.py,sha256=DDiMfSEsZaipzCZf7raiiIY5HbelIvYQIoyoEjtQlKI,38478
42
+ rbx/box/schema.py,sha256=iu6S2A2d_7SAQNFd34galQHxFAI2CQrIgXnSBlKgBCk,14307
43
+ rbx/box/setter_config.py,sha256=ZM7_G2tbaixaFr0NvRaXkowwfxSWF2Gb4XHBsr2Prpc,4279
44
+ rbx/box/solutions.py,sha256=D-ROVAb2gzoiXZ4D50wOBZI_Uodb7504Bvwd5-vhK0M,41590
44
45
  rbx/box/solutions_test.py,sha256=Cx7Goon_0sz_PaUcD8qa8gmjgzOVub6VHss3CB0GaA0,1524
46
+ rbx/box/state.py,sha256=yTpjfASpnSXkRB3JiDNvCg5b9JNnNxuYT4uMcbdr59s,109
45
47
  rbx/box/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
48
  rbx/box/statements/build_statements.py,sha256=upsMT-cAnSvbmKgtijdFc0OxPcyeBxRG92hY6dN-ZOk,11920
47
49
  rbx/box/statements/builders.py,sha256=W3VkmtjfzrT5MkIVXgfR9fM-OWK007ihm5hfzvp9cfc,10474
48
50
  rbx/box/statements/joiners.py,sha256=ZbxomnMjEFT8yf5WSWUB4tBa3DL3AhjGEuh8uqHyDdg,2837
49
51
  rbx/box/statements/latex.py,sha256=LkcHwXjMFxbw--Gj9T1VkFKQFsXhY9dN7xZHpZycNW8,1346
50
52
  rbx/box/statements/latex_jinja.py,sha256=7WBfn1h8DpqCAmSE6Av64HfURMnJ2AO4QX1CD72sz5E,7096
51
- rbx/box/statements/schema.py,sha256=g3KgBn4nIqx-0utH8R2FCqPmJP969chhYfn96chQgd4,3851
52
- rbx/box/stresses.py,sha256=ejgNOQNCvfyeDmnOI52iplVKOgx4yLFcEJSVG67NVfs,11556
53
+ rbx/box/statements/schema.py,sha256=ES8EUE9JE_uJlDwQx1kZd_5nQJyABtlnjP5IjbWaJ-0,3897
54
+ rbx/box/stresses.py,sha256=ceFpkZVKBfKKVrKFjeARdub5VGKmU9JPZwj-FxcqYjQ,11771
53
55
  rbx/box/stressing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
56
  rbx/box/stressing/finder_parser.py,sha256=jXpYNa4FyugzmHi3r96Uv4rU1krRQJc5Ihr9jf1cvNo,11918
55
57
  rbx/box/stressing/generator_parser.py,sha256=oHZryjR3YohgaSO9WEirQ7b2e-98WgZStF0N99W4Thw,7380
56
- rbx/box/testcases.py,sha256=bi7T5xXkwyWOkoI6ILcaf2gSSVuuNtZjhP5yL0DJAu4,1452
58
+ rbx/box/testcases.py,sha256=d10qlOLK-gzedL3PYm56eq5R4D_kBjTBC1S9VKlRkz0,1850
57
59
  rbx/box/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
60
  rbx/box/ui/captured_log.py,sha256=ptICDPViVnz-_2NfrcB0SSBXNW5L74zI-vAZNN7kSok,11319
59
61
  rbx/box/ui/css/app.tcss,sha256=apd5PkPEvl5jK3kE2qrxPyVED1VnvSsj08QQwzUPwEA,786
@@ -77,7 +79,7 @@ rbx/grading/judge/digester.py,sha256=m6o-kjwyFOXKdImUXtVbdMHhwrgrXk8FDnJFVefnTIw
77
79
  rbx/grading/judge/sandbox.py,sha256=0h3YCmGabf9OfORJgx6v2Bed4kE-i8FyuZkPux-sDVk,23569
78
80
  rbx/grading/judge/sandboxes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
81
  rbx/grading/judge/sandboxes/isolate.py,sha256=9xgBuNfAvGtO2zME1FXRah2rcPvzDShsPG0TTuX_UDU,25649
80
- rbx/grading/judge/sandboxes/stupid_sandbox.py,sha256=2rFinUSafape4ad_r0TXBX0ZwnAfuVgEnDviozXbYlo,10155
82
+ rbx/grading/judge/sandboxes/stupid_sandbox.py,sha256=NKSJWw_1HALjwGVIYQr_R1-s1tb6I25lzDLnPPsYANg,10154
81
83
  rbx/grading/judge/sandboxes/timeit.py,sha256=xScfasI2lsSQGZVpIZ7qBZfi0IaKC-1k8wO5qFp7UoM,6634
82
84
  rbx/grading/judge/storage.py,sha256=FirqjwDqb0m0h2OTFyWrZL7CQ4XjZNxhqB4JpnDIhZY,9485
83
85
  rbx/grading/judge/test.py,sha256=ll0Iw7zyOpGdKPD_PGH7dvUkb4stQLu-ikbQnqJvuAc,944
@@ -162,9 +164,9 @@ rbx/testdata/box1/wa.sol.cpp,sha256=qsHmvtLJOFI_sdvUT6ITqk7FJYqhrRTCmEIRdy4gSGE,
162
164
  rbx/testdata/caching/executable.py,sha256=WKRHNf_fprFJd1Fq1ubmQtR3mZzTYVNwKPLWuZ4HrWg,10
163
165
  rbx/testdata/compatible,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
164
166
  rbx/testing_utils.py,sha256=ZZLKMUHlZ4HwsuNY50jqSBJ9HhpnFdba7opjDsvXE1U,2084
165
- rbx/utils.py,sha256=WlmnF4whc0-6ksVZoOhmom2bR2spT6zETFHjnpJOCsA,4383
166
- rbx_cp-0.5.28.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
167
- rbx_cp-0.5.28.dist-info/METADATA,sha256=-USuUd5PUdLlp6Y2Iw4NVwH1w69ELnwu4fkOFG6gKhc,3290
168
- rbx_cp-0.5.28.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
169
- rbx_cp-0.5.28.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
170
- rbx_cp-0.5.28.dist-info/RECORD,,
167
+ rbx/utils.py,sha256=q1ZmfVCD6rdKVVZFBqwVetldSgGAbIh_KLHseBTUSiQ,4511
168
+ rbx_cp-0.5.30.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
169
+ rbx_cp-0.5.30.dist-info/METADATA,sha256=MWJW393cH-A8KV7lwTcu5ULdBtisYNIf9H-ZgSj8e9Q,3212
170
+ rbx_cp-0.5.30.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
171
+ rbx_cp-0.5.30.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
172
+ rbx_cp-0.5.30.dist-info/RECORD,,