codeplain 0.1.0__tar.gz → 0.2.1__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/.flake8 +28 -0
- codeplain-0.2.1/.github/workflows/lint-and-test.yml +126 -0
- codeplain-0.2.1/.github/workflows/nofity-slack-on-main-merge.yml +22 -0
- codeplain-0.2.1/.github/workflows/publish-to-pypi.yml +86 -0
- codeplain-0.2.1/.gitignore +30 -0
- codeplain-0.2.1/.vscode/launch.json +21 -0
- codeplain-0.2.1/.vscode/settings.json +32 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/PKG-INFO +16 -36
- {codeplain-0.1.0 → codeplain-0.2.1}/README.md +2 -2
- {codeplain-0.1.0 → codeplain-0.2.1}/codeplain_REST_api.py +111 -35
- codeplain-0.2.1/concept_utils.py +216 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/config/__init__.py +0 -1
- codeplain-0.2.1/diff_utils.py +32 -0
- codeplain-0.2.1/docs/generate_cli.py +20 -0
- codeplain-0.2.1/docs/plain2code_cli.md +66 -0
- codeplain-0.2.1/docs/plain_language_specification.md +250 -0
- codeplain-0.2.1/docs/starting_a_plain_project_from_scratch.md +94 -0
- codeplain-0.2.1/event_bus.py +45 -0
- codeplain-0.2.1/examples/example_hello_world_golang/config.yaml +3 -0
- codeplain-0.2.1/examples/example_hello_world_golang/harness_tests/hello_world_test.go +30 -0
- codeplain-0.2.1/examples/example_hello_world_golang/hello_world_golang.plain +13 -0
- codeplain-0.2.1/examples/example_hello_world_golang/run.sh +35 -0
- codeplain-0.2.1/examples/example_hello_world_python/config.yaml +3 -0
- codeplain-0.2.1/examples/example_hello_world_python/harness_tests/hello_world_display/test_hello_world.py +17 -0
- codeplain-0.2.1/examples/example_hello_world_python/hello_world_python.plain +19 -0
- codeplain-0.2.1/examples/example_hello_world_python/run.sh +20 -0
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/e2e/hello_world.cy.ts +6 -0
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/support/e2e.ts +8 -0
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/cypress.config.ts +12 -0
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/package.json +44 -0
- codeplain-0.2.1/examples/example_hello_world_react/harness_tests/hello_world_display/tsconfig.json +10 -0
- codeplain-0.2.1/examples/example_hello_world_react/hello_world_react.plain +11 -0
- codeplain-0.2.1/examples/example_hello_world_react/run.sh +29 -0
- codeplain-0.2.1/examples/run.sh +39 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/file_utils.py +34 -24
- {codeplain-0.1.0 → codeplain-0.2.1}/git_utils.py +84 -19
- codeplain-0.2.1/install.sh +217 -0
- codeplain-0.2.1/memory_management.py +97 -0
- codeplain-0.2.1/module_renderer.py +149 -0
- codeplain-0.2.1/plain2code.py +248 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/plain2code_arguments.py +30 -4
- {codeplain-0.1.0 → codeplain-0.2.1}/plain2code_console.py +12 -3
- codeplain-0.2.1/plain2code_events.py +62 -0
- codeplain-0.2.1/plain2code_logger.py +127 -0
- codeplain-0.2.1/plain2code_state.py +39 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/plain2code_utils.py +8 -26
- codeplain-0.2.1/plain_file.py +703 -0
- codeplain-0.2.1/plain_modules.py +135 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/plain_spec.py +7 -5
- codeplain-0.2.1/pyproject.toml +115 -0
- codeplain-0.2.1/pytest.ini +7 -0
- codeplain-0.2.1/render_machine/__init__.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/analyze_specification_ambiguity.py +9 -7
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/commit_conformance_tests_changes.py +11 -5
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/commit_implementation_code_changes.py +2 -1
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/create_dist.py +6 -6
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/exit_with_error.py +6 -1
- codeplain-0.2.1/render_machine/actions/finish_functional_requirement.py +18 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/fix_conformance_test.py +48 -38
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/fix_unit_tests.py +10 -8
- codeplain-0.2.1/render_machine/actions/prepare_repositories.py +73 -0
- codeplain-0.2.1/render_machine/actions/prepare_testing_environment.py +40 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/refactor_code.py +12 -10
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/render_conformance_tests.py +42 -29
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/render_functional_requirement.py +29 -12
- codeplain-0.2.1/render_machine/actions/run_conformance_tests.py +73 -0
- codeplain-0.2.1/render_machine/actions/run_unit_tests.py +46 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/summarize_conformance_tests.py +10 -6
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/code_renderer.py +21 -3
- codeplain-0.2.1/render_machine/conformance_tests.py +169 -0
- codeplain-0.2.1/render_machine/implementation_code_helpers.py +26 -0
- codeplain-0.2.1/render_machine/render_context.py +448 -0
- codeplain-0.2.1/render_machine/render_types.py +186 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/render_utils.py +17 -9
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/state_machine_config.py +50 -18
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/states.py +1 -1
- codeplain-0.2.1/requirements.txt +19 -0
- codeplain-0.2.1/resources/codeplain_overview.png +0 -0
- codeplain-0.2.1/resources/plain_example.png +0 -0
- codeplain-0.2.1/spinner.py +88 -0
- codeplain-0.2.1/standard_template_library/golang-console-app-template.plain +29 -0
- codeplain-0.2.1/standard_template_library/python-console-app-template.plain +24 -0
- codeplain-0.2.1/standard_template_library/typescript-react-app-boilerplate.plain +8 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/standard_template_library/typescript-react-app-template.plain +5 -10
- codeplain-0.2.1/test_scripts/run_conformance_tests_cypress.sh +255 -0
- codeplain-0.2.1/test_scripts/run_conformance_tests_golang.sh +87 -0
- codeplain-0.2.1/test_scripts/run_conformance_tests_python.sh +79 -0
- codeplain-0.2.1/test_scripts/run_unittests_golang.sh +49 -0
- codeplain-0.2.1/test_scripts/run_unittests_python.sh +73 -0
- codeplain-0.2.1/test_scripts/run_unittests_react.sh +66 -0
- codeplain-0.2.1/tests/__init__.py +1 -0
- codeplain-0.2.1/tests/conftest.py +34 -0
- codeplain-0.2.1/tests/data/imports/circular_imports_1.plain +8 -0
- codeplain-0.2.1/tests/data/imports/circular_imports_2.plain +8 -0
- codeplain-0.2.1/tests/data/imports/circular_imports_main.plain +12 -0
- codeplain-0.2.1/tests/data/imports/diamond_import_1.plain +16 -0
- codeplain-0.2.1/tests/data/imports/diamond_import_2.plain +16 -0
- codeplain-0.2.1/tests/data/imports/diamond_import_common.plain +11 -0
- codeplain-0.2.1/tests/data/imports/diamond_imports_main.plain +13 -0
- codeplain-0.2.1/tests/data/imports/non_existent_import.plain +12 -0
- codeplain-0.2.1/tests/data/plainfile/duplicate_specification_heading.plain +7 -0
- codeplain-0.2.1/tests/data/plainfile/invalid_specification_order.plain +7 -0
- codeplain-0.2.1/tests/data/plainfile/missing_non_functional_requirements.plain +5 -0
- codeplain-0.2.1/tests/data/plainfile/plain_source_with_absolute_link.plain +9 -0
- codeplain-0.2.1/tests/data/plainfile/plain_source_with_url_link.plain +9 -0
- codeplain-0.2.1/tests/data/plainfile/task_manager_with_reference_links.plain +40 -0
- codeplain-0.2.1/tests/data/plainfile/without_non_functional_requirement.plain +5 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_acceptance_tests.plain +20 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_acceptance_tests_nondefined.plain +20 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_defined_nondefined.plain +18 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_defined_nondefined_2.plain +18 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_definition.plain +16 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_noconcepts.plain +18 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_nonconcept.plain +15 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_nondefined.plain +18 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_redefinition.plain +19 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_several_concepts.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/concept_validation_valid.plain +16 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_base.plain +2 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_example.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_missing.plain +8 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_missing_example.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_nested.plain +15 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_nested_example.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_transitive_example.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_transitive_l1.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/exported_concepts_transitive_l2.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/plain_file_parser_with_comments.plain +8 -0
- codeplain-0.2.1/tests/data/plainfileparser/plain_file_with_comments_indented.plain +10 -0
- codeplain-0.2.1/tests/data/plainfileparser/regular_plain_source.plain +11 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts.plain +7 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_defs.plain +2 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_example.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_l1.plain +7 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_l2.plain +5 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_missing.plain +10 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_module.plain +11 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_partial.plain +13 -0
- codeplain-0.2.1/tests/data/plainfileparser/required_concepts_partial_duplicate.plain +14 -0
- codeplain-0.2.1/tests/data/plainfileparser/topological_sort.plain +14 -0
- codeplain-0.2.1/tests/data/plainfileparser/topological_sort_not_referenced.plain +22 -0
- codeplain-0.2.1/tests/data/requires/circular_requires_main.plain +18 -0
- codeplain-0.2.1/tests/data/requires/circular_requires_sub.plain +12 -0
- codeplain-0.2.1/tests/data/requires/diamond_requires_1.plain +12 -0
- codeplain-0.2.1/tests/data/requires/diamond_requires_2.plain +12 -0
- codeplain-0.2.1/tests/data/requires/diamond_requires_common.plain +7 -0
- codeplain-0.2.1/tests/data/requires/diamond_requires_main.plain +19 -0
- codeplain-0.2.1/tests/data/requires/independent_requires_1.plain +7 -0
- codeplain-0.2.1/tests/data/requires/independent_requires_2.plain +7 -0
- codeplain-0.2.1/tests/data/requires/independent_requires_main.plain +19 -0
- codeplain-0.2.1/tests/data/requires/non_existent_require.plain +18 -0
- codeplain-0.2.1/tests/data/requires/normal_requires_1.plain +12 -0
- codeplain-0.2.1/tests/data/requires/normal_requires_2.plain +12 -0
- codeplain-0.2.1/tests/data/requires/normal_requires_common.plain +7 -0
- codeplain-0.2.1/tests/data/requires/normal_requires_main.plain +19 -0
- codeplain-0.2.1/tests/data/simple.plain +7 -0
- codeplain-0.2.1/tests/data/templates/block_level_include.plain +12 -0
- codeplain-0.2.1/tests/data/templates/code_variables.plain +10 -0
- codeplain-0.2.1/tests/data/templates/header.plain +7 -0
- codeplain-0.2.1/tests/data/templates/implement.plain +3 -0
- codeplain-0.2.1/tests/data/templates/implement_2.plain +3 -0
- codeplain-0.2.1/tests/data/templates/template_include.plain +4 -0
- codeplain-0.2.1/tests/data/templates/test_hardest_problem.plain +2 -0
- codeplain-0.2.1/tests/test_git_utils.py +458 -0
- codeplain-0.2.1/tests/test_imports.py +42 -0
- codeplain-0.2.1/tests/test_plainfile.py +271 -0
- codeplain-0.2.1/tests/test_plainfileparser.py +532 -0
- codeplain-0.2.1/tests/test_plainspec.py +67 -0
- codeplain-0.2.1/tests/test_requires.py +27 -0
- codeplain-0.2.1/tui/__init__.py +1 -0
- codeplain-0.2.1/tui/components.py +372 -0
- codeplain-0.2.1/tui/models.py +56 -0
- codeplain-0.2.1/tui/plain2code_tui.py +268 -0
- codeplain-0.2.1/tui/state_handlers.py +307 -0
- codeplain-0.2.1/tui/styles.css +213 -0
- codeplain-0.2.1/tui/widget_helpers.py +159 -0
- codeplain-0.1.0/codeplain.egg-info/PKG-INFO +0 -142
- codeplain-0.1.0/codeplain.egg-info/SOURCES.txt +0 -54
- codeplain-0.1.0/codeplain.egg-info/dependency_links.txt +0 -1
- codeplain-0.1.0/codeplain.egg-info/entry_points.txt +0 -2
- codeplain-0.1.0/codeplain.egg-info/requires.txt +0 -34
- codeplain-0.1.0/codeplain.egg-info/top_level.txt +0 -36
- codeplain-0.1.0/plain2code.py +0 -218
- codeplain-0.1.0/plain2code_state.py +0 -75
- codeplain-0.1.0/pyproject.toml +0 -164
- codeplain-0.1.0/render_machine/actions/prepare_repositories.py +0 -50
- codeplain-0.1.0/render_machine/actions/prepare_testing_environment.py +0 -30
- codeplain-0.1.0/render_machine/actions/run_conformance_tests.py +0 -44
- codeplain-0.1.0/render_machine/actions/run_unit_tests.py +0 -38
- codeplain-0.1.0/render_machine/implementation_code_helpers.py +0 -20
- codeplain-0.1.0/render_machine/render_context.py +0 -280
- codeplain-0.1.0/render_machine/render_types.py +0 -36
- codeplain-0.1.0/setup.cfg +0 -4
- codeplain-0.1.0/standard_template_library/golang-console-app-template.plain +0 -36
- codeplain-0.1.0/standard_template_library/python-console-app-template.plain +0 -32
- {codeplain-0.1.0 → codeplain-0.2.1}/LICENSE +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/config/system_config.yaml +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/hash_key.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/plain2code_exceptions.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/plain2code_nodes.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/plain2code_read_config.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/actions/base_action.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/conformance_test_helpers.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/render_machine/triggers.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/standard_template_library/__init__.py +0 -0
- {codeplain-0.1.0 → codeplain-0.2.1}/system_config.py +0 -0
codeplain-0.2.1/.flake8
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
|
@@ -0,0 +1,22 @@
|
|
|
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 }}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
name: Build distribution
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.11"
|
|
21
|
+
|
|
22
|
+
- name: Extract version from tag
|
|
23
|
+
id: get_version
|
|
24
|
+
run: |
|
|
25
|
+
# Strip 'v' prefix from tag (v0.2.1 -> 0.2.1)
|
|
26
|
+
VERSION=${GITHUB_REF_NAME#v}
|
|
27
|
+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
|
28
|
+
echo "Extracted version: $VERSION"
|
|
29
|
+
|
|
30
|
+
- name: Update version in pyproject.toml
|
|
31
|
+
run: |
|
|
32
|
+
sed -i "s/^version = .*/version = \"${{ steps.get_version.outputs.VERSION }}\"/" pyproject.toml
|
|
33
|
+
echo "Updated pyproject.toml:"
|
|
34
|
+
grep "^version" pyproject.toml
|
|
35
|
+
|
|
36
|
+
- name: Commit version update to repo
|
|
37
|
+
run: |
|
|
38
|
+
git config user.name "github-actions[bot]"
|
|
39
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
40
|
+
git add pyproject.toml
|
|
41
|
+
git commit -m "Bump version to ${{ steps.get_version.outputs.VERSION }}"
|
|
42
|
+
git push origin HEAD:main
|
|
43
|
+
|
|
44
|
+
- name: Install build dependencies
|
|
45
|
+
run: |
|
|
46
|
+
python -m pip install --upgrade pip
|
|
47
|
+
pip install build
|
|
48
|
+
|
|
49
|
+
- name: Build package
|
|
50
|
+
run: python -m build
|
|
51
|
+
|
|
52
|
+
- name: Store the distribution packages
|
|
53
|
+
uses: actions/upload-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: python-package-distributions
|
|
56
|
+
path: dist/
|
|
57
|
+
|
|
58
|
+
- name: Upload assets to GitHub Release
|
|
59
|
+
env:
|
|
60
|
+
GH_TOKEN: ${{ github.token }}
|
|
61
|
+
run: |
|
|
62
|
+
gh release upload ${{ github.ref_name }} dist/* --clobber
|
|
63
|
+
|
|
64
|
+
publish-to-pypi:
|
|
65
|
+
name: Publish to PyPI
|
|
66
|
+
needs: build
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
environment:
|
|
69
|
+
name: pypi
|
|
70
|
+
url: https://pypi.org/p/codeplain
|
|
71
|
+
|
|
72
|
+
steps:
|
|
73
|
+
- name: Download distribution packages
|
|
74
|
+
uses: actions/download-artifact@v4
|
|
75
|
+
with:
|
|
76
|
+
name: python-package-distributions
|
|
77
|
+
path: dist/
|
|
78
|
+
|
|
79
|
+
- name: Install twine
|
|
80
|
+
run: pip install twine
|
|
81
|
+
|
|
82
|
+
- name: Publish to PyPI
|
|
83
|
+
env:
|
|
84
|
+
TWINE_USERNAME: __token__
|
|
85
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
|
86
|
+
run: twine upload dist/*
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
__pycache__
|
|
2
|
+
.DS_Store
|
|
3
|
+
|
|
4
|
+
# Plain
|
|
5
|
+
examples/**/build*/
|
|
6
|
+
examples/**/conformance_tests/
|
|
7
|
+
examples/**/conformance_tests.backup/
|
|
8
|
+
examples/**/node_build/
|
|
9
|
+
examples/**/node_conformance_tests/
|
|
10
|
+
examples/**/package-lock.json
|
|
11
|
+
examples/**/node_modules/
|
|
12
|
+
examples/**/node_harness_tests/
|
|
13
|
+
examples/**/plain_modules/
|
|
14
|
+
|
|
15
|
+
examples/**/go_build/
|
|
16
|
+
examples/**/python_build/
|
|
17
|
+
|
|
18
|
+
examples/**/go_plain_modules/
|
|
19
|
+
examples/**/python_plain_modules/
|
|
20
|
+
examples/**/node_plain_modules/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
*.log
|
|
24
|
+
|
|
25
|
+
.venv
|
|
26
|
+
build
|
|
27
|
+
dist
|
|
28
|
+
*.egg-info
|
|
29
|
+
|
|
30
|
+
.env
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Debug plain2code.py for file hello_world_python.plain",
|
|
6
|
+
"type": "debugpy",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"program": "${workspaceFolder}/plain2code.py",
|
|
9
|
+
"args": [
|
|
10
|
+
"${workspaceFolder}/examples/example_hello_world_python/hello_world_python.plain",
|
|
11
|
+
],
|
|
12
|
+
"subProcess": false,
|
|
13
|
+
"cwd": "${workspaceFolder}/examples/example_hello_world_python",
|
|
14
|
+
"console": "integratedTerminal",
|
|
15
|
+
"justMyCode": false,
|
|
16
|
+
"env": {
|
|
17
|
+
"PYTHONPATH": "${workspaceFolder}"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"editor.insertSpaces": true,
|
|
4
|
+
"editor.detectIndentation": false,
|
|
5
|
+
"editor.codeActionsOnSave": {
|
|
6
|
+
"source.organizeImports": "explicit"
|
|
7
|
+
},
|
|
8
|
+
"[python]": {
|
|
9
|
+
"editor.defaultFormatter": "ms-python.black-formatter",
|
|
10
|
+
"editor.formatOnSave": true,
|
|
11
|
+
"editor.rulers": [120],
|
|
12
|
+
"editor.insertSpaces": true,
|
|
13
|
+
"editor.tabSize": 4
|
|
14
|
+
},
|
|
15
|
+
"editor.defaultFormatter": "ms-python.black-formatter",
|
|
16
|
+
"notebook.defaultFormatter": "ms-python.black-formatter",
|
|
17
|
+
"python.testing.unittestEnabled": true,
|
|
18
|
+
"python.testing.pytestEnabled": false,
|
|
19
|
+
"python.testing.unittestArgs": [
|
|
20
|
+
"-v",
|
|
21
|
+
"-p",
|
|
22
|
+
"test_*.py",
|
|
23
|
+
"-t",
|
|
24
|
+
"${workspaceFolder}"
|
|
25
|
+
],
|
|
26
|
+
"python.analysis.extraPaths": [
|
|
27
|
+
"${workspaceFolder}"
|
|
28
|
+
],
|
|
29
|
+
"files.associations": {
|
|
30
|
+
"**/tests/data/*": "text"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,51 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeplain
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Transform plain language specifications into working code
|
|
5
|
+
License-File: LICENSE
|
|
5
6
|
Classifier: Environment :: Console
|
|
6
7
|
Classifier: Intended Audience :: Developers
|
|
7
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
11
9
|
Classifier: Topic :: Software Development :: Code Generators
|
|
12
10
|
Requires-Python: >=3.11
|
|
13
|
-
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Requires-Dist: python-liquid2==0.3.0
|
|
11
|
+
Requires-Dist: gitpython==3.1.42
|
|
16
12
|
Requires-Dist: mistletoe==1.3.0
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist: langchain-aws==1.0.0
|
|
22
|
-
Requires-Dist: langchain-cerebras==0.8.0
|
|
23
|
-
Requires-Dist: langchain-google-genai==4.1.2
|
|
24
|
-
Requires-Dist: langchain-ollama==1.0.0
|
|
13
|
+
Requires-Dist: networkx==3.6.1
|
|
14
|
+
Requires-Dist: python-frontmatter==1.1.0
|
|
15
|
+
Requires-Dist: python-liquid2==0.3.0
|
|
16
|
+
Requires-Dist: pyyaml==6.0.2
|
|
25
17
|
Requires-Dist: requests==2.32.3
|
|
26
|
-
Requires-Dist: langsmith==0.4.4
|
|
27
18
|
Requires-Dist: rich==14.2.0
|
|
28
|
-
Requires-Dist: tiktoken==0.12.0
|
|
29
|
-
Requires-Dist: PyYAML==6.0.2
|
|
30
|
-
Requires-Dist: gitpython==3.1.42
|
|
31
|
-
Requires-Dist: lizard==1.18.0
|
|
32
19
|
Requires-Dist: textual==1.0.0
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist: psycopg2==2.9.10
|
|
35
|
-
Requires-Dist: python-dotenv==1.1.0
|
|
20
|
+
Requires-Dist: tiktoken==0.12.0
|
|
36
21
|
Requires-Dist: transitions==0.9.3
|
|
37
|
-
Requires-Dist: cryptography==46.0.1
|
|
38
22
|
Provides-Extra: dev
|
|
39
|
-
Requires-Dist:
|
|
40
|
-
Requires-Dist: flake8==7.0.0; extra ==
|
|
41
|
-
Requires-Dist:
|
|
42
|
-
Requires-Dist:
|
|
43
|
-
Requires-Dist:
|
|
44
|
-
|
|
45
|
-
Requires-Dist: flake8-eradicate==1.5.0; extra == "dev"
|
|
46
|
-
Requires-Dist: pep8-naming==0.15.1; extra == "dev"
|
|
47
|
-
Requires-Dist: mypy==1.11.2; extra == "dev"
|
|
48
|
-
Dynamic: license-file
|
|
23
|
+
Requires-Dist: black==24.2.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: flake8==7.0.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: isort==5.13.2; extra == 'dev'
|
|
26
|
+
Requires-Dist: mypy==1.11.2; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest==8.3.5; extra == 'dev'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
49
29
|
|
|
50
30
|
# Codeplain plain2code renderer
|
|
51
31
|
|
|
@@ -57,7 +37,7 @@ Codeplain is a platform that generates software code using large language models
|
|
|
57
37
|
|
|
58
38
|
Schematic overview of the Codeplain's code generation service
|
|
59
39
|
|
|
60
|
-
<img src="resources/codeplain_overview.png">
|
|
40
|
+
<img src="https://raw.githubusercontent.com/Codeplain-ai/plain2code_client/main/resources/codeplain_overview.png">
|
|
61
41
|
|
|
62
42
|
### Abstracting Away Code Generation Complexity with ***plain
|
|
63
43
|
|
|
@@ -66,7 +46,7 @@ Schematic overview of the Codeplain's code generation service
|
|
|
66
46
|
|
|
67
47
|
An example application in ***plain
|
|
68
48
|
|
|
69
|
-
<img src="resources/plain_example.png" width="70%" height="70%">
|
|
49
|
+
<img src="https://raw.githubusercontent.com/Codeplain-ai/plain2code_client/main/resources/plain_example.png" width="70%" height="70%">
|
|
70
50
|
|
|
71
51
|
|
|
72
52
|
## Getting started
|
|
@@ -8,7 +8,7 @@ Codeplain is a platform that generates software code using large language models
|
|
|
8
8
|
|
|
9
9
|
Schematic overview of the Codeplain's code generation service
|
|
10
10
|
|
|
11
|
-
<img src="resources/codeplain_overview.png">
|
|
11
|
+
<img src="https://raw.githubusercontent.com/Codeplain-ai/plain2code_client/main/resources/codeplain_overview.png">
|
|
12
12
|
|
|
13
13
|
### Abstracting Away Code Generation Complexity with ***plain
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ Schematic overview of the Codeplain's code generation service
|
|
|
17
17
|
|
|
18
18
|
An example application in ***plain
|
|
19
19
|
|
|
20
|
-
<img src="resources/plain_example.png" width="70%" height="70%">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/Codeplain-ai/plain2code_client/main/resources/plain_example.png" width="70%" height="70%">
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
## Getting started
|