rbx.cp 0.5.38__py3-none-any.whl → 0.5.39__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.
- rbx/box/code.py +1 -1
- rbx/box/main.py +88 -19
- rbx/box/solutions.py +31 -10
- rbx/box/state.py +1 -0
- {rbx_cp-0.5.38.dist-info → rbx_cp-0.5.39.dist-info}/METADATA +1 -1
- {rbx_cp-0.5.38.dist-info → rbx_cp-0.5.39.dist-info}/RECORD +9 -9
- {rbx_cp-0.5.38.dist-info → rbx_cp-0.5.39.dist-info}/LICENSE +0 -0
- {rbx_cp-0.5.38.dist-info → rbx_cp-0.5.39.dist-info}/WHEEL +0 -0
- {rbx_cp-0.5.38.dist-info → rbx_cp-0.5.39.dist-info}/entry_points.txt +0 -0
rbx/box/code.py
CHANGED
@@ -47,7 +47,7 @@ class SanitizationLevel(Enum):
|
|
47
47
|
|
48
48
|
def should_sanitize(self) -> bool:
|
49
49
|
cfg = setter_config.get_setter_config()
|
50
|
-
if cfg.sanitizers.enabled:
|
50
|
+
if cfg.sanitizers.enabled or state.STATE.sanitized:
|
51
51
|
return self.value >= SanitizationLevel.PREFER.value
|
52
52
|
return self.value >= SanitizationLevel.FORCE.value
|
53
53
|
|
rbx/box/main.py
CHANGED
@@ -55,43 +55,70 @@ app.add_typer(
|
|
55
55
|
setter_config.app,
|
56
56
|
name='config, cfg',
|
57
57
|
cls=annotations.AliasGroup,
|
58
|
-
help='Manage setter configuration.',
|
58
|
+
help='Manage setter configuration (sub-command).',
|
59
|
+
rich_help_panel='Configuration',
|
59
60
|
)
|
60
61
|
app.add_typer(
|
61
62
|
build_statements.app,
|
62
63
|
name='statements, st',
|
63
64
|
cls=annotations.AliasGroup,
|
64
|
-
help='Manage statements.',
|
65
|
+
help='Manage statements (sub-command).',
|
66
|
+
rich_help_panel='Deploying',
|
65
67
|
)
|
66
68
|
app.add_typer(
|
67
69
|
download.app,
|
68
70
|
name='download',
|
69
71
|
cls=annotations.AliasGroup,
|
70
|
-
help='Download an asset from supported repositories.',
|
72
|
+
help='Download an asset from supported repositories (sub-command).',
|
73
|
+
rich_help_panel='Management',
|
71
74
|
)
|
72
75
|
app.add_typer(
|
73
|
-
presets.app,
|
76
|
+
presets.app,
|
77
|
+
name='presets',
|
78
|
+
cls=annotations.AliasGroup,
|
79
|
+
help='Manage presets (sub-command).',
|
80
|
+
rich_help_panel='Configuration',
|
74
81
|
)
|
75
82
|
app.add_typer(
|
76
83
|
packaging.app,
|
77
84
|
name='package, pkg',
|
78
85
|
cls=annotations.AliasGroup,
|
79
|
-
help='Build problem packages.',
|
86
|
+
help='Build problem packages (sub-command).',
|
87
|
+
rich_help_panel='Deploying',
|
80
88
|
)
|
81
89
|
app.add_typer(
|
82
|
-
contest.app,
|
90
|
+
contest.app,
|
91
|
+
name='contest',
|
92
|
+
cls=annotations.AliasGroup,
|
93
|
+
help='Manage contests (sub-command).',
|
94
|
+
rich_help_panel='Management',
|
83
95
|
)
|
84
96
|
app.add_typer(
|
85
97
|
testcases.app,
|
86
98
|
name='testcases, tc, t',
|
87
99
|
cls=annotations.AliasGroup,
|
88
|
-
help='
|
100
|
+
help='Manage testcases (sub-command).',
|
101
|
+
rich_help_panel='Management',
|
89
102
|
)
|
90
103
|
|
91
104
|
|
92
105
|
@app.callback()
|
93
|
-
def main(
|
106
|
+
def main(
|
107
|
+
sanitized: bool = typer.Option(
|
108
|
+
False,
|
109
|
+
'--sanitized',
|
110
|
+
'-s',
|
111
|
+
help='Whether to compile and run testlib components with sanitizers enabled. '
|
112
|
+
'If you want to run the solutions with sanitizers enabled, use the "-s" flag in the corresponding run command.',
|
113
|
+
),
|
114
|
+
):
|
94
115
|
state.STATE.run_through_cli = True
|
116
|
+
state.STATE.sanitized = sanitized
|
117
|
+
if sanitized:
|
118
|
+
console.console.print(
|
119
|
+
'[warning]Sanitizers are running just for testlib components.\n'
|
120
|
+
'If you want to run the solutions with sanitizers enabled, use the [item]-s[/item] flag in the corresponding run command.[/warning]'
|
121
|
+
)
|
95
122
|
|
96
123
|
|
97
124
|
# @app.command('ui', hidden=True)
|
@@ -100,7 +127,11 @@ def main():
|
|
100
127
|
# ui_pkg.start()
|
101
128
|
|
102
129
|
|
103
|
-
@app.command(
|
130
|
+
@app.command(
|
131
|
+
'edit, e',
|
132
|
+
rich_help_panel='Configuration',
|
133
|
+
help='Open problem.rbx.yml in your default editor.',
|
134
|
+
)
|
104
135
|
@package.within_problem
|
105
136
|
def edit():
|
106
137
|
console.console.print('Opening problem definition in editor...')
|
@@ -110,7 +141,9 @@ def edit():
|
|
110
141
|
config.open_editor(package.find_problem_yaml() or pathlib.Path())
|
111
142
|
|
112
143
|
|
113
|
-
@app.command(
|
144
|
+
@app.command(
|
145
|
+
'build, b', rich_help_panel='Deploying', help='Build all tests for the problem.'
|
146
|
+
)
|
114
147
|
@package.within_problem
|
115
148
|
def build(verification: environment.VerificationParam):
|
116
149
|
from rbx.box import builder
|
@@ -118,7 +151,11 @@ def build(verification: environment.VerificationParam):
|
|
118
151
|
builder.build(verification=verification)
|
119
152
|
|
120
153
|
|
121
|
-
@app.command(
|
154
|
+
@app.command(
|
155
|
+
'run, r',
|
156
|
+
rich_help_panel='Testing',
|
157
|
+
help='Build and run solution(s).',
|
158
|
+
)
|
122
159
|
@package.within_problem
|
123
160
|
def run(
|
124
161
|
verification: environment.VerificationParam,
|
@@ -299,6 +336,7 @@ def _time_impl(check: bool, detailed: bool) -> Optional[int]:
|
|
299
336
|
|
300
337
|
@app.command(
|
301
338
|
'time, t',
|
339
|
+
rich_help_panel='Testing',
|
302
340
|
help='Estimate a time limit for the problem based on a time limit formula and timings of accepted solutions.',
|
303
341
|
)
|
304
342
|
@package.within_problem
|
@@ -333,7 +371,9 @@ def time(
|
|
333
371
|
|
334
372
|
|
335
373
|
@app.command(
|
336
|
-
'irun, ir',
|
374
|
+
'irun, ir',
|
375
|
+
rich_help_panel='Testing',
|
376
|
+
help='Build and run solution(s) by passing testcases in the CLI.',
|
337
377
|
)
|
338
378
|
@package.within_problem
|
339
379
|
def irun(
|
@@ -445,7 +485,11 @@ def irun(
|
|
445
485
|
)
|
446
486
|
|
447
487
|
|
448
|
-
@app.command(
|
488
|
+
@app.command(
|
489
|
+
'create, c',
|
490
|
+
rich_help_panel='Management',
|
491
|
+
help='Create a new problem package.',
|
492
|
+
)
|
449
493
|
def create(
|
450
494
|
name: str,
|
451
495
|
preset: Annotated[
|
@@ -467,7 +511,11 @@ def create(
|
|
467
511
|
creation.create(name)
|
468
512
|
|
469
513
|
|
470
|
-
@app.command(
|
514
|
+
@app.command(
|
515
|
+
'stress',
|
516
|
+
rich_help_panel='Testing',
|
517
|
+
help='Run a stress test.',
|
518
|
+
)
|
471
519
|
@package.within_problem
|
472
520
|
def stress(
|
473
521
|
name: Annotated[
|
@@ -621,7 +669,11 @@ def stress(
|
|
621
669
|
break
|
622
670
|
|
623
671
|
|
624
|
-
@app.command(
|
672
|
+
@app.command(
|
673
|
+
'compile',
|
674
|
+
rich_help_panel='Testing',
|
675
|
+
help='Compile an asset given its path.',
|
676
|
+
)
|
625
677
|
@package.within_problem
|
626
678
|
def compile_command(
|
627
679
|
path: Annotated[
|
@@ -652,7 +704,11 @@ def compile_command(
|
|
652
704
|
compile.any(path, sanitized, warnings)
|
653
705
|
|
654
706
|
|
655
|
-
@app.command(
|
707
|
+
@app.command(
|
708
|
+
'validate',
|
709
|
+
rich_help_panel='Testing',
|
710
|
+
help='Run the validator in a one-off fashion, interactively.',
|
711
|
+
)
|
656
712
|
@package.within_problem
|
657
713
|
def validate(
|
658
714
|
path: Annotated[
|
@@ -685,7 +741,11 @@ def validate(
|
|
685
741
|
validators.print_validation_report([info])
|
686
742
|
|
687
743
|
|
688
|
-
@app.command(
|
744
|
+
@app.command(
|
745
|
+
'environment, env',
|
746
|
+
rich_help_panel='Configuration',
|
747
|
+
help='Set or show the current box environment.',
|
748
|
+
)
|
689
749
|
def environment_command(
|
690
750
|
env: Annotated[Optional[str], typer.Argument()] = None,
|
691
751
|
install_from: Annotated[
|
@@ -730,6 +790,7 @@ def environment_command(
|
|
730
790
|
|
731
791
|
@app.command(
|
732
792
|
'activate',
|
793
|
+
rich_help_panel='Configuration',
|
733
794
|
help='Activate the environment of the current preset used by the package.',
|
734
795
|
)
|
735
796
|
@cd.within_closest_package
|
@@ -764,7 +825,11 @@ def activate():
|
|
764
825
|
console.console.print(f'[success]Preset [item]{preset.name}[/item] is activated.')
|
765
826
|
|
766
827
|
|
767
|
-
@app.command(
|
828
|
+
@app.command(
|
829
|
+
'languages',
|
830
|
+
rich_help_panel='Configuration',
|
831
|
+
help='List the languages available in this environment',
|
832
|
+
)
|
768
833
|
def languages():
|
769
834
|
env = environment.get_environment()
|
770
835
|
|
@@ -780,7 +845,11 @@ def languages():
|
|
780
845
|
console.console.print()
|
781
846
|
|
782
847
|
|
783
|
-
@app.command(
|
848
|
+
@app.command(
|
849
|
+
'clear, clean',
|
850
|
+
rich_help_panel='Management',
|
851
|
+
help='Clears cache and build directories.',
|
852
|
+
)
|
784
853
|
@cd.within_closest_package
|
785
854
|
def clear():
|
786
855
|
console.console.print('Cleaning cache and build directories...')
|
rbx/box/solutions.py
CHANGED
@@ -635,13 +635,22 @@ async def run_and_print_interactive_solutions(
|
|
635
635
|
|
636
636
|
for item in items:
|
637
637
|
sol = pkg.solutions[item.solution_index]
|
638
|
-
|
639
|
-
|
638
|
+
|
639
|
+
if progress:
|
640
|
+
progress.update(f'Running [item]{sol.path}[/item]...')
|
640
641
|
|
641
642
|
eval = await item.eval()
|
642
643
|
|
644
|
+
with utils.no_progress(progress):
|
645
|
+
console.console.print(get_testcase_markup_verdict(eval), end=' ')
|
646
|
+
_print_solution_header(sol, console.console, is_irun=True)
|
647
|
+
_print_solution_outcome(
|
648
|
+
sol, [eval], console.console, verification, subset=True
|
649
|
+
)
|
650
|
+
|
643
651
|
stdout_path = eval.log.stdout_absolute_path
|
644
652
|
if print:
|
653
|
+
console.console.rule('Output', style='status')
|
645
654
|
if (
|
646
655
|
eval.testcase.output is not None
|
647
656
|
and stdout_path is not None
|
@@ -780,14 +789,17 @@ def _print_solution_outcome(
|
|
780
789
|
evals: List[Evaluation],
|
781
790
|
console: rich.console.Console,
|
782
791
|
verification: VerificationLevel = VerificationLevel.NONE,
|
792
|
+
subset: bool = False,
|
783
793
|
) -> bool:
|
784
794
|
pkg = package.find_problem_package_or_die()
|
785
795
|
|
786
796
|
has_plain_tle = False
|
797
|
+
all_verdicts = set()
|
787
798
|
bad_verdicts = set()
|
788
799
|
no_tle_bad_verdicts = set()
|
789
800
|
has_sanitizer_warnings = False
|
790
801
|
for eval in evals:
|
802
|
+
all_verdicts.add(eval.result.outcome)
|
791
803
|
if eval.result.outcome != Outcome.ACCEPTED:
|
792
804
|
bad_verdicts.add(eval.result.outcome)
|
793
805
|
if (
|
@@ -808,18 +820,27 @@ def _print_solution_outcome(
|
|
808
820
|
matched_bad_verdicts = bad_verdicts - unmatched_bad_verdicts
|
809
821
|
expected_outcome_is_bad = not solution.outcome.match(Outcome.ACCEPTED)
|
810
822
|
|
811
|
-
|
823
|
+
has_failed = unmatched_bad_verdicts or (
|
824
|
+
expected_outcome_is_bad and not matched_bad_verdicts and not subset
|
825
|
+
)
|
826
|
+
if has_failed:
|
812
827
|
console.print('[error]FAILED[/error]', end=' ')
|
813
828
|
else:
|
814
829
|
console.print('[success]OK[/success]', end=' ')
|
815
830
|
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
console.print(f'
|
821
|
-
|
822
|
-
|
831
|
+
if has_failed or not subset:
|
832
|
+
console.print(f'Expected: {solution.outcome}', end='')
|
833
|
+
elif subset:
|
834
|
+
all_verdicts_names = ' '.join(v.name for v in all_verdicts)
|
835
|
+
console.print(f'Got: {all_verdicts_names}', end='')
|
836
|
+
|
837
|
+
if has_failed or not subset:
|
838
|
+
# Only print verdicts if not subset.
|
839
|
+
if unmatched_bad_verdicts:
|
840
|
+
unmatched_bad_verdicts_names = set(v.name for v in unmatched_bad_verdicts)
|
841
|
+
console.print(f', got: {" ".join(unmatched_bad_verdicts_names)}', end='')
|
842
|
+
elif expected_outcome_is_bad and not matched_bad_verdicts and not subset:
|
843
|
+
console.print(f', got: {Outcome.ACCEPTED.name}', end='')
|
823
844
|
|
824
845
|
console.print()
|
825
846
|
evals_time = _get_evals_time_in_ms(evals)
|
rbx/box/state.py
CHANGED
@@ -5,7 +5,7 @@ rbx/box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
rbx/box/builder.py,sha256=qIXgV-div21Tw8knwCrTtHyDCgYwBrJc0I5b9KhZuKM,3577
|
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=
|
8
|
+
rbx/box/code.py,sha256=zkYWHXV4PxuAm3_4VtW9fptLQ34euI8BTAKNukXWCig,13437
|
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
|
@@ -25,7 +25,7 @@ rbx/box/generators.py,sha256=6hm1G4BHmq6Nmbbm2aXHewgVntEjQ5HJtPu6z-sTVrY,12163
|
|
25
25
|
rbx/box/generators_test.py,sha256=ZRqdolU7YE8HXjxr0met5oGn4DCJ5erdsMt5cSOoXIw,1945
|
26
26
|
rbx/box/lazy_importing_main.py,sha256=6Z8As7qVFFT619xHH9Xt8VCH57NjC4aDxfAgkWiUwT8,116
|
27
27
|
rbx/box/lazy_importing_test.py,sha256=B0-b3y_DkxEmtVfu4NfmVsgVdFl6kRCsEL6GLMHJISo,628
|
28
|
-
rbx/box/main.py,sha256=
|
28
|
+
rbx/box/main.py,sha256=fvT4tslHFKOvOebcukrhKc4-E1OT4hkvlObuzGuOJ4I,25975
|
29
29
|
rbx/box/package.py,sha256=80SDHvSzfraCUYutMn_kwsFsmmrSZiaeRHhhrWGmIY4,12081
|
30
30
|
rbx/box/packaging/boca/extension.py,sha256=hQhcbocNfW2ESv5RalS1wf6uvOoOfOnR_gHvbXUbSzY,852
|
31
31
|
rbx/box/packaging/boca/packager.py,sha256=FOhSRg5K5Y4qNB0WyTR3DKgrpObf9I0JbyGpJHOtxpo,10673
|
@@ -43,9 +43,9 @@ rbx/box/retries.py,sha256=z7cIh1QmLVUsTr3Attt_28dbwNg6KWTwpulcWCFwMPo,4667
|
|
43
43
|
rbx/box/sanitizers/warning_stack.py,sha256=RI97_GJgdjTKIXY_r0EKp5h0qQQSDSdNDh5K7zINrqs,2861
|
44
44
|
rbx/box/schema.py,sha256=I7Uh_KXBqAX8fHZr4s9LGPEFHxyBttoLSq_hYJefwto,14581
|
45
45
|
rbx/box/setter_config.py,sha256=s53talhwM6FTGDCcBhY7IlZ6_6mJ3PMp6V4kTtaSs50,4262
|
46
|
-
rbx/box/solutions.py,sha256=
|
46
|
+
rbx/box/solutions.py,sha256=IggS2QdOkHuz6G7i2eI32ILT7G5FZL0cy49xnPtAGb8,44818
|
47
47
|
rbx/box/solutions_test.py,sha256=txjAg-n_pkHHolw4WF4foBrpJAL-llAXw6fUIrGURMc,1716
|
48
|
-
rbx/box/state.py,sha256=
|
48
|
+
rbx/box/state.py,sha256=cBeEkJXSXLwYmCT0yLq2TjycusKFpjOeW8yPRIi6K-o,137
|
49
49
|
rbx/box/statements/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
50
50
|
rbx/box/statements/build_statements.py,sha256=S23fqp6kmw97PAfk5zn2MVK8BhH1wjRMm2-kKdAOwlI,12052
|
51
51
|
rbx/box/statements/builders.py,sha256=L67i-CP6ftDm2wR6VWywTd3ad7-fhWSSMfaN66Gt13s,11201
|
@@ -170,8 +170,8 @@ rbx/testdata/caching/executable.py,sha256=WKRHNf_fprFJd1Fq1ubmQtR3mZzTYVNwKPLWuZ
|
|
170
170
|
rbx/testdata/compatible,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
171
171
|
rbx/testing_utils.py,sha256=ZXMysGXpTtvS1lfLL38FuD5iSIyxi3ARjQePDrUmEtc,2067
|
172
172
|
rbx/utils.py,sha256=6e1eXRzNE-52D0UVtqclePxqR4Haiqt8qWCrSVjnGuE,4585
|
173
|
-
rbx_cp-0.5.
|
174
|
-
rbx_cp-0.5.
|
175
|
-
rbx_cp-0.5.
|
176
|
-
rbx_cp-0.5.
|
177
|
-
rbx_cp-0.5.
|
173
|
+
rbx_cp-0.5.39.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
174
|
+
rbx_cp-0.5.39.dist-info/METADATA,sha256=Rwolc3QtBp6a9xSnOTeCjDO_yLy4JTB9CG5IAL2GTFE,3263
|
175
|
+
rbx_cp-0.5.39.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
176
|
+
rbx_cp-0.5.39.dist-info/entry_points.txt,sha256=qBTLBOeifT1F00LWaEewRRE_jQPgvH7BUdJfZ-dYsFU,57
|
177
|
+
rbx_cp-0.5.39.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|