codeplain 0.3.7__tar.gz → 0.3.9__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.
- {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/publish-install-script.yml +17 -0
- codeplain-0.3.9/.github/workflows/publish-to-pypi.yml +104 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/CLAUDE.md +6 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/PKG-INFO +4 -4
- {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/render_summary.py +2 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/status.py +2 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/codeplain_REST_api.py +6 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/docs/plain2code_cli.md +22 -20
- {codeplain-0.3.7 → codeplain-0.3.9}/docs/starting_a_plain_project_from_scratch.md +8 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/run.sh +2 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/run.sh +2 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/run.sh +1 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/git_utils.py +0 -10
- {codeplain-0.3.7 → codeplain-0.3.9}/install/bash/examples.sh +5 -11
- {codeplain-0.3.7 → codeplain-0.3.9}/install/bash/install.sh +3 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/install/powershell/examples.ps1 +5 -11
- {codeplain-0.3.7 → codeplain-0.3.9}/install/powershell/install.ps1 +5 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/memory_management.py +2 -3
- codeplain-0.3.9/metadata_utils.py +46 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/module_renderer.py +3 -6
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code.py +7 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_arguments.py +6 -15
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_cli.md +17 -19
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_console.py +32 -21
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_events.py +1 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_logger.py +3 -7
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_state.py +17 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_telemetry.py +17 -11
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_utils.py +17 -13
- {codeplain-0.3.7 → codeplain-0.3.9}/plain_modules.py +73 -41
- {codeplain-0.3.7 → codeplain-0.3.9}/pyproject.toml +8 -5
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/create_dist.py +2 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/exit_with_error.py +2 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/fix_conformance_test.py +4 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/prepare_repositories.py +3 -10
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/render_functional_requirement.py +4 -3
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/conformance_tests.py +8 -6
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/render_context.py +6 -6
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/render_utils.py +15 -10
- {codeplain-0.3.7 → codeplain-0.3.9}/requirements.txt +3 -3
- codeplain-0.3.9/system_config.py +113 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/test_hello_world_python.py +1 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/test_hello_world_python_windows.py +1 -1
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_arg_provenance.py +3 -3
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_cli_output.py +2 -2
- codeplain-0.3.9/tests/test_console_log_styles.py +112 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_folder_path_resolution.py +12 -13
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plain2code.py +1 -2
- codeplain-0.3.9/tests/test_plain2code_state.py +36 -0
- codeplain-0.3.9/tests/test_plain2code_utils.py +36 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plain_modules.py +200 -15
- codeplain-0.3.9/tests/test_prepare_repositories_layout.py +119 -0
- codeplain-0.3.9/tests/test_system_config.py +58 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_telemetry.py +31 -10
- codeplain-0.3.9/tests/test_tui_usage.py +209 -0
- codeplain-0.3.9/tests/test_usage_summary.py +28 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/components.py +29 -20
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/plain2code_tui.py +71 -2
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/styles.css +4 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/widget_helpers.py +20 -1
- codeplain-0.3.9/usage_summary.py +30 -0
- codeplain-0.3.7/.claude/settings.local.json +0 -66
- codeplain-0.3.7/.github/workflows/publish-to-pypi.yml +0 -109
- codeplain-0.3.7/.zed/settings.json +0 -46
- codeplain-0.3.7/_version.py +0 -1
- codeplain-0.3.7/system_config.py +0 -34
- {codeplain-0.3.7 → codeplain-0.3.9}/.claude/settings.json +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.flake8 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.github/dependabot.yml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/e2e.yml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/lint-and-test.yml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/nofity-slack-on-main-merge.yml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.gitignore +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.vscode/launch.json +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/.vscode/settings.json +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/LICENSE +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/README.md +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/change_detection.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/__init__.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/dry_run.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/concept_utils.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/config/__init__.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/config/system_config.yaml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/diff_utils.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/docs/generate_cli.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/event_bus.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/config.yaml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/harness_tests/hello_world_test.go +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/hello_world_golang.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/config.yaml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/harness_tests/hello_world_display/test_hello_world.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/hello_world_python.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/config.yaml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/e2e/hello_world.cy.ts +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/support/e2e.ts +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress.config.ts +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/package.json +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/tsconfig.json +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/hello_world_react.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/examples/run.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/file_utils.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/install/bash/walkthrough.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/install/powershell/walkthrough.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/partial_rendering.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/path_resolution.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_exceptions.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_nodes.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_read_config.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/plain_file.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/plain_spec.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/pytest.ini +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/__init__.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/analyze_specification_ambiguity.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/base_action.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/commit_conformance_tests_changes.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/commit_implementation_code_changes.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/finish_functional_requirement.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/fix_unit_tests.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/prepare_testing_environment.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/refactor_code.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/render_conformance_tests.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/run_conformance_tests.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/run_unit_tests.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/summarize_conformance_tests.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/code_renderer.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/implementation_code_helpers.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/render_types.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/state_machine_config.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/states.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/triggers.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/resources/codeplain_overview.png +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/resources/plain_example.png +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/golang-console-app-template.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/python-console-app-template.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/typescript-react-app-boilerplate.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/typescript-react-app-template.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_cypress.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_cypress.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_golang.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_golang.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_python.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_python.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_flutter.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_flutter.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_golang.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_golang.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_python.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_python.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_react.ps1 +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_react.sh +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/__init__.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/conftest.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/acceptance_tests_warning/main_requiring_acceptance_tests.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/acceptance_tests_warning/required_with_acceptance_tests.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/circular_imports_1.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/circular_imports_2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/circular_imports_main.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_import_1.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_import_2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_import_common.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_imports_main.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/import_with_functionalities.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/imports_module_with_functionalities.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/non_existent_import.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_code_var.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_implement.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_leaf.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_middle.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_root.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_solo.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/add_new_task_modal_specification.yaml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/duplicate_specification_heading.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/empty_functional_specs_section.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/invalid_specification_order.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/missing_non_functional_requirements.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/no_functional_specs_section.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/plain_source_with_absolute_link.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/plain_source_with_url_link.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/task_list_ui_specification.yaml +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/task_manager_with_reference_links.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/without_non_functional_requirement.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_acceptance_tests.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_acceptance_tests_nondefined.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_defined_nondefined.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_defined_nondefined_2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_definition.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_noconcepts.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_nonconcept.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_nondefined.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_redefinition.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_several_concepts.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_valid.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_base.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_example.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_missing.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_missing_example.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_nested.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_nested_example.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_transitive_example.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_transitive_l1.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_transitive_l2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/plain_file_parser_with_comments.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/plain_file_with_comments_indented.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/regular_plain_source.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_defs.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_example.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_l1.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_l2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_missing.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_module.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_partial.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_partial_duplicate.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/topological_sort.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/topological_sort_not_referenced.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/circular_requires_main.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/circular_requires_sub.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_1.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_common.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_main.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/independent_requires_1.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/independent_requires_2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/independent_requires_main.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/non_existent_require.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_1.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_common.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_main.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/sample_base64_image.txt +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/simple.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/block_level_include.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/code_variables.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/header.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/implement.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/implement_2.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/template_include.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/test_hardest_problem.plain +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/Dockerfile +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/conftest.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_change_detection.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_file_utils.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_git_utils.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_imports.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_log_file_name_resolution.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_logging_config_path_resolution.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_partial_rendering.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_path_resolution.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plainfile.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plainfileparser.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plainspec.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_requires.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_resolve_config_file.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_script_path_resolution.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/__init__.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/models.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/plain_module_render_choice_tui.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/spinner.py +0 -0
- {codeplain-0.3.7 → codeplain-0.3.9}/tui/state_handlers.py +0 -0
|
@@ -14,6 +14,9 @@ jobs:
|
|
|
14
14
|
name: Upload to Cloudflare R2
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
16
|
|
|
17
|
+
env:
|
|
18
|
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
19
|
+
|
|
17
20
|
steps:
|
|
18
21
|
- uses: actions/checkout@v4
|
|
19
22
|
|
|
@@ -54,3 +57,17 @@ jobs:
|
|
|
54
57
|
--content-type "text/plain"
|
|
55
58
|
echo "✓ examples.ps1 uploaded to R2"
|
|
56
59
|
|
|
60
|
+
- name: Notify Slack (success)
|
|
61
|
+
if: ${{ success() && env.SLACK_WEBHOOK_URL != '' }}
|
|
62
|
+
run: |
|
|
63
|
+
curl -s -X POST "$SLACK_WEBHOOK_URL" \
|
|
64
|
+
-H 'Content-type: application/json' \
|
|
65
|
+
--data "{\"text\":\"*Codeplain Client*: Install scripts deployed to R2 :white_check_mark: (\`${GITHUB_SHA:0:7}\`, by *${{ github.actor }}*).\"}"
|
|
66
|
+
|
|
67
|
+
- name: Notify Slack (failure)
|
|
68
|
+
if: ${{ failure() && env.SLACK_WEBHOOK_URL != '' }}
|
|
69
|
+
run: |
|
|
70
|
+
curl -s -X POST "$SLACK_WEBHOOK_URL" \
|
|
71
|
+
-H 'Content-type: application/json' \
|
|
72
|
+
--data "{\"text\":\"*Codeplain Client*: Install script deploy to R2 FAILED :x: (\`${GITHUB_SHA:0:7}\`). Users may be getting a stale installer. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}"
|
|
73
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
# Least privilege by default: jobs get no GITHUB_TOKEN scopes unless they
|
|
8
|
+
# opt in below.
|
|
9
|
+
permissions: {}
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Build distribution
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
contents: write
|
|
17
|
+
|
|
18
|
+
env:
|
|
19
|
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
# hatch-vcs derives the version from git tags, so we need full history.
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Notify Slack (start)
|
|
28
|
+
if: ${{ env.SLACK_WEBHOOK_URL != '' }}
|
|
29
|
+
run: |
|
|
30
|
+
curl -s -X POST "$SLACK_WEBHOOK_URL" \
|
|
31
|
+
-H 'Content-type: application/json' \
|
|
32
|
+
--data "{\"text\":\"*Codeplain Client*: Release \`${{ github.ref_name }}\` published by *${{ github.actor }}* — building and publishing to PyPI...\"}"
|
|
33
|
+
|
|
34
|
+
- name: Install uv
|
|
35
|
+
# uv provisions its own Python (honoring requires-python), so no
|
|
36
|
+
# separate actions/setup-python step is needed.
|
|
37
|
+
run: |
|
|
38
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
39
|
+
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
40
|
+
|
|
41
|
+
- name: Build package
|
|
42
|
+
# hatch-vcs reads the version straight from the release tag.
|
|
43
|
+
run: |
|
|
44
|
+
uv build
|
|
45
|
+
echo "Built distributions:"
|
|
46
|
+
ls -l dist/
|
|
47
|
+
|
|
48
|
+
- name: Store the distribution packages
|
|
49
|
+
uses: actions/upload-artifact@v4
|
|
50
|
+
with:
|
|
51
|
+
name: python-package-distributions
|
|
52
|
+
path: dist/
|
|
53
|
+
|
|
54
|
+
- name: Upload assets to GitHub Release
|
|
55
|
+
env:
|
|
56
|
+
GH_TOKEN: ${{ github.token }}
|
|
57
|
+
run: |
|
|
58
|
+
gh release upload ${{ github.ref_name }} dist/* --clobber
|
|
59
|
+
|
|
60
|
+
- name: Notify Slack (build failure)
|
|
61
|
+
if: ${{ failure() && env.SLACK_WEBHOOK_URL != '' }}
|
|
62
|
+
run: |
|
|
63
|
+
curl -s -X POST "$SLACK_WEBHOOK_URL" \
|
|
64
|
+
-H 'Content-type: application/json' \
|
|
65
|
+
--data "{\"text\":\"*Codeplain Client*: Build of \`${{ github.ref_name }}\` FAILED :x:. Nothing was published to PyPI. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}"
|
|
66
|
+
|
|
67
|
+
publish-to-pypi:
|
|
68
|
+
name: Publish to PyPI
|
|
69
|
+
needs: build
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
environment:
|
|
72
|
+
name: pypi
|
|
73
|
+
url: https://pypi.org/p/codeplain
|
|
74
|
+
permissions:
|
|
75
|
+
# Mint a short-lived OIDC token so PyPI Trusted Publishing can
|
|
76
|
+
# authenticate this run — no long-lived API token needed.
|
|
77
|
+
id-token: write
|
|
78
|
+
|
|
79
|
+
env:
|
|
80
|
+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
81
|
+
|
|
82
|
+
steps:
|
|
83
|
+
- name: Download distribution packages
|
|
84
|
+
uses: actions/download-artifact@v4
|
|
85
|
+
with:
|
|
86
|
+
name: python-package-distributions
|
|
87
|
+
path: dist/
|
|
88
|
+
|
|
89
|
+
- name: Publish to PyPI
|
|
90
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
91
|
+
|
|
92
|
+
- name: Notify Slack (success)
|
|
93
|
+
if: ${{ success() && env.SLACK_WEBHOOK_URL != '' }}
|
|
94
|
+
run: |
|
|
95
|
+
curl -s -X POST "$SLACK_WEBHOOK_URL" \
|
|
96
|
+
-H 'Content-type: application/json' \
|
|
97
|
+
--data "{\"text\":\"*Codeplain Client*: \`${{ github.ref_name }}\` published to PyPI :white_check_mark:. Install with \`pip install --upgrade codeplain\`.\"}"
|
|
98
|
+
|
|
99
|
+
- name: Notify Slack (failure)
|
|
100
|
+
if: ${{ failure() && env.SLACK_WEBHOOK_URL != '' }}
|
|
101
|
+
run: |
|
|
102
|
+
curl -s -X POST "$SLACK_WEBHOOK_URL" \
|
|
103
|
+
-H 'Content-type: application/json' \
|
|
104
|
+
--data "{\"text\":\"*Codeplain Client*: Publishing \`${{ github.ref_name }}\` to PyPI FAILED :x:. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}"
|
|
@@ -212,8 +212,12 @@ Two logging modes:
|
|
|
212
212
|
### Code Generation Process
|
|
213
213
|
- Templates in `standard_template_library/` use Liquid2 syntax
|
|
214
214
|
- Template search order: (1) `.plain` file dir, (2) `--template-dir`, (3) built-in standard lib
|
|
215
|
-
-
|
|
216
|
-
-
|
|
215
|
+
- Each module renders into its own tree under the build folder (configurable via `--build-folder`, default `plain_modules/`):
|
|
216
|
+
- `<build-folder>/<module>/code/` — implementation code (its own git repo)
|
|
217
|
+
- `<build-folder>/<module>/tests/` — conformance tests (its own git repo; only created when a conformance tests script is configured)
|
|
218
|
+
- `<build-folder>/<module>/.codeplain/` — module metadata (`module_metadata.json`), not tracked in git
|
|
219
|
+
- `<build-folder>/<module>/.memory/` — conformance test memory, not tracked in git
|
|
220
|
+
- Each FRID render produces a git commit in the `code/` and `tests/` repos for rollback capability
|
|
217
221
|
|
|
218
222
|
### Configuration
|
|
219
223
|
- `config.yaml` can be placed in `.plain` file dir or CWD
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeplain
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.9
|
|
4
4
|
Summary: Transform plain language specifications into working code
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Classifier: Environment :: Console
|
|
@@ -8,7 +8,7 @@ Classifier: Intended Audience :: Developers
|
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
|
9
9
|
Classifier: Topic :: Software Development :: Code Generators
|
|
10
10
|
Requires-Python: ==3.11.*
|
|
11
|
-
Requires-Dist: gitpython==3.1.
|
|
11
|
+
Requires-Dist: gitpython==3.1.52
|
|
12
12
|
Requires-Dist: mistletoe==1.5.1
|
|
13
13
|
Requires-Dist: networkx==3.6.1
|
|
14
14
|
Requires-Dist: python-frontmatter==1.3.0
|
|
@@ -16,7 +16,7 @@ Requires-Dist: python-liquid2==0.4.0
|
|
|
16
16
|
Requires-Dist: pyyaml==6.0.3
|
|
17
17
|
Requires-Dist: requests==2.34.2
|
|
18
18
|
Requires-Dist: rich==15.0.0
|
|
19
|
-
Requires-Dist: sentry-sdk==2.
|
|
19
|
+
Requires-Dist: sentry-sdk==2.66.0
|
|
20
20
|
Requires-Dist: textual>=7.5.0
|
|
21
21
|
Requires-Dist: tiktoken==0.13.0
|
|
22
22
|
Requires-Dist: transitions==0.9.3
|
|
@@ -24,7 +24,7 @@ Provides-Extra: dev
|
|
|
24
24
|
Requires-Dist: black==26.5.1; extra == 'dev'
|
|
25
25
|
Requires-Dist: flake8==7.3.0; extra == 'dev'
|
|
26
26
|
Requires-Dist: isort==8.0.1; extra == 'dev'
|
|
27
|
-
Requires-Dist: mypy==2.
|
|
27
|
+
Requires-Dist: mypy==2.3.0; extra == 'dev'
|
|
28
28
|
Requires-Dist: pytest==9.1.1; extra == 'dev'
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
30
|
|
|
@@ -4,7 +4,7 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
from plain2code_console import console
|
|
6
6
|
from plain2code_state import RunState
|
|
7
|
-
from
|
|
7
|
+
from usage_summary import format_usage_summary
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
def print_exit_summary(
|
|
@@ -24,7 +24,7 @@ def print_exit_summary(
|
|
|
24
24
|
msg += f" [#8E8F91]render id:\t\t\t[#FFFFFF]{run_state.render_id}\n"
|
|
25
25
|
msg += f" [#8E8F91]input file:\t\t\t[#FFFFFF]{spec_filename}\n"
|
|
26
26
|
msg += f" [#8E8F91]generated code folder:\t[#FFFFFF]{run_state.render_generated_code_path or '-'}\n\n"
|
|
27
|
-
msg +=
|
|
27
|
+
msg += format_usage_summary(run_state.rendered_functionalities, run_state.render_time_accumulated) + "\n"
|
|
28
28
|
console.print(msg)
|
|
29
29
|
|
|
30
30
|
if not run_state.render_succeeded and error_message:
|
|
@@ -32,7 +32,7 @@ def _display_credit_line(plan_credits: dict) -> None:
|
|
|
32
32
|
# If naive datetime, assume UTC
|
|
33
33
|
if dt.tzinfo is None:
|
|
34
34
|
dt = dt.replace(tzinfo=timezone.utc)
|
|
35
|
-
formatted_date = dt.strftime(
|
|
35
|
+
formatted_date = f"{dt.strftime('%b')} {dt.day}, {dt.year}"
|
|
36
36
|
|
|
37
37
|
# Check if expired
|
|
38
38
|
now = datetime.now(timezone.utc)
|
|
@@ -62,7 +62,7 @@ def _display_bucket_credit_line(bucket: dict, label: str) -> None:
|
|
|
62
62
|
# If naive datetime, assume UTC
|
|
63
63
|
if dt.tzinfo is None:
|
|
64
64
|
dt = dt.replace(tzinfo=timezone.utc)
|
|
65
|
-
formatted_date = dt.strftime(
|
|
65
|
+
formatted_date = f"{dt.strftime('%b')} {dt.day}, {dt.year}"
|
|
66
66
|
|
|
67
67
|
# Check if expired
|
|
68
68
|
now = datetime.now(timezone.utc)
|
|
@@ -5,6 +5,7 @@ import requests
|
|
|
5
5
|
from requests.exceptions import ConnectionError, RequestException, Timeout
|
|
6
6
|
|
|
7
7
|
import plain2code_exceptions
|
|
8
|
+
from plain2code_console import RETRY_COLOR
|
|
8
9
|
from plain2code_state import RunState
|
|
9
10
|
|
|
10
11
|
MAX_RETRIES = 4
|
|
@@ -67,8 +68,11 @@ class CodeplainAPI:
|
|
|
67
68
|
connection_error_type = "Network error" if is_connection_error else "Error"
|
|
68
69
|
if attempt < num_retries:
|
|
69
70
|
if not silent:
|
|
70
|
-
self.console.debug(
|
|
71
|
-
|
|
71
|
+
self.console.debug(
|
|
72
|
+
f"↻ {connection_error_type} on attempt {attempt + 1}/{num_retries + 1}: {error}. "
|
|
73
|
+
f"Retrying in {retry_delay} seconds...",
|
|
74
|
+
color=RETRY_COLOR,
|
|
75
|
+
)
|
|
72
76
|
time.sleep(retry_delay)
|
|
73
77
|
# Exponential backoff
|
|
74
78
|
return retry_delay * 2
|
|
@@ -9,7 +9,6 @@ usage: generate_cli.py [-h] [--verbose] [--base-folder BASE_FOLDER]
|
|
|
9
9
|
[--render-range RENDER_RANGE |
|
|
10
10
|
--render-from RENDER_FROM] [--force-render]
|
|
11
11
|
[--unittests-script UNITTESTS_SCRIPT]
|
|
12
|
-
[--conformance-tests-folder CONFORMANCE_TESTS_FOLDER]
|
|
13
12
|
[--conformance-tests-script CONFORMANCE_TESTS_SCRIPT]
|
|
14
13
|
[--prepare-environment-script PREPARE_ENVIRONMENT_SCRIPT]
|
|
15
14
|
[--test-script-timeout TEST_SCRIPT_TIMEOUT]
|
|
@@ -20,8 +19,8 @@ usage: generate_cli.py [-h] [--verbose] [--base-folder BASE_FOLDER]
|
|
|
20
19
|
[--conformance-tests-dest CONFORMANCE_TESTS_DEST]
|
|
21
20
|
[--render-machine-graph]
|
|
22
21
|
[--logging-config-path LOGGING_CONFIG_PATH]
|
|
23
|
-
[--headless]
|
|
24
|
-
filename
|
|
22
|
+
[--headless] [--status] [--version]
|
|
23
|
+
[filename]
|
|
25
24
|
|
|
26
25
|
Render plain code to target code. Path arguments resolve based on where they
|
|
27
26
|
were written: values given on the command line are resolved against the
|
|
@@ -39,7 +38,7 @@ positional arguments:
|
|
|
39
38
|
|
|
40
39
|
options:
|
|
41
40
|
-h, --help show this help message and exit
|
|
42
|
-
--verbose, -v
|
|
41
|
+
--verbose, -v Set default log level to DEBUG for TUI and file logs
|
|
43
42
|
--base-folder BASE_FOLDER
|
|
44
43
|
Base folder for the build files
|
|
45
44
|
--build-folder BUILD_FOLDER
|
|
@@ -66,18 +65,17 @@ options:
|
|
|
66
65
|
--force-render Force re-render of all the required modules.
|
|
67
66
|
--unittests-script UNITTESTS_SCRIPT
|
|
68
67
|
Shell script to run unit tests on generated code.
|
|
69
|
-
Receives the
|
|
70
|
-
(
|
|
71
|
-
--conformance-tests-folder CONFORMANCE_TESTS_FOLDER
|
|
72
|
-
Folder for conformance test files
|
|
68
|
+
Receives the module's code folder path as its first
|
|
69
|
+
argument (e.g. `plain_modules/module_name/code`).
|
|
73
70
|
--conformance-tests-script CONFORMANCE_TESTS_SCRIPT
|
|
74
71
|
Path to conformance tests shell script. Every
|
|
75
72
|
conformance test script should accept two arguments:
|
|
76
|
-
1) Path to a folder (e.g.
|
|
77
|
-
|
|
78
|
-
subfolder of the
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
1) Path to a folder (e.g.
|
|
74
|
+
`plain_modules/module_name/code`) containing generated
|
|
75
|
+
source code, 2) Path to a subfolder of the module's
|
|
76
|
+
tests folder (e.g.
|
|
77
|
+
`plain_modules/module_name/tests/subfoldername`)
|
|
78
|
+
containing test files.
|
|
81
79
|
--prepare-environment-script PREPARE_ENVIRONMENT_SCRIPT
|
|
82
80
|
Path to a shell script that prepares the testing
|
|
83
81
|
environment. The script should accept the source code
|
|
@@ -90,9 +88,9 @@ options:
|
|
|
90
88
|
--api-key API_KEY API key used to access the API. If not provided, the
|
|
91
89
|
`CODEPLAIN_API_KEY` environment variable is used.
|
|
92
90
|
--full-plain Full preview ***plain specification before code
|
|
93
|
-
generation.Use when you want to preview context of
|
|
94
|
-
***plain primitives that are going to be included
|
|
95
|
-
order to render the given module.
|
|
91
|
+
generation. Use when you want to preview context of
|
|
92
|
+
all ***plain primitives that are going to be included
|
|
93
|
+
in order to render the given module.
|
|
96
94
|
--dry-run Dry run preview of the code generation (without
|
|
97
95
|
actually making any changes).
|
|
98
96
|
--replay-with REPLAY_WITH
|
|
@@ -109,10 +107,10 @@ options:
|
|
|
109
107
|
Target folder to copy rendered contents of code to
|
|
110
108
|
(used only if --copy-build is set).
|
|
111
109
|
--copy-conformance-tests
|
|
112
|
-
If set, copy the conformance tests
|
|
113
|
-
|
|
114
|
-
tests-dest` folder successful rendering.
|
|
115
|
-
--conformance-tests-script.
|
|
110
|
+
If set, copy the module's conformance tests (from
|
|
111
|
+
`<build-folder>/<module>/tests`) to `--conformance-
|
|
112
|
+
tests-dest` folder after successful rendering.
|
|
113
|
+
Requires --conformance-tests-script.
|
|
116
114
|
--conformance-tests-dest CONFORMANCE_TESTS_DEST
|
|
117
115
|
Target folder to copy conformance tests of code to
|
|
118
116
|
(used only if --copy-conformance-tests is set).
|
|
@@ -123,6 +121,10 @@ options:
|
|
|
123
121
|
--headless Run in headless mode: no TUI, no terminal output
|
|
124
122
|
except a single render-started message. All logs are
|
|
125
123
|
written to the log file.
|
|
124
|
+
--status Display account status including user information, API
|
|
125
|
+
key label, and rendering credits. Does not render any
|
|
126
|
+
code.
|
|
127
|
+
--version Display the client version and exit.
|
|
126
128
|
|
|
127
129
|
configuration:
|
|
128
130
|
--config-name CONFIG_NAME
|
|
@@ -22,10 +22,16 @@ my-new-project/
|
|
|
22
22
|
├── run_unittests_[language].sh # Unit test script
|
|
23
23
|
├── run_conformance_tests_[language].sh # Conformance test script
|
|
24
24
|
├── build/ # Generated final code
|
|
25
|
-
|
|
26
|
-
└──
|
|
25
|
+
└── plain_modules/ # Generated modules
|
|
26
|
+
└── my_app/ # One folder per module
|
|
27
|
+
├── .codeplain/ # Module metadata
|
|
28
|
+
├── .memory/ # Conformance test memory
|
|
29
|
+
├── code/ # Generated code
|
|
30
|
+
└── tests/ # Generated conformance tests
|
|
27
31
|
```
|
|
28
32
|
|
|
33
|
+
The `tests/` folder is only created when a conformance test script is configured.
|
|
34
|
+
|
|
29
35
|
In this guide we will cover how to create each of these step by step.
|
|
30
36
|
|
|
31
37
|
## 1. Define Your .plain File
|
|
@@ -20,11 +20,11 @@ if [ $? -ne 0 ]; then
|
|
|
20
20
|
exit 1
|
|
21
21
|
fi
|
|
22
22
|
|
|
23
|
-
cd plain_modules/hello_world_golang
|
|
23
|
+
cd plain_modules/hello_world_golang/code
|
|
24
24
|
|
|
25
25
|
# We need to compile the tests so that we can execute them in the current folder
|
|
26
26
|
# (https://stackoverflow.com/questions/23847003/golang-tests-and-working-directory/29541248#29541248)
|
|
27
|
-
go test -c
|
|
27
|
+
go test -c ../../../harness_tests/hello_world_test.go
|
|
28
28
|
|
|
29
29
|
# Check if test compilation has failed for the hello world example
|
|
30
30
|
if [ $? -ne 0 ]; then
|
|
@@ -7,9 +7,9 @@ if [ $? -ne 0 ]; then
|
|
|
7
7
|
exit 1
|
|
8
8
|
fi
|
|
9
9
|
|
|
10
|
-
cd plain_modules/hello_world_python
|
|
10
|
+
cd plain_modules/hello_world_python/code
|
|
11
11
|
|
|
12
|
-
python
|
|
12
|
+
python ../../../harness_tests/hello_world_display/test_hello_world.py
|
|
13
13
|
|
|
14
14
|
# Check if the test harness has failed for the hello world example
|
|
15
15
|
if [ $? -ne 0 ]; then
|
|
@@ -20,7 +20,7 @@ if [ $? -ne 0 ]; then
|
|
|
20
20
|
exit 1
|
|
21
21
|
fi
|
|
22
22
|
|
|
23
|
-
../../test_scripts/run_conformance_tests_cypress.sh plain_modules/hello_world_react harness_tests/hello_world_display ${VERBOSE:+-v}
|
|
23
|
+
../../test_scripts/run_conformance_tests_cypress.sh plain_modules/hello_world_react/code harness_tests/hello_world_display ${VERBOSE:+-v}
|
|
24
24
|
|
|
25
25
|
# Check if the test harness has failed for the hello world example
|
|
26
26
|
if [ $? -ne 0 ]; then
|
|
@@ -64,7 +64,6 @@ def init_git_repo(
|
|
|
64
64
|
path_to_repo: Union[str, os.PathLike],
|
|
65
65
|
module_name: Optional[str] = None,
|
|
66
66
|
render_id: Optional[str] = None,
|
|
67
|
-
initial_files: Optional[dict[str, str]] = None,
|
|
68
67
|
) -> Repo:
|
|
69
68
|
"""
|
|
70
69
|
Initializes a new git repository in the given path.
|
|
@@ -79,10 +78,6 @@ def init_git_repo(
|
|
|
79
78
|
repo = Repo.init(path_to_repo)
|
|
80
79
|
_ensure_git_config(repo)
|
|
81
80
|
|
|
82
|
-
if initial_files:
|
|
83
|
-
file_utils.store_response_files(path_to_repo, initial_files, [])
|
|
84
|
-
repo.git.add(".")
|
|
85
|
-
|
|
86
81
|
repo.git.commit(
|
|
87
82
|
"--allow-empty", "-m", _get_full_commit_message(INITIAL_COMMIT_MESSAGE, module_name, None, render_id)
|
|
88
83
|
)
|
|
@@ -95,14 +90,9 @@ def clone_repo(
|
|
|
95
90
|
new_repo_path: str,
|
|
96
91
|
module_name: Optional[str] = None,
|
|
97
92
|
render_id: Optional[str] = None,
|
|
98
|
-
initial_files: Optional[dict[str, str]] = None,
|
|
99
93
|
) -> Repo:
|
|
100
94
|
repo = Repo.clone_from(source_repo_path, new_repo_path)
|
|
101
95
|
|
|
102
|
-
if initial_files:
|
|
103
|
-
file_utils.store_response_files(new_repo_path, initial_files, [])
|
|
104
|
-
repo.git.add(".")
|
|
105
|
-
|
|
106
96
|
repo.git.commit(
|
|
107
97
|
"--allow-empty", "-m", _get_full_commit_message(INITIAL_COMMIT_MESSAGE, module_name, None, render_id)
|
|
108
98
|
)
|
|
@@ -13,7 +13,7 @@ NC="${NC:-\033[0m}"
|
|
|
13
13
|
|
|
14
14
|
# Examples configuration
|
|
15
15
|
EXAMPLES_FOLDER_NAME="plainlang-examples"
|
|
16
|
-
EXAMPLES_DOWNLOAD_URL="https://
|
|
16
|
+
EXAMPLES_DOWNLOAD_URL="https://codeplain.ai/examples/unix"
|
|
17
17
|
|
|
18
18
|
# Show current directory and ask for extraction path
|
|
19
19
|
CURRENT_DIR=$(pwd)
|
|
@@ -55,18 +55,12 @@ if [ "$SKIP_DOWNLOAD" = false ]; then
|
|
|
55
55
|
if [ $? -eq 0 ] && [ -s "$TEMP_ZIP" ]; then
|
|
56
56
|
echo -e " ${GRAY}Extracting to ${EXTRACT_PATH}...${NC}"
|
|
57
57
|
|
|
58
|
-
# Extract the zip file
|
|
59
|
-
|
|
58
|
+
# Extract the zip file (contents are at the zip root, so extract into the target folder)
|
|
59
|
+
EXTRACTED_DIR="${EXTRACT_PATH}/${EXAMPLES_FOLDER_NAME}"
|
|
60
|
+
rm -rf "$EXTRACTED_DIR" 2>/dev/null # Remove existing if present
|
|
61
|
+
unzip -q -o "$TEMP_ZIP" -d "$EXTRACTED_DIR" 2>/dev/null
|
|
60
62
|
|
|
61
63
|
if [ $? -eq 0 ]; then
|
|
62
|
-
# Find and rename extracted directory to remove version number
|
|
63
|
-
EXTRACTED_DIR="${EXTRACT_PATH}/${EXAMPLES_FOLDER_NAME}"
|
|
64
|
-
VERSIONED_DIR=$(find "$EXTRACT_PATH" -maxdepth 1 -type d -name "${EXAMPLES_FOLDER_NAME}-*" | head -1)
|
|
65
|
-
if [ -n "$VERSIONED_DIR" ]; then
|
|
66
|
-
rm -rf "$EXTRACTED_DIR" 2>/dev/null # Remove existing if present
|
|
67
|
-
mv "$VERSIONED_DIR" "$EXTRACTED_DIR"
|
|
68
|
-
fi
|
|
69
|
-
|
|
70
64
|
# Remove the .gitignore file from the root of the extracted directory
|
|
71
65
|
if [ -f "${EXTRACTED_DIR}/.gitignore" ]; then
|
|
72
66
|
rm -f "${EXTRACTED_DIR}/.gitignore"
|
|
@@ -396,10 +396,12 @@ if [ -n "${CODEPLAIN_API_KEY:-}" ]; then
|
|
|
396
396
|
# Ensure the freshly installed tool is findable in this session.
|
|
397
397
|
export PATH="$HOME/.local/bin:$PATH"
|
|
398
398
|
echo -e "${GRAY}Verifying your installation...${NC}"
|
|
399
|
-
if codeplain --status
|
|
399
|
+
if verify_output=$(codeplain --status 2>&1); then
|
|
400
400
|
echo -e "${GREEN}✓${NC} Installation verified."
|
|
401
401
|
else
|
|
402
402
|
echo -e "${RED}Something went wrong during installation.${NC}"
|
|
403
|
+
echo -e "${GRAY}Output of 'codeplain --status':${NC}"
|
|
404
|
+
echo "$verify_output"
|
|
403
405
|
echo -e "${GRAY}Please restart your terminal and try again, or reinstall with:${NC}"
|
|
404
406
|
echo -e " uv tool install --force codeplain"
|
|
405
407
|
exit 1
|
|
@@ -11,7 +11,7 @@ if (-not $env:NC) { $NC = "$([char]27)[0m" } else
|
|
|
11
11
|
|
|
12
12
|
# Examples configuration
|
|
13
13
|
$EXAMPLES_FOLDER_NAME = "plainlang-examples"
|
|
14
|
-
$EXAMPLES_DOWNLOAD_URL = "https://
|
|
14
|
+
$EXAMPLES_DOWNLOAD_URL = "https://codeplain.ai/examples/windows"
|
|
15
15
|
|
|
16
16
|
# Show current directory and ask for extraction path
|
|
17
17
|
$CURRENT_DIR = Get-Location
|
|
@@ -58,18 +58,12 @@ if (-not $SKIP_DOWNLOAD) {
|
|
|
58
58
|
Write-Host " ${GRAY}Extracting to ${EXTRACT_PATH}...${NC}"
|
|
59
59
|
|
|
60
60
|
try {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
# Find and rename extracted directory to remove version number
|
|
61
|
+
# Extract the zip file (contents are at the zip root, so extract into the target folder)
|
|
64
62
|
$EXTRACTED_DIR = Join-Path $EXTRACT_PATH $EXAMPLES_FOLDER_NAME
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if ($VERSIONED_DIR) {
|
|
68
|
-
if (Test-Path $EXTRACTED_DIR) {
|
|
69
|
-
Remove-Item -Path $EXTRACTED_DIR -Recurse -Force -ErrorAction SilentlyContinue
|
|
70
|
-
}
|
|
71
|
-
Rename-Item -Path $VERSIONED_DIR.FullName -NewName $EXAMPLES_FOLDER_NAME
|
|
63
|
+
if (Test-Path $EXTRACTED_DIR) {
|
|
64
|
+
Remove-Item -Path $EXTRACTED_DIR -Recurse -Force -ErrorAction SilentlyContinue
|
|
72
65
|
}
|
|
66
|
+
Expand-Archive -Path $TEMP_ZIP -DestinationPath $EXTRACTED_DIR -Force
|
|
73
67
|
|
|
74
68
|
# Remove the .gitignore file from the root of the extracted directory
|
|
75
69
|
$GITIGNORE_PATH = Join-Path $EXTRACTED_DIR ".gitignore"
|
|
@@ -426,16 +426,20 @@ if ($downloadExamples -notmatch '^[Nn]$') {
|
|
|
426
426
|
if ($env:CODEPLAIN_API_KEY) {
|
|
427
427
|
Write-Host "${GRAY}Verifying your installation...${NC}"
|
|
428
428
|
$verifyOk = $false
|
|
429
|
+
$verifyOutput = ""
|
|
429
430
|
try {
|
|
430
|
-
& codeplain --status
|
|
431
|
+
$verifyOutput = & codeplain --status 2>&1 | Out-String
|
|
431
432
|
$verifyOk = ($LASTEXITCODE -eq 0)
|
|
432
433
|
} catch {
|
|
434
|
+
$verifyOutput = $_ | Out-String
|
|
433
435
|
$verifyOk = $false
|
|
434
436
|
}
|
|
435
437
|
if ($verifyOk) {
|
|
436
438
|
Write-Host "${GREEN}✓${NC} Installation verified."
|
|
437
439
|
} else {
|
|
438
440
|
Write-Host "${RED}Something went wrong during installation.${NC}"
|
|
441
|
+
Write-Host "${GRAY}Output of 'codeplain --status':${NC}"
|
|
442
|
+
Write-Host $verifyOutput
|
|
439
443
|
Write-Host "${GRAY}Please restart your terminal and try again, or reinstall with:${NC}"
|
|
440
444
|
Write-Host " uv tool install --force codeplain"
|
|
441
445
|
exit 1
|
|
@@ -3,7 +3,6 @@ import os
|
|
|
3
3
|
|
|
4
4
|
import file_utils
|
|
5
5
|
from plain2code_console import console
|
|
6
|
-
from plain_modules import CODEPLAIN_MEMORY_SUBFOLDER
|
|
7
6
|
from render_machine.implementation_code_helpers import ImplementationCodeHelpers
|
|
8
7
|
from render_machine.render_context import RenderContext
|
|
9
8
|
|
|
@@ -24,9 +23,9 @@ class MemoryManager:
|
|
|
24
23
|
console.debug(f"Loaded {len(memory_files_content)} memory files.")
|
|
25
24
|
return memory_files, memory_files_content
|
|
26
25
|
|
|
27
|
-
def __init__(self, codeplain_api,
|
|
26
|
+
def __init__(self, codeplain_api, memory_folder: str):
|
|
28
27
|
self.codeplain_api = codeplain_api
|
|
29
|
-
self.memory_folder =
|
|
28
|
+
self.memory_folder = memory_folder
|
|
30
29
|
|
|
31
30
|
def create_conformance_tests_memory(
|
|
32
31
|
self, render_context: RenderContext, exit_code: int, conformance_tests_issue: str
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Read/write helpers for the per-module metadata file (``module_metadata.json``).
|
|
2
|
+
|
|
3
|
+
These helpers operate purely on a metadata path or a plain dict. Module-specific
|
|
4
|
+
logic — computing the hashes, assembling the payload from the spec and required
|
|
5
|
+
modules — stays on :class:`plain_modules.PlainModule`.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
|
|
13
|
+
MODULE_METADATA_FILENAME = "module_metadata.json"
|
|
14
|
+
MODULE_FUNCTIONALITIES = "functionalities"
|
|
15
|
+
REQUIRED_MODULES_FUNCTIONALITIES = "required_modules_functionalities"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def load_metadata(metadata_path: str) -> dict | None:
|
|
19
|
+
"""Return the parsed metadata dict, or None if the file does not exist."""
|
|
20
|
+
if not os.path.exists(metadata_path):
|
|
21
|
+
return None
|
|
22
|
+
|
|
23
|
+
with open(metadata_path, "r", encoding="utf-8") as f:
|
|
24
|
+
return json.load(f)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def write_metadata(metadata_path: str, metadata: dict) -> None:
|
|
28
|
+
"""Write metadata as indented JSON, creating the parent folder if needed."""
|
|
29
|
+
os.makedirs(os.path.dirname(metadata_path), exist_ok=True)
|
|
30
|
+
|
|
31
|
+
with open(metadata_path, "w", encoding="utf-8") as f:
|
|
32
|
+
json.dump(metadata, f, indent=4)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def truncate_functionalities(metadata: dict, keep_count: int) -> bool:
|
|
36
|
+
"""Trim the functionalities list in ``metadata`` in place to ``keep_count`` entries.
|
|
37
|
+
|
|
38
|
+
Returns True if the list was shortened, False if it was already short enough
|
|
39
|
+
(in which case ``metadata`` is left untouched).
|
|
40
|
+
"""
|
|
41
|
+
functionalities = metadata.get(MODULE_FUNCTIONALITIES, [])
|
|
42
|
+
if len(functionalities) <= keep_count:
|
|
43
|
+
return False
|
|
44
|
+
|
|
45
|
+
metadata[MODULE_FUNCTIONALITIES] = functionalities[:keep_count]
|
|
46
|
+
return True
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
import os
|
|
3
2
|
import threading
|
|
4
3
|
|
|
5
4
|
from event_bus import EventBus
|
|
@@ -48,9 +47,8 @@ class ModuleRenderer:
|
|
|
48
47
|
self.codeplainAPI,
|
|
49
48
|
memory_manager,
|
|
50
49
|
plain_module,
|
|
51
|
-
build_folder=
|
|
50
|
+
build_folder=plain_module.module_build_folder,
|
|
52
51
|
build_dest=self.args.build_dest,
|
|
53
|
-
conformance_tests_folder=self.args.conformance_tests_folder,
|
|
54
52
|
conformance_tests_dest=self.args.conformance_tests_dest,
|
|
55
53
|
unittests_script=self.args.unittests_script,
|
|
56
54
|
conformance_tests_script=self.args.conformance_tests_script,
|
|
@@ -115,8 +113,7 @@ class ModuleRenderer:
|
|
|
115
113
|
|
|
116
114
|
memory_manager = MemoryManager(
|
|
117
115
|
self.codeplainAPI,
|
|
118
|
-
plain_module.
|
|
119
|
-
self.args.conformance_tests_folder,
|
|
116
|
+
plain_module.module_memory_folder,
|
|
120
117
|
)
|
|
121
118
|
render_context = self._build_render_context_for_module(
|
|
122
119
|
plain_module,
|
|
@@ -165,7 +162,7 @@ class ModuleRenderer:
|
|
|
165
162
|
if self.args.copy_build:
|
|
166
163
|
rendered_code_path = f"{self.args.build_dest}/"
|
|
167
164
|
else:
|
|
168
|
-
rendered_code_path = self.
|
|
165
|
+
rendered_code_path = self.plain_module.module_build_folder
|
|
169
166
|
|
|
170
167
|
self.run_state.set_render_generated_code_path(rendered_code_path)
|
|
171
168
|
self.event_bus.publish(RenderCompleted(rendered_code_path=rendered_code_path))
|