codeplain 0.2.1__tar.gz → 0.2.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.
- {codeplain-0.2.1 → codeplain-0.2.2}/PKG-INFO +16 -15
- codeplain-0.2.2/codeplain.egg-info/PKG-INFO +123 -0
- codeplain-0.2.2/codeplain.egg-info/SOURCES.txt +81 -0
- codeplain-0.2.2/codeplain.egg-info/dependency_links.txt +1 -0
- codeplain-0.2.2/codeplain.egg-info/entry_points.txt +2 -0
- codeplain-0.2.1/requirements.txt → codeplain-0.2.2/codeplain.egg-info/requires.txt +6 -7
- codeplain-0.2.2/codeplain.egg-info/top_level.txt +41 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code.py +21 -2
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_arguments.py +0 -4
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_exceptions.py +4 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/pyproject.toml +49 -11
- codeplain-0.2.2/setup.cfg +4 -0
- codeplain-0.2.1/.flake8 +0 -28
- codeplain-0.2.1/.github/workflows/lint-and-test.yml +0 -126
- codeplain-0.2.1/.github/workflows/nofity-slack-on-main-merge.yml +0 -22
- codeplain-0.2.1/.github/workflows/publish-to-pypi.yml +0 -86
- codeplain-0.2.1/.gitignore +0 -30
- codeplain-0.2.1/.vscode/launch.json +0 -21
- codeplain-0.2.1/.vscode/settings.json +0 -32
- codeplain-0.2.1/docs/generate_cli.py +0 -20
- codeplain-0.2.1/docs/plain2code_cli.md +0 -66
- codeplain-0.2.1/docs/plain_language_specification.md +0 -250
- codeplain-0.2.1/docs/starting_a_plain_project_from_scratch.md +0 -94
- codeplain-0.2.1/examples/example_hello_world_golang/config.yaml +0 -3
- codeplain-0.2.1/examples/example_hello_world_golang/harness_tests/hello_world_test.go +0 -30
- codeplain-0.2.1/examples/example_hello_world_golang/hello_world_golang.plain +0 -13
- codeplain-0.2.1/examples/example_hello_world_golang/run.sh +0 -35
- codeplain-0.2.1/examples/example_hello_world_python/config.yaml +0 -3
- codeplain-0.2.1/examples/example_hello_world_python/harness_tests/hello_world_display/test_hello_world.py +0 -17
- codeplain-0.2.1/examples/example_hello_world_python/hello_world_python.plain +0 -19
- codeplain-0.2.1/examples/example_hello_world_python/run.sh +0 -20
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/e2e/hello_world.cy.ts +0 -6
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/support/e2e.ts +0 -8
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/cypress.config.ts +0 -12
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/package.json +0 -44
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/tsconfig.json +0 -10
- codeplain-0.2.1/examples/example_hello_world_react/hello_world_react.plain +0 -11
- codeplain-0.2.1/examples/example_hello_world_react/run.sh +0 -29
- codeplain-0.2.1/examples/run.sh +0 -39
- codeplain-0.2.1/install.sh +0 -217
- codeplain-0.2.1/pytest.ini +0 -7
- codeplain-0.2.1/resources/codeplain_overview.png +0 -0
- codeplain-0.2.1/resources/plain_example.png +0 -0
- codeplain-0.2.1/test_scripts/run_conformance_tests_cypress.sh +0 -255
- codeplain-0.2.1/test_scripts/run_conformance_tests_golang.sh +0 -87
- codeplain-0.2.1/test_scripts/run_conformance_tests_python.sh +0 -79
- codeplain-0.2.1/test_scripts/run_unittests_golang.sh +0 -49
- codeplain-0.2.1/test_scripts/run_unittests_python.sh +0 -73
- codeplain-0.2.1/test_scripts/run_unittests_react.sh +0 -66
- codeplain-0.2.1/tests/__init__.py +0 -1
- codeplain-0.2.1/tests/conftest.py +0 -34
- codeplain-0.2.1/tests/data/imports/circular_imports_1.plain +0 -8
- codeplain-0.2.1/tests/data/imports/circular_imports_2.plain +0 -8
- codeplain-0.2.1/tests/data/imports/circular_imports_main.plain +0 -12
- codeplain-0.2.1/tests/data/imports/diamond_import_1.plain +0 -16
- codeplain-0.2.1/tests/data/imports/diamond_import_2.plain +0 -16
- codeplain-0.2.1/tests/data/imports/diamond_import_common.plain +0 -11
- codeplain-0.2.1/tests/data/imports/diamond_imports_main.plain +0 -13
- codeplain-0.2.1/tests/data/imports/non_existent_import.plain +0 -12
- codeplain-0.2.1/tests/data/plainfile/duplicate_specification_heading.plain +0 -7
- codeplain-0.2.1/tests/data/plainfile/invalid_specification_order.plain +0 -7
- codeplain-0.2.1/tests/data/plainfile/missing_non_functional_requirements.plain +0 -5
- codeplain-0.2.1/tests/data/plainfile/plain_source_with_absolute_link.plain +0 -9
- codeplain-0.2.1/tests/data/plainfile/plain_source_with_url_link.plain +0 -9
- codeplain-0.2.1/tests/data/plainfile/task_manager_with_reference_links.plain +0 -40
- codeplain-0.2.1/tests/data/plainfile/without_non_functional_requirement.plain +0 -5
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_acceptance_tests.plain +0 -20
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_acceptance_tests_nondefined.plain +0 -20
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_defined_nondefined.plain +0 -18
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_defined_nondefined_2.plain +0 -18
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_definition.plain +0 -16
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_noconcepts.plain +0 -18
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_nonconcept.plain +0 -15
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_nondefined.plain +0 -18
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_redefinition.plain +0 -19
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_several_concepts.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_valid.plain +0 -16
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_base.plain +0 -2
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_example.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_missing.plain +0 -8
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_missing_example.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_nested.plain +0 -15
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_nested_example.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_transitive_example.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_transitive_l1.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_transitive_l2.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/plain_file_parser_with_comments.plain +0 -8
- codeplain-0.2.1/tests/data/plainfileparser/plain_file_with_comments_indented.plain +0 -10
- codeplain-0.2.1/tests/data/plainfileparser/regular_plain_source.plain +0 -11
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts.plain +0 -7
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_defs.plain +0 -2
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_example.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_l1.plain +0 -7
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_l2.plain +0 -5
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_missing.plain +0 -10
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_module.plain +0 -11
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_partial.plain +0 -13
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_partial_duplicate.plain +0 -14
- codeplain-0.2.1/tests/data/plainfileparser/topological_sort.plain +0 -14
- codeplain-0.2.1/tests/data/plainfileparser/topological_sort_not_referenced.plain +0 -22
- codeplain-0.2.1/tests/data/requires/circular_requires_main.plain +0 -18
- codeplain-0.2.1/tests/data/requires/circular_requires_sub.plain +0 -12
- codeplain-0.2.1/tests/data/requires/diamond_requires_1.plain +0 -12
- codeplain-0.2.1/tests/data/requires/diamond_requires_2.plain +0 -12
- codeplain-0.2.1/tests/data/requires/diamond_requires_common.plain +0 -7
- codeplain-0.2.1/tests/data/requires/diamond_requires_main.plain +0 -19
- codeplain-0.2.1/tests/data/requires/independent_requires_1.plain +0 -7
- codeplain-0.2.1/tests/data/requires/independent_requires_2.plain +0 -7
- codeplain-0.2.1/tests/data/requires/independent_requires_main.plain +0 -19
- codeplain-0.2.1/tests/data/requires/non_existent_require.plain +0 -18
- codeplain-0.2.1/tests/data/requires/normal_requires_1.plain +0 -12
- codeplain-0.2.1/tests/data/requires/normal_requires_2.plain +0 -12
- codeplain-0.2.1/tests/data/requires/normal_requires_common.plain +0 -7
- codeplain-0.2.1/tests/data/requires/normal_requires_main.plain +0 -19
- codeplain-0.2.1/tests/data/simple.plain +0 -7
- codeplain-0.2.1/tests/data/templates/block_level_include.plain +0 -12
- codeplain-0.2.1/tests/data/templates/code_variables.plain +0 -10
- codeplain-0.2.1/tests/data/templates/header.plain +0 -7
- codeplain-0.2.1/tests/data/templates/implement.plain +0 -3
- codeplain-0.2.1/tests/data/templates/implement_2.plain +0 -3
- codeplain-0.2.1/tests/data/templates/template_include.plain +0 -4
- codeplain-0.2.1/tests/data/templates/test_hardest_problem.plain +0 -2
- {codeplain-0.2.1 → codeplain-0.2.2}/LICENSE +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/README.md +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/codeplain_REST_api.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/concept_utils.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/config/__init__.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/config/system_config.yaml +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/diff_utils.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/event_bus.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/file_utils.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/git_utils.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/hash_key.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/memory_management.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/module_renderer.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_console.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_events.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_logger.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_nodes.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_read_config.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_state.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain2code_utils.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain_file.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain_modules.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/plain_spec.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/__init__.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/analyze_specification_ambiguity.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/base_action.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/commit_conformance_tests_changes.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/commit_implementation_code_changes.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/create_dist.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/exit_with_error.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/finish_functional_requirement.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/fix_conformance_test.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/fix_unit_tests.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/prepare_repositories.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/prepare_testing_environment.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/refactor_code.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/render_conformance_tests.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/render_functional_requirement.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/run_conformance_tests.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/run_unit_tests.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/actions/summarize_conformance_tests.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/code_renderer.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/conformance_test_helpers.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/conformance_tests.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/implementation_code_helpers.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/render_context.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/render_types.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/render_utils.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/state_machine_config.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/states.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/render_machine/triggers.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/spinner.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/standard_template_library/__init__.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/standard_template_library/golang-console-app-template.plain +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/standard_template_library/python-console-app-template.plain +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/standard_template_library/typescript-react-app-boilerplate.plain +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/standard_template_library/typescript-react-app-template.plain +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/system_config.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tests/test_git_utils.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tests/test_imports.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tests/test_plainfile.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tests/test_plainfileparser.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tests/test_plainspec.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tests/test_requires.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tui/__init__.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tui/components.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tui/models.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tui/plain2code_tui.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tui/state_handlers.py +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tui/styles.css +0 -0
- {codeplain-0.2.1 → codeplain-0.2.2}/tui/widget_helpers.py +0 -0
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeplain
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Transform plain language specifications into working code
|
|
5
|
-
License-File: LICENSE
|
|
6
5
|
Classifier: Environment :: Console
|
|
7
6
|
Classifier: Intended Audience :: Developers
|
|
8
7
|
Classifier: Operating System :: OS Independent
|
|
9
8
|
Classifier: Topic :: Software Development :: Code Generators
|
|
10
9
|
Requires-Python: >=3.11
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Requires-Dist: networkx==3.6.1
|
|
14
|
-
Requires-Dist: python-frontmatter==1.1.0
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
15
12
|
Requires-Dist: python-liquid2==0.3.0
|
|
16
|
-
Requires-Dist:
|
|
13
|
+
Requires-Dist: mistletoe==1.3.0
|
|
17
14
|
Requires-Dist: requests==2.32.3
|
|
18
|
-
Requires-Dist: rich==14.2.0
|
|
19
|
-
Requires-Dist: textual==1.0.0
|
|
20
15
|
Requires-Dist: tiktoken==0.12.0
|
|
16
|
+
Requires-Dist: PyYAML==6.0.2
|
|
17
|
+
Requires-Dist: gitpython==3.1.42
|
|
21
18
|
Requires-Dist: transitions==0.9.3
|
|
19
|
+
Requires-Dist: textual==1.0.0
|
|
20
|
+
Requires-Dist: rich==14.2.0
|
|
21
|
+
Requires-Dist: python-frontmatter==1.1.0
|
|
22
|
+
Requires-Dist: networkx==3.6.1
|
|
22
23
|
Provides-Extra: dev
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist: flake8==7.0.0; extra ==
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
|
|
24
|
+
Requires-Dist: pytest==8.3.5; extra == "dev"
|
|
25
|
+
Requires-Dist: flake8==7.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: black==24.2.0; extra == "dev"
|
|
27
|
+
Requires-Dist: isort==5.13.2; extra == "dev"
|
|
28
|
+
Requires-Dist: mypy==1.11.2; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
29
30
|
|
|
30
31
|
# Codeplain plain2code renderer
|
|
31
32
|
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codeplain
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Transform plain language specifications into working code
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: python-liquid2==0.3.0
|
|
13
|
+
Requires-Dist: mistletoe==1.3.0
|
|
14
|
+
Requires-Dist: requests==2.32.3
|
|
15
|
+
Requires-Dist: tiktoken==0.12.0
|
|
16
|
+
Requires-Dist: PyYAML==6.0.2
|
|
17
|
+
Requires-Dist: gitpython==3.1.42
|
|
18
|
+
Requires-Dist: transitions==0.9.3
|
|
19
|
+
Requires-Dist: textual==1.0.0
|
|
20
|
+
Requires-Dist: rich==14.2.0
|
|
21
|
+
Requires-Dist: python-frontmatter==1.1.0
|
|
22
|
+
Requires-Dist: networkx==3.6.1
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest==8.3.5; extra == "dev"
|
|
25
|
+
Requires-Dist: flake8==7.0.0; extra == "dev"
|
|
26
|
+
Requires-Dist: black==24.2.0; extra == "dev"
|
|
27
|
+
Requires-Dist: isort==5.13.2; extra == "dev"
|
|
28
|
+
Requires-Dist: mypy==1.11.2; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Codeplain plain2code renderer
|
|
32
|
+
|
|
33
|
+
Render ***plain source to software code using the Codeplain API.
|
|
34
|
+
|
|
35
|
+
## Codeplain.ai - Code Generation as a Service
|
|
36
|
+
|
|
37
|
+
Codeplain is a platform that generates software code using large language models based on requirements you specify in ***plain specification language.
|
|
38
|
+
|
|
39
|
+
Schematic overview of the Codeplain's code generation service
|
|
40
|
+
|
|
41
|
+
<img src="https://raw.githubusercontent.com/Codeplain-ai/plain2code_client/main/resources/codeplain_overview.png">
|
|
42
|
+
|
|
43
|
+
### Abstracting Away Code Generation Complexity with ***plain
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
***plain is a novel specification language that helps abstracting away complexity of using large language models for code generation.
|
|
47
|
+
|
|
48
|
+
An example application in ***plain
|
|
49
|
+
|
|
50
|
+
<img src="https://raw.githubusercontent.com/Codeplain-ai/plain2code_client/main/resources/plain_example.png" width="70%" height="70%">
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Getting started
|
|
54
|
+
|
|
55
|
+
### Prerequisites
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#### System requirements
|
|
59
|
+
|
|
60
|
+
To run the plain2code client, you need Python 3.11 or a later version.
|
|
61
|
+
|
|
62
|
+
**Windows users:** Please install WSL (Windows Subsystem for Linux) as this is currently the supported environment for running plain code on Windows.
|
|
63
|
+
|
|
64
|
+
#### Authorization - Codeplain API Key
|
|
65
|
+
|
|
66
|
+
We are using Codeplain API Key to authorize requests to the Codeplain API. To get your Codeplain API Key, please contact Codeplain.ai support at support@codeplain.ai.
|
|
67
|
+
|
|
68
|
+
In order to generate code, you need to export the following environment variable:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
export CODEPLAIN_API_KEY="your_actual_api_key_here"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Installation Steps
|
|
75
|
+
|
|
76
|
+
1. Clone this repository
|
|
77
|
+
2. Set your Codeplain API key as an environment variable:
|
|
78
|
+
```
|
|
79
|
+
export CODEPLAIN_API_KEY=your_api_key_here
|
|
80
|
+
```
|
|
81
|
+
3. (Recommended) Create and activate a virtual environment:
|
|
82
|
+
```bash
|
|
83
|
+
python -m venv .venv
|
|
84
|
+
source .venv/bin/activate
|
|
85
|
+
```
|
|
86
|
+
4. Install required libraries
|
|
87
|
+
```
|
|
88
|
+
pip install -r requirements.txt
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Quick Start
|
|
92
|
+
|
|
93
|
+
After completing the installation steps above, you can immediately test the system with a simple "Hello World" example:
|
|
94
|
+
|
|
95
|
+
- Change to the example folder and run the example:
|
|
96
|
+
```
|
|
97
|
+
cd examples/example_hello_world_python
|
|
98
|
+
python ../../plain2code.py hello_world_python.plain
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
*Note: Rendering will take a few minutes to complete.*
|
|
102
|
+
|
|
103
|
+
- The system will generate a Python application in the `build` directory. You can run it with:
|
|
104
|
+
```
|
|
105
|
+
cd build
|
|
106
|
+
python hello_world.py
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Additional Resources
|
|
110
|
+
|
|
111
|
+
### Examples and Sample Projects
|
|
112
|
+
|
|
113
|
+
- See the [examples](examples) folder for sample projects in Golang, Python, and React.
|
|
114
|
+
- For example application how to implement task manager in ***plain see [example-task-manager](https://github.com/Codeplain-ai/example-task-manager) repository.
|
|
115
|
+
- For example application how to implement SaaS connectors in ***plain see [example-saas-connectors](https://github.com/Codeplain-ai/example-saas-connectors) repository.
|
|
116
|
+
|
|
117
|
+
### Documentation
|
|
118
|
+
|
|
119
|
+
- For more details on the ***plain format, see the [***plain language specification](docs/plain_language_specification.md).
|
|
120
|
+
- For step-by-step instructions for creating your first ***plain project see the [Kickstart your ***plain project](docs/starting_a_plain_project_from_scratch.md).
|
|
121
|
+
- For complete CLI documentation and usage examples, see [plain2code CLI documentation](docs/plain2code_cli.md).
|
|
122
|
+
|
|
123
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
codeplain_REST_api.py
|
|
4
|
+
concept_utils.py
|
|
5
|
+
diff_utils.py
|
|
6
|
+
event_bus.py
|
|
7
|
+
file_utils.py
|
|
8
|
+
git_utils.py
|
|
9
|
+
hash_key.py
|
|
10
|
+
memory_management.py
|
|
11
|
+
module_renderer.py
|
|
12
|
+
plain2code.py
|
|
13
|
+
plain2code_arguments.py
|
|
14
|
+
plain2code_console.py
|
|
15
|
+
plain2code_events.py
|
|
16
|
+
plain2code_exceptions.py
|
|
17
|
+
plain2code_logger.py
|
|
18
|
+
plain2code_nodes.py
|
|
19
|
+
plain2code_read_config.py
|
|
20
|
+
plain2code_state.py
|
|
21
|
+
plain2code_utils.py
|
|
22
|
+
plain_file.py
|
|
23
|
+
plain_modules.py
|
|
24
|
+
plain_spec.py
|
|
25
|
+
pyproject.toml
|
|
26
|
+
spinner.py
|
|
27
|
+
system_config.py
|
|
28
|
+
codeplain.egg-info/PKG-INFO
|
|
29
|
+
codeplain.egg-info/SOURCES.txt
|
|
30
|
+
codeplain.egg-info/dependency_links.txt
|
|
31
|
+
codeplain.egg-info/entry_points.txt
|
|
32
|
+
codeplain.egg-info/requires.txt
|
|
33
|
+
codeplain.egg-info/top_level.txt
|
|
34
|
+
config/__init__.py
|
|
35
|
+
config/system_config.yaml
|
|
36
|
+
render_machine/__init__.py
|
|
37
|
+
render_machine/code_renderer.py
|
|
38
|
+
render_machine/conformance_test_helpers.py
|
|
39
|
+
render_machine/conformance_tests.py
|
|
40
|
+
render_machine/implementation_code_helpers.py
|
|
41
|
+
render_machine/render_context.py
|
|
42
|
+
render_machine/render_types.py
|
|
43
|
+
render_machine/render_utils.py
|
|
44
|
+
render_machine/state_machine_config.py
|
|
45
|
+
render_machine/states.py
|
|
46
|
+
render_machine/triggers.py
|
|
47
|
+
render_machine/actions/analyze_specification_ambiguity.py
|
|
48
|
+
render_machine/actions/base_action.py
|
|
49
|
+
render_machine/actions/commit_conformance_tests_changes.py
|
|
50
|
+
render_machine/actions/commit_implementation_code_changes.py
|
|
51
|
+
render_machine/actions/create_dist.py
|
|
52
|
+
render_machine/actions/exit_with_error.py
|
|
53
|
+
render_machine/actions/finish_functional_requirement.py
|
|
54
|
+
render_machine/actions/fix_conformance_test.py
|
|
55
|
+
render_machine/actions/fix_unit_tests.py
|
|
56
|
+
render_machine/actions/prepare_repositories.py
|
|
57
|
+
render_machine/actions/prepare_testing_environment.py
|
|
58
|
+
render_machine/actions/refactor_code.py
|
|
59
|
+
render_machine/actions/render_conformance_tests.py
|
|
60
|
+
render_machine/actions/render_functional_requirement.py
|
|
61
|
+
render_machine/actions/run_conformance_tests.py
|
|
62
|
+
render_machine/actions/run_unit_tests.py
|
|
63
|
+
render_machine/actions/summarize_conformance_tests.py
|
|
64
|
+
standard_template_library/__init__.py
|
|
65
|
+
standard_template_library/golang-console-app-template.plain
|
|
66
|
+
standard_template_library/python-console-app-template.plain
|
|
67
|
+
standard_template_library/typescript-react-app-boilerplate.plain
|
|
68
|
+
standard_template_library/typescript-react-app-template.plain
|
|
69
|
+
tests/test_git_utils.py
|
|
70
|
+
tests/test_imports.py
|
|
71
|
+
tests/test_plainfile.py
|
|
72
|
+
tests/test_plainfileparser.py
|
|
73
|
+
tests/test_plainspec.py
|
|
74
|
+
tests/test_requires.py
|
|
75
|
+
tui/__init__.py
|
|
76
|
+
tui/components.py
|
|
77
|
+
tui/models.py
|
|
78
|
+
tui/plain2code_tui.py
|
|
79
|
+
tui/state_handlers.py
|
|
80
|
+
tui/styles.css
|
|
81
|
+
tui/widget_helpers.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
python-liquid2==0.3.0
|
|
2
2
|
mistletoe==1.3.0
|
|
3
|
-
python-frontmatter==1.1.0
|
|
4
3
|
requests==2.32.3
|
|
5
|
-
rich==14.2.0
|
|
6
4
|
tiktoken==0.12.0
|
|
7
5
|
PyYAML==6.0.2
|
|
8
6
|
gitpython==3.1.42
|
|
9
|
-
|
|
7
|
+
transitions==0.9.3
|
|
10
8
|
textual==1.0.0
|
|
9
|
+
rich==14.2.0
|
|
10
|
+
python-frontmatter==1.1.0
|
|
11
11
|
networkx==3.6.1
|
|
12
|
-
transitions==0.9.3
|
|
13
|
-
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
[dev]
|
|
14
|
+
pytest==8.3.5
|
|
16
15
|
flake8==7.0.0
|
|
17
16
|
black==24.2.0
|
|
18
17
|
isort==5.13.2
|
|
19
|
-
mypy==1.11.2
|
|
18
|
+
mypy==1.11.2
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
code_complexity
|
|
2
|
+
codeplain
|
|
3
|
+
codeplain_REST_api
|
|
4
|
+
codeplain_constants
|
|
5
|
+
codeplain_local_api
|
|
6
|
+
codeplain_models
|
|
7
|
+
codeplain_types
|
|
8
|
+
codeplain_utils
|
|
9
|
+
concept_utils
|
|
10
|
+
config
|
|
11
|
+
content_extractor
|
|
12
|
+
event_bus
|
|
13
|
+
file_utils
|
|
14
|
+
git_utils
|
|
15
|
+
hash_key
|
|
16
|
+
llm
|
|
17
|
+
llm_exceptions
|
|
18
|
+
llm_handler
|
|
19
|
+
llm_selector
|
|
20
|
+
module_renderer
|
|
21
|
+
plain2code
|
|
22
|
+
plain2code_arguments
|
|
23
|
+
plain2code_console
|
|
24
|
+
plain2code_events
|
|
25
|
+
plain2code_exceptions
|
|
26
|
+
plain2code_logger
|
|
27
|
+
plain2code_nodes
|
|
28
|
+
plain2code_read_config
|
|
29
|
+
plain2code_state
|
|
30
|
+
plain2code_tui
|
|
31
|
+
plain2code_utils
|
|
32
|
+
plain_file
|
|
33
|
+
plain_modules
|
|
34
|
+
plain_spec
|
|
35
|
+
render_cache
|
|
36
|
+
render_machine
|
|
37
|
+
spinner
|
|
38
|
+
standard_template_library
|
|
39
|
+
system_config
|
|
40
|
+
tui
|
|
41
|
+
tui_components
|
|
@@ -17,7 +17,7 @@ from event_bus import EventBus
|
|
|
17
17
|
from module_renderer import ModuleRenderer
|
|
18
18
|
from plain2code_arguments import parse_arguments
|
|
19
19
|
from plain2code_console import console
|
|
20
|
-
from plain2code_exceptions import PlainSyntaxError
|
|
20
|
+
from plain2code_exceptions import MissingAPIKey, PlainSyntaxError
|
|
21
21
|
from plain2code_logger import (
|
|
22
22
|
CrashLogHandler,
|
|
23
23
|
IndentedFormatter,
|
|
@@ -161,6 +161,17 @@ def render(args, run_state: RunState, codeplain_api, event_bus: EventBus): # no
|
|
|
161
161
|
|
|
162
162
|
console.info(f"Rendering {args.filename} to target code.")
|
|
163
163
|
|
|
164
|
+
# Compute render range from either --render-range or --render-from
|
|
165
|
+
render_range = None
|
|
166
|
+
if args.render_range or args.render_from:
|
|
167
|
+
# Parse the plain file to get the plain_source for FRID extraction
|
|
168
|
+
_, plain_source, _ = plain_file.plain_file_parser(args.filename, template_dirs)
|
|
169
|
+
|
|
170
|
+
if args.render_range:
|
|
171
|
+
render_range = get_render_range(args.render_range, plain_source)
|
|
172
|
+
elif args.render_from:
|
|
173
|
+
render_range = get_render_range_from(args.render_from, plain_source)
|
|
174
|
+
|
|
164
175
|
codeplainAPI = codeplain_api.CodeplainAPI(args.api_key, console)
|
|
165
176
|
codeplainAPI.verbose = args.verbose
|
|
166
177
|
assert args.api is not None and args.api != "", "API URL is required"
|
|
@@ -169,7 +180,7 @@ def render(args, run_state: RunState, codeplain_api, event_bus: EventBus): # no
|
|
|
169
180
|
module_renderer = ModuleRenderer(
|
|
170
181
|
codeplainAPI,
|
|
171
182
|
args.filename,
|
|
172
|
-
|
|
183
|
+
render_range,
|
|
173
184
|
template_dirs,
|
|
174
185
|
args,
|
|
175
186
|
run_state,
|
|
@@ -208,6 +219,12 @@ def main():
|
|
|
208
219
|
run_state = RunState(spec_filename=args.filename, replay_with=args.replay_with)
|
|
209
220
|
|
|
210
221
|
try:
|
|
222
|
+
# Validate API key is present
|
|
223
|
+
if not args.api_key:
|
|
224
|
+
raise MissingAPIKey(
|
|
225
|
+
"API key is required. Please set the CODEPLAIN_API_KEY environment variable or provide it with the --api-key argument."
|
|
226
|
+
)
|
|
227
|
+
|
|
211
228
|
render(args, run_state, codeplain_api, event_bus)
|
|
212
229
|
except InvalidFridArgument as e:
|
|
213
230
|
console.error(f"Error rendering plain code: {str(e)}.\n")
|
|
@@ -237,6 +254,8 @@ def main():
|
|
|
237
254
|
console.error(f"Error rendering plain code: {str(e)}\n")
|
|
238
255
|
console.debug(f"Render ID: {run_state.render_id}")
|
|
239
256
|
dump_crash_logs(args)
|
|
257
|
+
except MissingAPIKey as e:
|
|
258
|
+
console.error(f"Missing API key: {str(e)}\n")
|
|
240
259
|
except Exception as e:
|
|
241
260
|
console.error(f"Error rendering plain code: {str(e)}\n")
|
|
242
261
|
console.debug(f"Render ID: {run_state.render_id}")
|
|
@@ -5,10 +5,6 @@ import re
|
|
|
5
5
|
from plain2code_read_config import get_args_from_config
|
|
6
6
|
|
|
7
7
|
CODEPLAIN_API_KEY = os.getenv("CODEPLAIN_API_KEY")
|
|
8
|
-
if not CODEPLAIN_API_KEY:
|
|
9
|
-
CLAUDE_API_KEY = os.getenv("CLAUDE_API_KEY")
|
|
10
|
-
if not CLAUDE_API_KEY:
|
|
11
|
-
raise ValueError("CODEPLAIN_API_KEY or CLAUDE_API_KEY environment variable is not set")
|
|
12
8
|
|
|
13
9
|
|
|
14
10
|
DEFAULT_BUILD_FOLDER = "plain_modules"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["
|
|
3
|
-
build-backend = "
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codeplain"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "Transform plain language specifications into working code"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -40,16 +40,54 @@ dev = [
|
|
|
40
40
|
[project.scripts]
|
|
41
41
|
codeplain = "plain2code:main"
|
|
42
42
|
|
|
43
|
-
[tool.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
43
|
+
[tool.setuptools]
|
|
44
|
+
py-modules = [
|
|
45
|
+
"plain2code",
|
|
46
|
+
"plain2code_arguments",
|
|
47
|
+
"plain2code_console",
|
|
48
|
+
"plain2code_events",
|
|
49
|
+
"plain2code_exceptions",
|
|
50
|
+
"plain2code_nodes",
|
|
51
|
+
"plain2code_read_config",
|
|
52
|
+
"plain2code_state",
|
|
53
|
+
"plain2code_tui",
|
|
54
|
+
"plain2code_utils",
|
|
55
|
+
"plain_file",
|
|
56
|
+
"plain_spec",
|
|
57
|
+
"codeplain_constants",
|
|
58
|
+
"codeplain_local_api",
|
|
59
|
+
"codeplain_models",
|
|
60
|
+
"codeplain_REST_api",
|
|
61
|
+
"codeplain_types",
|
|
62
|
+
"codeplain_utils",
|
|
63
|
+
"codeplain",
|
|
64
|
+
"code_complexity",
|
|
65
|
+
"config",
|
|
66
|
+
"content_extractor",
|
|
67
|
+
"event_bus",
|
|
68
|
+
"file_utils",
|
|
69
|
+
"git_utils",
|
|
70
|
+
"hash_key",
|
|
71
|
+
"llm_exceptions",
|
|
72
|
+
"llm_handler",
|
|
73
|
+
"llm_selector",
|
|
74
|
+
"llm",
|
|
75
|
+
"render_cache",
|
|
76
|
+
"spinner",
|
|
77
|
+
"system_config",
|
|
78
|
+
"tui_components",
|
|
79
|
+
"concept_utils",
|
|
80
|
+
"module_renderer",
|
|
81
|
+
"plain_modules",
|
|
82
|
+
"plain2code_logger",
|
|
51
83
|
]
|
|
52
84
|
|
|
85
|
+
[tool.setuptools.packages.find]
|
|
86
|
+
include = ["config*", "patch*", "prompt_templates*", "render_machine*", "repositories*", "services*", "standard_template_library*", "tui*"]
|
|
87
|
+
|
|
88
|
+
[tool.setuptools.package-data]
|
|
89
|
+
"*" = ["*.yaml", "*.css", "*.plain"]
|
|
90
|
+
|
|
53
91
|
[tool.black]
|
|
54
92
|
line-length = 120
|
|
55
93
|
target-version = ['py311']
|
codeplain-0.2.1/.flake8
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
[flake8]
|
|
2
|
-
max-line-length = 120
|
|
3
|
-
# E203 is ignored because it conflicts with Black's formatting of slice notation
|
|
4
|
-
# Black formats slices like `a[1 : 2]` but flake8 expects `a[1:2]`
|
|
5
|
-
# E501 is ignored because we handle line length with Black's formatter
|
|
6
|
-
# B001 is ignored because we also check it with check E722
|
|
7
|
-
# N... is ignored because it's just naming conventions
|
|
8
|
-
# U101 is ignored because leading underscores signal that the argument is not used
|
|
9
|
-
extend-ignore = E203, E501, B001, N803, N806, N813, U101, U101
|
|
10
|
-
exclude =
|
|
11
|
-
.git,
|
|
12
|
-
__pycache__,
|
|
13
|
-
.venv,
|
|
14
|
-
.env,
|
|
15
|
-
.conda,
|
|
16
|
-
build,
|
|
17
|
-
dist,
|
|
18
|
-
tests,
|
|
19
|
-
examples
|
|
20
|
-
per-file-ignores =
|
|
21
|
-
__init__.py: F401
|
|
22
|
-
tests/*: U100
|
|
23
|
-
max-complexity = 15
|
|
24
|
-
enable-extensions = U100
|
|
25
|
-
# Plugin-specific configuration
|
|
26
|
-
unused-arguments-ignore-args = self,cls,_
|
|
27
|
-
# don't show warnings for unused *args and **kwargs.
|
|
28
|
-
unused-arguments-ignore-variadic-names = True
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
name: Code Quality & Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
pull_request:
|
|
6
|
-
|
|
7
|
-
env:
|
|
8
|
-
PYTHON_VERSION: "3.11"
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
black:
|
|
12
|
-
name: Black Formatting
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
16
|
-
- name: Set up Python
|
|
17
|
-
uses: actions/setup-python@v5
|
|
18
|
-
with:
|
|
19
|
-
python-version: ${{ env.PYTHON_VERSION }}
|
|
20
|
-
- name: Cache pip
|
|
21
|
-
uses: actions/cache@v4
|
|
22
|
-
with:
|
|
23
|
-
path: ~/.cache/pip
|
|
24
|
-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: |
|
|
27
|
-
python -m pip install --upgrade pip
|
|
28
|
-
pip install -r requirements.txt
|
|
29
|
-
- name: Check formatting with Black
|
|
30
|
-
run: black . --check
|
|
31
|
-
|
|
32
|
-
isort:
|
|
33
|
-
name: Import Sorting
|
|
34
|
-
runs-on: ubuntu-latest
|
|
35
|
-
steps:
|
|
36
|
-
- uses: actions/checkout@v4
|
|
37
|
-
- name: Set up Python
|
|
38
|
-
uses: actions/setup-python@v5
|
|
39
|
-
with:
|
|
40
|
-
python-version: ${{ env.PYTHON_VERSION }}
|
|
41
|
-
- name: Cache pip
|
|
42
|
-
uses: actions/cache@v4
|
|
43
|
-
with:
|
|
44
|
-
path: ~/.cache/pip
|
|
45
|
-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
46
|
-
- name: Install dependencies
|
|
47
|
-
run: |
|
|
48
|
-
python -m pip install --upgrade pip
|
|
49
|
-
pip install isort
|
|
50
|
-
- name: Sort imports with isort
|
|
51
|
-
run: isort . --check-only --diff
|
|
52
|
-
|
|
53
|
-
flake8:
|
|
54
|
-
name: Flake8 Linting
|
|
55
|
-
runs-on: ubuntu-latest
|
|
56
|
-
steps:
|
|
57
|
-
- uses: actions/checkout@v4
|
|
58
|
-
- name: Set up Python
|
|
59
|
-
uses: actions/setup-python@v5
|
|
60
|
-
with:
|
|
61
|
-
python-version: ${{ env.PYTHON_VERSION }}
|
|
62
|
-
- name: Cache pip
|
|
63
|
-
uses: actions/cache@v4
|
|
64
|
-
with:
|
|
65
|
-
path: ~/.cache/pip
|
|
66
|
-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
67
|
-
- name: Install dependencies
|
|
68
|
-
run: |
|
|
69
|
-
python -m pip install --upgrade pip
|
|
70
|
-
pip install flake8
|
|
71
|
-
- name: Lint with flake8
|
|
72
|
-
run: flake8 .
|
|
73
|
-
|
|
74
|
-
mypy:
|
|
75
|
-
name: MyPy Type Checking
|
|
76
|
-
runs-on: ubuntu-latest
|
|
77
|
-
steps:
|
|
78
|
-
- uses: actions/checkout@v4
|
|
79
|
-
- name: Set up Python
|
|
80
|
-
uses: actions/setup-python@v5
|
|
81
|
-
with:
|
|
82
|
-
python-version: ${{ env.PYTHON_VERSION }}
|
|
83
|
-
- name: Cache pip
|
|
84
|
-
uses: actions/cache@v4
|
|
85
|
-
with:
|
|
86
|
-
path: ~/.cache/pip
|
|
87
|
-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
88
|
-
- name: Install dependencies
|
|
89
|
-
run: |
|
|
90
|
-
python -m pip install --upgrade pip
|
|
91
|
-
pip install -r requirements.txt
|
|
92
|
-
- name: Type check with mypy
|
|
93
|
-
run: mypy . --check-untyped-defs
|
|
94
|
-
|
|
95
|
-
tests:
|
|
96
|
-
name: Run Tests
|
|
97
|
-
runs-on: ubuntu-latest
|
|
98
|
-
steps:
|
|
99
|
-
- uses: actions/checkout@v4
|
|
100
|
-
- name: Set up Python
|
|
101
|
-
uses: actions/setup-python@v5
|
|
102
|
-
with:
|
|
103
|
-
python-version: ${{ env.PYTHON_VERSION }}
|
|
104
|
-
- name: Configure git for tests
|
|
105
|
-
run: |
|
|
106
|
-
git config --global user.email "test@example.com"
|
|
107
|
-
git config --global user.name "Test Runner"
|
|
108
|
-
git config --global init.defaultBranch main
|
|
109
|
-
- name: Cache pip
|
|
110
|
-
uses: actions/cache@v4
|
|
111
|
-
with:
|
|
112
|
-
path: ~/.cache/pip
|
|
113
|
-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
|
114
|
-
- name: Install dependencies
|
|
115
|
-
run: |
|
|
116
|
-
python -m pip install --upgrade pip
|
|
117
|
-
pip install -r requirements.txt
|
|
118
|
-
pip install coverage
|
|
119
|
-
- name: Run tests with coverage
|
|
120
|
-
run: |
|
|
121
|
-
export $(cat .env.dev.example | xargs)
|
|
122
|
-
coverage run -m pytest tests/ -v
|
|
123
|
-
coverage xml
|
|
124
|
-
coverage report
|
|
125
|
-
- name: Upload coverage reports
|
|
126
|
-
uses: codecov/codecov-action@v3
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
name: Notify Slack on Merge to Main
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [closed]
|
|
6
|
-
branches:
|
|
7
|
-
- main
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
notify:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
if: github.event.pull_request.merged == true
|
|
13
|
-
steps:
|
|
14
|
-
- name: Send notification to Slack
|
|
15
|
-
uses: slackapi/slack-github-action@v1.24.0
|
|
16
|
-
with:
|
|
17
|
-
payload: |
|
|
18
|
-
{
|
|
19
|
-
"text": ${{ toJSON(format('[Codeplain Client] PR <{0}|#{1}: {2}> was merged to main by `{3}`.', github.event.pull_request.html_url, github.event.pull_request.number, github.event.pull_request.title, github.actor)) }}
|
|
20
|
-
}
|
|
21
|
-
env:
|
|
22
|
-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|