rbx.cp 0.12.0__tar.gz → 0.13.2__tar.gz
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_cp-0.12.0 → rbx_cp-0.13.2}/PKG-INFO +2 -2
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/pyproject.toml +2 -2
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/cli.py +9 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/generators.py +41 -13
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/header.py +5 -0
- rbx_cp-0.13.2/rbx/box/lang.py +40 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/contest_main.py +40 -7
- rbx_cp-0.13.2/rbx/box/packaging/importer.py +37 -0
- rbx_cp-0.13.2/rbx/box/packaging/main.py +98 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/packager.py +95 -2
- rbx_cp-0.13.2/rbx/box/packaging/polygon/importer.py +232 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/polygon/packager.py +36 -5
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/polygon/upload.py +32 -11
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/polygon/xml_schema.py +15 -6
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/stresses.py +1 -1
- rbx_cp-0.13.2/rbx/box/tooling/converter.py +76 -0
- rbx_cp-0.13.2/rbx/box/tooling/main.py +61 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/problem.rbx.yml +1 -4
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/testplan/random.py +1 -1
- rbx_cp-0.13.2/rbx/resources/presets/default/problem/testplan/random.txt +2 -0
- rbx_cp-0.12.0/rbx/box/lang.py +0 -27
- rbx_cp-0.12.0/rbx/box/packaging/main.py +0 -145
- rbx_cp-0.12.0/rbx/box/tooling/main.py +0 -8
- rbx_cp-0.12.0/rbx/resources/presets/default/problem/testplan/random.txt +0 -4
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/LICENSE +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/README.md +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/annotations.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/autoenum.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/builder.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/cd.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/checkers.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/code.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/compile.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/conftest.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/contest/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/contest/build_contest_statements.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/contest/contest_package.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/contest/contest_utils.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/contest/main.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/contest/schema.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/contest/statements.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/creation.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/deferred.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/download.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/dump_schemas.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/environment.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/extensions.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/fields.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/formatting.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/generators_test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/git_utils.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/global_package.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/lazy_importing_main.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/lazy_importing_test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/linting.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/main.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/naming.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/package.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/boca/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/boca/extension.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/boca/packager.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/moj/packager.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/pkg/packager.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/polygon/polygon_api.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/packaging/polygon/test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/presets/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/presets/fetch.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/presets/lock_schema.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/presets/schema.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/remote.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/retries.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/sanitizers/warning_stack.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/schema.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/setter_config.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/solutions.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/solutions_test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/state.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/build_statements.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/builders.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/expander.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/joiners.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/latex.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/latex_jinja.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/statements/schema.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/stats.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/stressing/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/stressing/finder_parser.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/stressing/generator_parser.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/tasks.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/testcase_extractors.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/testcase_utils.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/testcases/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/testcases/main.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/tooling/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/tooling/boca/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/tooling/boca/main.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/tooling/boca/scrape.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/tooling/boca/scraper.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/captured_log.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/css/app.tcss +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/main.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/build.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/command.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/differ.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/error.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/rich_log_modal.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/run.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/run_explorer.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/run_test_explorer.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/selector.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/screens/test_explorer.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/utils/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/utils/run_ui.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/widgets/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/widgets/diff_box.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/widgets/file_log.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/widgets/interaction_box.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/widgets/rich_log_box.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/widgets/test_output_box.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/ui/widgets/two_sided_test_output_box.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/unit.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/validators.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/box/validators_test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/checker.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/clone.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/config.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/conftest.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/console.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/create.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/edit.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/caching.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/conftest.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/debug_context.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/grading_context.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/cacher.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/digester.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/sandbox.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/sandboxes/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/sandboxes/isolate.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/sandboxes/stupid_sandbox.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/sandboxes/timeit.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/storage.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/judge/testiso.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/limits.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/processing_context.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/profiling.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/steps.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/steps_with_caching.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading/steps_with_caching_run_test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/grading_utils.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/hydration.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/main.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/metadata.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/providers/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/providers/codeforces.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/providers/provider.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/checkers/boilerplate.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/checkers/noop.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/default_config.json +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/default_setter_config.mac.yml +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/default_setter_config.yml +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/envs/default.rbx.yml +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/envs/isolate.rbx.yml +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/checker.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compare.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compile/c +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compile/cc +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compile/cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compile/java +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compile/kt +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compile/py2 +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/compile/py3 +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactive/c +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactive/cc +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactive/cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactive/java +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactive/kt +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactive/py2 +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactive/py3 +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactor_compile.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/interactor_run.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/bkp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/c +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/cc +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/java +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/kt +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/py2 +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/run/py3 +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/safeexec.c +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/boca/safeexec_compile.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/c/compile.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/c/prep.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/c/run.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/compare.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/cpp/compile.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/cpp/prep.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/cpp/run.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/interactor_prep.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/interactor_run.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/java/compile.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/java/prep.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/java/run.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/py2/compile.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/py2/prep.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/py2/run.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/py3/compile.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/py3/prep.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/packagers/moj/scripts/py3/run.sh +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/contest/.gitignore +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/contest/contest.rbx.yml +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/contest/statement/contest.rbx.tex +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/contest/statement/instructions.tex +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/contest/statement/logo.png +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/env.rbx.yml +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/preset.rbx.yml +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/.gitignore +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/gens/gen.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/manual_tests/samples/000.in +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/manual_tests/samples/001.in +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/rbx.h +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/sols/main.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/sols/slow.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/sols/wa.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/statement/statement.rbx.tex +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/validator.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/problem/wcmp.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/shared/contest_template.rbx.tex +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/shared/icpc.sty +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/presets/default/shared/problem_template.rbx.tex +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/templates/rbx.h +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/resources/templates/template.cpp +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/run.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/schema.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/submit.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/submitors/__init__.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/submitors/codeforces.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/submitors/submitor.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/test.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/testcase.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/testcase_rendering.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/testing_utils.py +0 -0
- {rbx_cp-0.12.0 → rbx_cp-0.13.2}/rbx/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: rbx.cp
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.13.2
|
4
4
|
Summary:
|
5
5
|
Author: Roberto Sales
|
6
6
|
Requires-Python: >=3.9.1,<4.0.0
|
@@ -20,6 +20,7 @@ Requires-Dist: fastapi (>=0.115.8,<0.116.0)
|
|
20
20
|
Requires-Dist: filelock (>=3.14.0,<4.0.0)
|
21
21
|
Requires-Dist: gitignore-parser (>=0.1.12,<0.2.0)
|
22
22
|
Requires-Dist: gitpython (>=3.1.43,<4.0.0)
|
23
|
+
Requires-Dist: iso639-lang (>=2.6.1,<3.0.0)
|
23
24
|
Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
|
24
25
|
Requires-Dist: lark (>=1.2.2,<2.0.0)
|
25
26
|
Requires-Dist: latexbuild (>=0.2.2,<0.3.0)
|
@@ -33,7 +34,6 @@ Requires-Dist: pydantic (==2.8.2)
|
|
33
34
|
Requires-Dist: pydantic-xml[lxml] (>=2.11.0,<3.0.0)
|
34
35
|
Requires-Dist: pypandoc (>=1.15,<2.0)
|
35
36
|
Requires-Dist: pyte (>=0.8.2,<0.9.0)
|
36
|
-
Requires-Dist: python-iso639 (>=2024.4.27,<2025.0.0)
|
37
37
|
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
38
38
|
Requires-Dist: questionary (>=2.1.0,<3.0.0)
|
39
39
|
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "rbx.cp"
|
3
|
-
version = "0.
|
3
|
+
version = "0.13.2"
|
4
4
|
description = ""
|
5
5
|
packages = [
|
6
6
|
{include = "rbx"}
|
@@ -24,7 +24,6 @@ pyyaml = "^6.0.1"
|
|
24
24
|
requests = "^2.32.3"
|
25
25
|
latexbuild = "^0.2.2"
|
26
26
|
pydantic-xml = {extras = ["lxml"], version = "^2.11.0"}
|
27
|
-
python-iso639 = "^2024.4.27"
|
28
27
|
more-itertools = "^10.5.0"
|
29
28
|
gitpython = "^3.1.43"
|
30
29
|
textual = "^3.1.1"
|
@@ -49,6 +48,7 @@ lz4 = "^4.4.4"
|
|
49
48
|
ordered-set = "^4.1.0"
|
50
49
|
gitignore-parser = "^0.1.12"
|
51
50
|
pypandoc = "^1.15"
|
51
|
+
iso639-lang = "^2.6.1"
|
52
52
|
|
53
53
|
[tool.poetry.scripts]
|
54
54
|
rbc = "rbx.main:app"
|
@@ -186,6 +186,15 @@ def on(ctx: typer.Context, problems: str) -> None:
|
|
186
186
|
contest.on(ctx, problems)
|
187
187
|
|
188
188
|
|
189
|
+
@app.command(
|
190
|
+
'each',
|
191
|
+
help='Run a command for each problem in the contest.',
|
192
|
+
context_settings={'allow_extra_args': True, 'ignore_unknown_options': True},
|
193
|
+
)
|
194
|
+
def each(ctx: typer.Context) -> None:
|
195
|
+
contest.each(ctx)
|
196
|
+
|
197
|
+
|
189
198
|
@app.command('diff', hidden=True)
|
190
199
|
def diff(path1: pathlib.Path, path2: pathlib.Path):
|
191
200
|
from rbx.box.ui import main as ui_pkg
|
@@ -97,7 +97,10 @@ def _copy_testcase_over(
|
|
97
97
|
|
98
98
|
|
99
99
|
def _copy_testcase_output_over(
|
100
|
-
src_output_path: pathlib.Path,
|
100
|
+
src_output_path: pathlib.Path,
|
101
|
+
dest_output_path: pathlib.Path,
|
102
|
+
suffix: str,
|
103
|
+
dry_run: bool = False,
|
101
104
|
) -> bool:
|
102
105
|
dest_output_path.parent.mkdir(parents=True, exist_ok=True)
|
103
106
|
|
@@ -105,41 +108,64 @@ def _copy_testcase_output_over(
|
|
105
108
|
if not src_path.is_file():
|
106
109
|
return False
|
107
110
|
|
108
|
-
|
111
|
+
if dry_run:
|
112
|
+
return True
|
109
113
|
|
114
|
+
_check_crlf(src_path)
|
110
115
|
shutil.copy(str(src_path), str(dest_output_path.with_suffix(suffix)))
|
111
116
|
return True
|
112
117
|
|
113
118
|
|
114
119
|
def _copy_testcase_outputs_over(
|
115
|
-
testcase: Testcase, dest: Testcase, pipes: bool = False
|
120
|
+
testcase: Testcase, dest: Testcase, pipes: bool = False, dry_run: bool = False
|
116
121
|
):
|
117
122
|
assert dest.outputPath is not None
|
118
|
-
|
123
|
+
if not dry_run:
|
124
|
+
dest.outputPath.parent.mkdir(parents=True, exist_ok=True)
|
119
125
|
|
120
126
|
has_copied = False
|
121
127
|
|
122
128
|
if testcase.outputPath is not None and testcase.outputPath.is_file():
|
123
|
-
|
124
|
-
|
129
|
+
if not dry_run:
|
130
|
+
_check_crlf(testcase.outputPath)
|
131
|
+
shutil.copy(str(testcase.outputPath), str(dest.outputPath))
|
125
132
|
has_copied = True
|
126
133
|
|
127
134
|
if not pipes:
|
128
135
|
return has_copied
|
129
136
|
|
130
137
|
reference_path = testcase.outputPath or testcase.inputPath
|
131
|
-
if _copy_testcase_output_over(
|
138
|
+
if _copy_testcase_output_over(
|
139
|
+
reference_path, dest.outputPath, '.pin', dry_run=dry_run
|
140
|
+
):
|
132
141
|
has_copied = True
|
133
142
|
|
134
|
-
if _copy_testcase_output_over(
|
143
|
+
if _copy_testcase_output_over(
|
144
|
+
reference_path, dest.outputPath, '.pout', dry_run=dry_run
|
145
|
+
):
|
135
146
|
has_copied = True
|
136
147
|
|
137
|
-
if _copy_testcase_output_over(
|
148
|
+
if _copy_testcase_output_over(
|
149
|
+
reference_path, dest.outputPath, '.pio', dry_run=dry_run
|
150
|
+
):
|
138
151
|
has_copied = True
|
139
152
|
|
140
153
|
return has_copied
|
141
154
|
|
142
155
|
|
156
|
+
def _needs_output(generation_entries: List[GenerationTestcaseEntry]) -> bool:
|
157
|
+
for entry in generation_entries:
|
158
|
+
tc = entry.metadata.copied_to
|
159
|
+
if not tc.inputPath.is_file():
|
160
|
+
continue
|
161
|
+
if entry.metadata.copied_from is not None and _copy_testcase_outputs_over(
|
162
|
+
entry.metadata.copied_from, tc, dry_run=True
|
163
|
+
):
|
164
|
+
continue
|
165
|
+
return True
|
166
|
+
return False
|
167
|
+
|
168
|
+
|
143
169
|
def get_all_built_testcases() -> Dict[str, List[Testcase]]:
|
144
170
|
pkg = package.find_problem_package_or_die()
|
145
171
|
res = {group.name: find_built_testcases(group) for group in pkg.testcases}
|
@@ -395,17 +421,20 @@ async def generate_outputs_for_testcases(
|
|
395
421
|
if progress is not None:
|
396
422
|
progress.step()
|
397
423
|
|
424
|
+
generation_entries = await extract_generation_testcases(entries)
|
425
|
+
needs_output = _needs_output(generation_entries)
|
426
|
+
|
398
427
|
main_solution = package.get_main_solution()
|
399
428
|
solution_digest: Optional[str] = None
|
400
429
|
|
401
430
|
pkg = package.find_problem_package_or_die()
|
402
431
|
|
403
|
-
if pkg.type == TaskType.COMMUNICATION:
|
432
|
+
if pkg.type == TaskType.COMMUNICATION and needs_output:
|
404
433
|
interactor_digest = checkers.compile_interactor(progress)
|
405
434
|
else:
|
406
435
|
interactor_digest = None
|
407
436
|
|
408
|
-
if main_solution is not None:
|
437
|
+
if main_solution is not None and needs_output:
|
409
438
|
if progress:
|
410
439
|
progress.update('Compiling main solution...')
|
411
440
|
try:
|
@@ -418,8 +447,6 @@ async def generate_outputs_for_testcases(
|
|
418
447
|
shutil.rmtree(str(gen_runs_dir), ignore_errors=True)
|
419
448
|
gen_runs_dir.mkdir(parents=True, exist_ok=True)
|
420
449
|
|
421
|
-
generation_entries = await extract_generation_testcases(entries)
|
422
|
-
|
423
450
|
for entry in generation_entries:
|
424
451
|
tc = entry.metadata.copied_to
|
425
452
|
if not tc.inputPath.is_file():
|
@@ -434,6 +461,7 @@ async def generate_outputs_for_testcases(
|
|
434
461
|
step()
|
435
462
|
continue
|
436
463
|
|
464
|
+
assert needs_output
|
437
465
|
if (
|
438
466
|
main_solution is None or solution_digest is None
|
439
467
|
) and not tc.outputPath.is_file():
|
@@ -16,6 +16,11 @@ def get_header() -> pathlib.Path:
|
|
16
16
|
|
17
17
|
|
18
18
|
def generate_header():
|
19
|
+
override_header = pathlib.Path('rbx.override.h')
|
20
|
+
if override_header.is_file():
|
21
|
+
pathlib.Path('rbx.h').write_bytes(override_header.read_bytes())
|
22
|
+
return
|
23
|
+
|
19
24
|
with importlib.resources.as_file(
|
20
25
|
importlib.resources.files('rbx') / 'resources' / 'templates' / 'rbx.h'
|
21
26
|
) as file:
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import functools
|
2
|
+
from typing import Dict, List
|
3
|
+
|
4
|
+
import iso639
|
5
|
+
|
6
|
+
|
7
|
+
@functools.cache
|
8
|
+
def _get_lowercase_name_mapping() -> Dict[str, iso639.Lang]:
|
9
|
+
res = {}
|
10
|
+
for lang in iso639.iter_langs():
|
11
|
+
res[lang.name.lower()] = lang
|
12
|
+
return res
|
13
|
+
|
14
|
+
|
15
|
+
def _get_lang_name(lang: str) -> str:
|
16
|
+
mapping = _get_lowercase_name_mapping()
|
17
|
+
if lang.lower() in mapping:
|
18
|
+
return mapping[lang.lower()].name
|
19
|
+
return lang
|
20
|
+
|
21
|
+
|
22
|
+
def code_to_lang(lang: str) -> str:
|
23
|
+
return iso639.Lang(lang).name.lower()
|
24
|
+
|
25
|
+
|
26
|
+
def code_to_langs(langs: List[str]) -> List[str]:
|
27
|
+
return [code_to_lang(lang) for lang in langs]
|
28
|
+
|
29
|
+
|
30
|
+
@functools.cache
|
31
|
+
def is_valid_lang_code(lang: str) -> bool:
|
32
|
+
return iso639.is_language(lang)
|
33
|
+
|
34
|
+
|
35
|
+
def lang_to_code(lang: str) -> str:
|
36
|
+
return iso639.Lang(_get_lang_name(lang)).pt1
|
37
|
+
|
38
|
+
|
39
|
+
def langs_to_code(langs: List[str]) -> List[str]:
|
40
|
+
return [lang_to_code(lang) for lang in langs]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import pathlib
|
2
2
|
import tempfile
|
3
|
-
from typing import Type
|
3
|
+
from typing import Optional, Type
|
4
4
|
|
5
5
|
import syncer
|
6
6
|
import typer
|
@@ -8,12 +8,13 @@ import typer
|
|
8
8
|
from rbx import annotations, console
|
9
9
|
from rbx.box import cd, environment, package
|
10
10
|
from rbx.box.contest import build_contest_statements, contest_package
|
11
|
-
from rbx.box.packaging.main import run_packager
|
12
11
|
from rbx.box.packaging.packager import (
|
13
12
|
BaseContestPackager,
|
14
13
|
BasePackager,
|
15
14
|
BuiltContestStatement,
|
16
15
|
BuiltProblemPackage,
|
16
|
+
ContestZipper,
|
17
|
+
run_packager,
|
17
18
|
)
|
18
19
|
|
19
20
|
app = typer.Typer(no_args_is_help=True, cls=annotations.AliasGroup)
|
@@ -23,6 +24,7 @@ async def run_contest_packager(
|
|
23
24
|
contest_packager_cls: Type[BaseContestPackager],
|
24
25
|
packager_cls: Type[BasePackager],
|
25
26
|
verification: environment.VerificationParam,
|
27
|
+
**kwargs,
|
26
28
|
):
|
27
29
|
contest = contest_package.find_contest_package_or_die()
|
28
30
|
|
@@ -34,7 +36,9 @@ async def run_contest_packager(
|
|
34
36
|
)
|
35
37
|
with cd.new_package_cd(problem.get_path()):
|
36
38
|
package.clear_package_cache()
|
37
|
-
package_path = await run_packager(
|
39
|
+
package_path = await run_packager(
|
40
|
+
packager_cls, verification=verification, **kwargs
|
41
|
+
)
|
38
42
|
built_packages.append(
|
39
43
|
BuiltProblemPackage(
|
40
44
|
path=problem.get_path() / package_path,
|
@@ -44,7 +48,7 @@ async def run_contest_packager(
|
|
44
48
|
)
|
45
49
|
|
46
50
|
# Build statements.
|
47
|
-
packager = contest_packager_cls()
|
51
|
+
packager = contest_packager_cls(**kwargs)
|
48
52
|
statement_types = packager.statement_types()
|
49
53
|
built_statements = []
|
50
54
|
|
@@ -63,12 +67,12 @@ async def run_contest_packager(
|
|
63
67
|
|
64
68
|
# Build contest-level package.
|
65
69
|
with tempfile.TemporaryDirectory() as td:
|
66
|
-
packager.package(
|
70
|
+
result_path = packager.package(
|
67
71
|
built_packages, pathlib.Path('build'), pathlib.Path(td), built_statements
|
68
72
|
)
|
69
73
|
|
70
74
|
console.console.print(
|
71
|
-
f'[success]
|
75
|
+
f'[success]Created contest package for [item]{packager.name()}[/item] at [item]{result_path}[/item]![/success]'
|
72
76
|
)
|
73
77
|
|
74
78
|
|
@@ -77,6 +81,12 @@ async def run_contest_packager(
|
|
77
81
|
@syncer.sync
|
78
82
|
async def polygon(
|
79
83
|
verification: environment.VerificationParam,
|
84
|
+
language: Optional[str] = typer.Option(
|
85
|
+
None,
|
86
|
+
'--language',
|
87
|
+
'-l',
|
88
|
+
help='If set, will use the given language as the main language.',
|
89
|
+
),
|
80
90
|
):
|
81
91
|
from rbx.box.packaging.polygon.packager import (
|
82
92
|
PolygonContestPackager,
|
@@ -84,7 +94,30 @@ async def polygon(
|
|
84
94
|
)
|
85
95
|
|
86
96
|
await run_contest_packager(
|
87
|
-
PolygonContestPackager,
|
97
|
+
PolygonContestPackager,
|
98
|
+
PolygonPackager,
|
99
|
+
verification=verification,
|
100
|
+
main_language=language,
|
101
|
+
)
|
102
|
+
|
103
|
+
|
104
|
+
@app.command('boca', help='Build a contest package for BOCA.')
|
105
|
+
@contest_package.within_contest
|
106
|
+
@syncer.sync
|
107
|
+
async def boca(
|
108
|
+
verification: environment.VerificationParam,
|
109
|
+
):
|
110
|
+
from rbx.box.packaging.boca.packager import BocaPackager
|
111
|
+
|
112
|
+
class BocaContestPackager(ContestZipper):
|
113
|
+
def __init__(self, **kwargs):
|
114
|
+
super().__init__('boca-contest', zip_inner=True, **kwargs)
|
115
|
+
|
116
|
+
def name(self) -> str:
|
117
|
+
return 'boca'
|
118
|
+
|
119
|
+
await run_contest_packager(
|
120
|
+
BocaContestPackager, BocaPackager, verification=verification
|
88
121
|
)
|
89
122
|
|
90
123
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import pathlib
|
2
|
+
from abc import ABC, abstractmethod
|
3
|
+
from typing import Type
|
4
|
+
|
5
|
+
from rbx import console
|
6
|
+
|
7
|
+
|
8
|
+
class BaseImporter(ABC):
|
9
|
+
@classmethod
|
10
|
+
@abstractmethod
|
11
|
+
def name(cls) -> str:
|
12
|
+
pass
|
13
|
+
|
14
|
+
@abstractmethod
|
15
|
+
async def import_package(self, pkg_path: pathlib.Path, into_path: pathlib.Path):
|
16
|
+
pass
|
17
|
+
|
18
|
+
|
19
|
+
class BaseContestImporter(ABC):
|
20
|
+
@classmethod
|
21
|
+
@abstractmethod
|
22
|
+
def name(cls) -> str:
|
23
|
+
pass
|
24
|
+
|
25
|
+
@abstractmethod
|
26
|
+
async def import_package(self, pkg_path: pathlib.Path, into_path: pathlib.Path):
|
27
|
+
pass
|
28
|
+
|
29
|
+
|
30
|
+
async def run_importer(
|
31
|
+
importer_cls: Type[BaseImporter], pkg_path: pathlib.Path, into_path: pathlib.Path
|
32
|
+
):
|
33
|
+
importer = importer_cls()
|
34
|
+
console.console.print(
|
35
|
+
f'Importing package from [item]{pkg_path}[/item] to [item]{into_path}[/item] with [item]{importer.name()}[/item]...'
|
36
|
+
)
|
37
|
+
await importer.import_package(pkg_path, into_path)
|
@@ -0,0 +1,98 @@
|
|
1
|
+
from typing import Optional
|
2
|
+
|
3
|
+
import syncer
|
4
|
+
import typer
|
5
|
+
|
6
|
+
from rbx import annotations
|
7
|
+
from rbx.box import environment, package
|
8
|
+
from rbx.box.naming import get_problem_name_with_contest_info
|
9
|
+
from rbx.box.packaging.packager import run_packager
|
10
|
+
|
11
|
+
app = typer.Typer(no_args_is_help=True, cls=annotations.AliasGroup)
|
12
|
+
|
13
|
+
|
14
|
+
@app.command('polygon', help='Build a package for Polygon.')
|
15
|
+
@package.within_problem
|
16
|
+
@syncer.sync
|
17
|
+
async def polygon(
|
18
|
+
verification: environment.VerificationParam,
|
19
|
+
upload: bool = typer.Option(
|
20
|
+
False,
|
21
|
+
'--upload',
|
22
|
+
'-u',
|
23
|
+
help='If set, will upload the package to Polygon.',
|
24
|
+
),
|
25
|
+
language: Optional[str] = typer.Option(
|
26
|
+
None,
|
27
|
+
'--language',
|
28
|
+
'-l',
|
29
|
+
help='If set, will use the given language as the main language.',
|
30
|
+
),
|
31
|
+
upload_as_english: bool = typer.Option(
|
32
|
+
False,
|
33
|
+
'--upload-as-english',
|
34
|
+
help='If set, will force the main statement to be uploaded in English.',
|
35
|
+
),
|
36
|
+
):
|
37
|
+
from rbx.box.packaging.polygon.packager import PolygonPackager
|
38
|
+
|
39
|
+
await run_packager(
|
40
|
+
PolygonPackager, verification=verification, main_language=language
|
41
|
+
)
|
42
|
+
|
43
|
+
if upload:
|
44
|
+
from rbx.box.packaging.polygon.upload import upload_problem
|
45
|
+
|
46
|
+
await upload_problem(
|
47
|
+
name=get_problem_name_with_contest_info(),
|
48
|
+
main_language=language,
|
49
|
+
upload_as_english=upload_as_english,
|
50
|
+
)
|
51
|
+
|
52
|
+
|
53
|
+
@app.command('boca', help='Build a package for BOCA.')
|
54
|
+
@package.within_problem
|
55
|
+
@syncer.sync
|
56
|
+
async def boca(
|
57
|
+
verification: environment.VerificationParam,
|
58
|
+
upload: bool = typer.Option(
|
59
|
+
False,
|
60
|
+
'--upload',
|
61
|
+
'-u',
|
62
|
+
help='If set, will upload the package to BOCA.',
|
63
|
+
),
|
64
|
+
):
|
65
|
+
from rbx.box.packaging.boca.packager import BocaPackager
|
66
|
+
|
67
|
+
result_path = await run_packager(BocaPackager, verification=verification)
|
68
|
+
|
69
|
+
if upload:
|
70
|
+
from rbx.box.tooling.boca.scraper import get_boca_scraper
|
71
|
+
|
72
|
+
uploader = get_boca_scraper()
|
73
|
+
uploader.login_and_upload(result_path)
|
74
|
+
|
75
|
+
|
76
|
+
@app.command('moj', help='Build a package for MOJ.')
|
77
|
+
@package.within_problem
|
78
|
+
@syncer.sync
|
79
|
+
async def moj(
|
80
|
+
verification: environment.VerificationParam,
|
81
|
+
for_boca: bool = typer.Option(
|
82
|
+
False, help='Build a package for BOCA instead of MOJ.'
|
83
|
+
),
|
84
|
+
):
|
85
|
+
from rbx.box.packaging.moj.packager import MojPackager
|
86
|
+
|
87
|
+
await run_packager(MojPackager, verification=verification, for_boca=for_boca)
|
88
|
+
|
89
|
+
|
90
|
+
@app.command('pkg', help='Build a package for PKG.')
|
91
|
+
@package.within_problem
|
92
|
+
@syncer.sync
|
93
|
+
async def pkg(
|
94
|
+
verification: environment.VerificationParam,
|
95
|
+
):
|
96
|
+
from rbx.box.packaging.pkg.packager import PkgPackager
|
97
|
+
|
98
|
+
await run_packager(PkgPackager, verification=verification)
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import dataclasses
|
2
2
|
import pathlib
|
3
|
+
import shutil
|
4
|
+
import tempfile
|
3
5
|
from abc import ABC, abstractmethod
|
4
|
-
from typing import List, Tuple
|
6
|
+
from typing import List, Tuple, Type
|
5
7
|
|
6
|
-
|
8
|
+
import typer
|
9
|
+
|
10
|
+
from rbx import console
|
11
|
+
from rbx.box import environment, header, naming, package
|
7
12
|
from rbx.box.contest import contest_package
|
8
13
|
from rbx.box.contest.schema import ContestProblem, ContestStatement
|
14
|
+
from rbx.box.formatting import href
|
9
15
|
from rbx.box.generators import get_all_built_testcases
|
10
16
|
from rbx.box.schema import Package, TaskType, Testcase, TestcaseGroup
|
17
|
+
from rbx.box.statements.build_statements import build_statement
|
11
18
|
from rbx.box.statements.schema import Statement, StatementType
|
12
19
|
|
13
20
|
|
@@ -127,3 +134,89 @@ class BaseContestPackager(ABC):
|
|
127
134
|
if statement.language == lang:
|
128
135
|
return statement
|
129
136
|
raise
|
137
|
+
|
138
|
+
|
139
|
+
class ContestZipper(BaseContestPackager):
|
140
|
+
def __init__(
|
141
|
+
self, filename: str, zip_inner: bool = False, prefer_shortname: bool = True
|
142
|
+
):
|
143
|
+
super().__init__()
|
144
|
+
self.zip_inner = zip_inner
|
145
|
+
self.filename = filename
|
146
|
+
self.prefer_shortname = prefer_shortname
|
147
|
+
|
148
|
+
def package(
|
149
|
+
self,
|
150
|
+
built_packages: List[BuiltProblemPackage],
|
151
|
+
build_path: pathlib.Path,
|
152
|
+
into_path: pathlib.Path,
|
153
|
+
built_statements: List[BuiltContestStatement],
|
154
|
+
) -> pathlib.Path:
|
155
|
+
for built_package in built_packages:
|
156
|
+
if self.prefer_shortname:
|
157
|
+
pkg_path = into_path / 'problems' / built_package.problem.short_name
|
158
|
+
else:
|
159
|
+
pkg_path = into_path / 'problems' / built_package.package.name
|
160
|
+
|
161
|
+
if self.zip_inner:
|
162
|
+
pkg_path.parent.mkdir(parents=True, exist_ok=True)
|
163
|
+
shutil.copy(built_package.path, pkg_path.with_suffix('.zip'))
|
164
|
+
else:
|
165
|
+
pkg_path.mkdir(parents=True, exist_ok=True)
|
166
|
+
shutil.unpack_archive(built_package.path, pkg_path, format='zip')
|
167
|
+
|
168
|
+
# Zip all.
|
169
|
+
shutil.make_archive(str(build_path / self.filename), 'zip', into_path)
|
170
|
+
|
171
|
+
return build_path / pathlib.Path(self.filename).with_suffix('.zip')
|
172
|
+
|
173
|
+
|
174
|
+
async def run_packager(
|
175
|
+
packager_cls: Type[BasePackager],
|
176
|
+
verification: environment.VerificationParam,
|
177
|
+
**kwargs,
|
178
|
+
) -> pathlib.Path:
|
179
|
+
from rbx.box import builder
|
180
|
+
|
181
|
+
header.generate_header()
|
182
|
+
|
183
|
+
if not await builder.verify(verification=verification):
|
184
|
+
console.console.print(
|
185
|
+
'[error]Build or verification failed, check the report.[/error]'
|
186
|
+
)
|
187
|
+
raise typer.Exit(1)
|
188
|
+
|
189
|
+
pkg = package.find_problem_package_or_die()
|
190
|
+
|
191
|
+
if pkg.type not in packager_cls.task_types():
|
192
|
+
console.console.print(
|
193
|
+
f'[error]Packager [item]{packager_cls.name()}[/item] does not support task type [item]{pkg.type}[/item].[/error]'
|
194
|
+
)
|
195
|
+
raise typer.Exit(1)
|
196
|
+
|
197
|
+
packager = packager_cls(**kwargs)
|
198
|
+
|
199
|
+
statement_types = packager.statement_types()
|
200
|
+
built_statements = []
|
201
|
+
|
202
|
+
for statement_type in statement_types:
|
203
|
+
languages = packager.languages()
|
204
|
+
for language in languages:
|
205
|
+
statement = packager.get_statement_for_language(language)
|
206
|
+
statement_path = build_statement(statement, pkg, statement_type)
|
207
|
+
built_statements.append(
|
208
|
+
BuiltStatement(statement, statement_path, statement_type)
|
209
|
+
)
|
210
|
+
|
211
|
+
console.console.print(f'Packaging problem for [item]{packager.name()}[/item]...')
|
212
|
+
|
213
|
+
with tempfile.TemporaryDirectory() as td:
|
214
|
+
result_path = packager.package(
|
215
|
+
package.get_build_path(), pathlib.Path(td), built_statements
|
216
|
+
)
|
217
|
+
|
218
|
+
console.console.print(
|
219
|
+
f'[success]Problem packaged for [item]{packager.name()}[/item]![/success]'
|
220
|
+
)
|
221
|
+
console.console.print(f'Package was saved at {href(result_path)}')
|
222
|
+
return result_path
|