gsql2rsql 0.1.4__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.
Files changed (184) hide show
  1. gsql2rsql-0.1.4/.github/PULL_REQUEST_TEMPLATE.md +44 -0
  2. gsql2rsql-0.1.4/.github/RELEASING.md +68 -0
  3. gsql2rsql-0.1.4/.github/workflows/ci.yml +106 -0
  4. gsql2rsql-0.1.4/.github/workflows/commitlint.yml +17 -0
  5. gsql2rsql-0.1.4/.github/workflows/docs.yml +59 -0
  6. gsql2rsql-0.1.4/.github/workflows/release.yml +158 -0
  7. gsql2rsql-0.1.4/.gitignore +221 -0
  8. gsql2rsql-0.1.4/CHANGELOG.md +481 -0
  9. gsql2rsql-0.1.4/CONTRIBUTING.md +297 -0
  10. gsql2rsql-0.1.4/CypherParser.g4 +495 -0
  11. gsql2rsql-0.1.4/Makefile +378 -0
  12. gsql2rsql-0.1.4/PKG-INFO +330 -0
  13. gsql2rsql-0.1.4/README.md +297 -0
  14. gsql2rsql-0.1.4/antlr-4.13.1-complete.jar +0 -0
  15. gsql2rsql-0.1.4/docs/00-summary.md +31 -0
  16. gsql2rsql-0.1.4/docs/01-quickstart.md +225 -0
  17. gsql2rsql-0.1.4/docs/02-architecture.md +490 -0
  18. gsql2rsql-0.1.4/docs/03-decision-log.md +474 -0
  19. gsql2rsql-0.1.4/docs/04-limitations.md +530 -0
  20. gsql2rsql-0.1.4/docs/05-testing-and-examples.md +636 -0
  21. gsql2rsql-0.1.4/docs/06-contributing.md +700 -0
  22. gsql2rsql-0.1.4/docs/07-developer-guide.md +828 -0
  23. gsql2rsql-0.1.4/docs/08-api-reference.md +979 -0
  24. gsql2rsql-0.1.4/docs/about.md +31 -0
  25. gsql2rsql-0.1.4/docs/api-reference.md +979 -0
  26. gsql2rsql-0.1.4/docs/architecture.md +490 -0
  27. gsql2rsql-0.1.4/docs/cli-commands.md +299 -0
  28. gsql2rsql-0.1.4/docs/contributing.md +700 -0
  29. gsql2rsql-0.1.4/docs/decision-log.md +474 -0
  30. gsql2rsql-0.1.4/docs/examples/credit.md +3187 -0
  31. gsql2rsql-0.1.4/docs/examples/features.md +4559 -0
  32. gsql2rsql-0.1.4/docs/examples/fraud.md +3510 -0
  33. gsql2rsql-0.1.4/docs/examples/index.md +40 -0
  34. gsql2rsql-0.1.4/docs/first-query.md +168 -0
  35. gsql2rsql-0.1.4/docs/includes/.gitkeep +0 -0
  36. gsql2rsql-0.1.4/docs/index.md +364 -0
  37. gsql2rsql-0.1.4/docs/installation.md +389 -0
  38. gsql2rsql-0.1.4/docs/javascripts/extra.js +12 -0
  39. gsql2rsql-0.1.4/docs/limitations.md +530 -0
  40. gsql2rsql-0.1.4/docs/query-translation.md +447 -0
  41. gsql2rsql-0.1.4/docs/quickstart.md +225 -0
  42. gsql2rsql-0.1.4/docs/stylesheets/extra.css +17 -0
  43. gsql2rsql-0.1.4/examples/credit_queries.yaml +358 -0
  44. gsql2rsql-0.1.4/examples/features_queries.yaml +812 -0
  45. gsql2rsql-0.1.4/examples/fraud_queries.yaml +467 -0
  46. gsql2rsql-0.1.4/examples/generate_artifacts.py +387 -0
  47. gsql2rsql-0.1.4/examples/run_transpiler.py +308 -0
  48. gsql2rsql-0.1.4/examples/schema.json +24 -0
  49. gsql2rsql-0.1.4/examples/schema_single_edge_table.json +35 -0
  50. gsql2rsql-0.1.4/mkdocs.yml +189 -0
  51. gsql2rsql-0.1.4/pyproject.toml +143 -0
  52. gsql2rsql-0.1.4/requirements-docs.txt +20 -0
  53. gsql2rsql-0.1.4/scripts/dump_query_sql.py +329 -0
  54. gsql2rsql-0.1.4/scripts/generate_all_golden_files.py +217 -0
  55. gsql2rsql-0.1.4/scripts/generate_example_docs.py +270 -0
  56. gsql2rsql-0.1.4/scripts/generate_test_template.py +180 -0
  57. gsql2rsql-0.1.4/src/gsql2rsql/__init__.py +8 -0
  58. gsql2rsql-0.1.4/src/gsql2rsql/cli.py +2207 -0
  59. gsql2rsql-0.1.4/src/gsql2rsql/common/__init__.py +19 -0
  60. gsql2rsql-0.1.4/src/gsql2rsql/common/exceptions.py +314 -0
  61. gsql2rsql-0.1.4/src/gsql2rsql/common/logging.py +65 -0
  62. gsql2rsql-0.1.4/src/gsql2rsql/common/schema.py +127 -0
  63. gsql2rsql-0.1.4/src/gsql2rsql/common/utils.py +54 -0
  64. gsql2rsql-0.1.4/src/gsql2rsql/parser/__init__.py +6 -0
  65. gsql2rsql-0.1.4/src/gsql2rsql/parser/ast.py +767 -0
  66. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/Cypher.g4 +811 -0
  67. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/Cypher.interp +368 -0
  68. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/Cypher.tokens +173 -0
  69. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/CypherLexer.interp +418 -0
  70. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/CypherLexer.py +837 -0
  71. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/CypherLexer.tokens +173 -0
  72. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/CypherListener.py +948 -0
  73. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/CypherParser.py +10708 -0
  74. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/CypherVisitor.py +533 -0
  75. gsql2rsql-0.1.4/src/gsql2rsql/parser/grammar/__init__.py +18 -0
  76. gsql2rsql-0.1.4/src/gsql2rsql/parser/opencypher_parser.py +66 -0
  77. gsql2rsql-0.1.4/src/gsql2rsql/parser/operators.py +341 -0
  78. gsql2rsql-0.1.4/src/gsql2rsql/parser/visitor.py +1525 -0
  79. gsql2rsql-0.1.4/src/gsql2rsql/planner/__init__.py +30 -0
  80. gsql2rsql-0.1.4/src/gsql2rsql/planner/column_ref.py +252 -0
  81. gsql2rsql-0.1.4/src/gsql2rsql/planner/column_resolver.py +1268 -0
  82. gsql2rsql-0.1.4/src/gsql2rsql/planner/data_types.py +421 -0
  83. gsql2rsql-0.1.4/src/gsql2rsql/planner/logical_plan.py +1474 -0
  84. gsql2rsql-0.1.4/src/gsql2rsql/planner/operators.py +1236 -0
  85. gsql2rsql-0.1.4/src/gsql2rsql/planner/path_analyzer.py +610 -0
  86. gsql2rsql-0.1.4/src/gsql2rsql/planner/schema.py +323 -0
  87. gsql2rsql-0.1.4/src/gsql2rsql/planner/subquery_optimizer.py +1717 -0
  88. gsql2rsql-0.1.4/src/gsql2rsql/planner/symbol_table.py +427 -0
  89. gsql2rsql-0.1.4/src/gsql2rsql/pyspark_executor.py +323 -0
  90. gsql2rsql-0.1.4/src/gsql2rsql/renderer/__init__.py +6 -0
  91. gsql2rsql-0.1.4/src/gsql2rsql/renderer/schema_provider.py +272 -0
  92. gsql2rsql-0.1.4/src/gsql2rsql/renderer/sql_renderer.py +4428 -0
  93. gsql2rsql-0.1.4/test_schema_debug.py +61 -0
  94. gsql2rsql-0.1.4/tests/__init__.py +1 -0
  95. gsql2rsql-0.1.4/tests/conftest.py +141 -0
  96. gsql2rsql-0.1.4/tests/docs/01_simple_node_lookup.md +30 -0
  97. gsql2rsql-0.1.4/tests/docs/02_node_with_property_filter.md +34 -0
  98. gsql2rsql-0.1.4/tests/docs/03_property_projection_aliases.md +30 -0
  99. gsql2rsql-0.1.4/tests/docs/04_pagination_skip_limit.md +36 -0
  100. gsql2rsql-0.1.4/tests/docs/05_count_nodes.md +31 -0
  101. gsql2rsql-0.1.4/tests/docs/07_relationship_property_filter.md +42 -0
  102. gsql2rsql-0.1.4/tests/docs/08_undirected_relationship.md +49 -0
  103. gsql2rsql-0.1.4/tests/docs/09_optional_match.md +42 -0
  104. gsql2rsql-0.1.4/tests/docs/11_aggregation_group_by.md +92 -0
  105. gsql2rsql-0.1.4/tests/docs/12_aggregation_order_by.md +106 -0
  106. gsql2rsql-0.1.4/tests/docs/13_having_filter_with.md +100 -0
  107. gsql2rsql-0.1.4/tests/docs/14_collect_aggregation.md +90 -0
  108. gsql2rsql-0.1.4/tests/docs/15_distinct_rows.md +116 -0
  109. gsql2rsql-0.1.4/tests/docs/16_variable_length_path.md +154 -0
  110. gsql2rsql-0.1.4/tests/docs/17_case_expression.md +130 -0
  111. gsql2rsql-0.1.4/tests/docs/18_exists_pattern.md +183 -0
  112. gsql2rsql-0.1.4/tests/docs/19_union.md +201 -0
  113. gsql2rsql-0.1.4/tests/docs/20_coalesce.md +126 -0
  114. gsql2rsql-0.1.4/tests/docs/21_variable_length_zero.md +327 -0
  115. gsql2rsql-0.1.4/tests/schemas/recursive_test_schema.json +27 -0
  116. gsql2rsql-0.1.4/tests/test_aggregation_entity_projection.py +195 -0
  117. gsql2rsql-0.1.4/tests/test_authoritative_types.py +570 -0
  118. gsql2rsql-0.1.4/tests/test_cli.py +303 -0
  119. gsql2rsql-0.1.4/tests/test_column_resolution_pipeline.py +745 -0
  120. gsql2rsql-0.1.4/tests/test_column_resolver.py +309 -0
  121. gsql2rsql-0.1.4/tests/test_defensive_join_rendering.py +204 -0
  122. gsql2rsql-0.1.4/tests/test_error_position_tracking.py +199 -0
  123. gsql2rsql-0.1.4/tests/test_examples_with_pyspark.py +562 -0
  124. gsql2rsql-0.1.4/tests/test_logical_plan_dump.py +141 -0
  125. gsql2rsql-0.1.4/tests/test_multi_with_entity_continuation.py +201 -0
  126. gsql2rsql-0.1.4/tests/test_parser.py +121 -0
  127. gsql2rsql-0.1.4/tests/test_path_analyzer.py +572 -0
  128. gsql2rsql-0.1.4/tests/test_planner.py +174 -0
  129. gsql2rsql-0.1.4/tests/test_pyspark_basic.py +352 -0
  130. gsql2rsql-0.1.4/tests/test_renderer.py +649 -0
  131. gsql2rsql-0.1.4/tests/test_renderer_resolution_integration.py +553 -0
  132. gsql2rsql-0.1.4/tests/test_schema.py +114 -0
  133. gsql2rsql-0.1.4/tests/test_schema_propagation.py +1031 -0
  134. gsql2rsql-0.1.4/tests/test_symbol_duplication_fix.py +118 -0
  135. gsql2rsql-0.1.4/tests/test_symbol_table.py +448 -0
  136. gsql2rsql-0.1.4/tests/test_undirected_optimization.py +242 -0
  137. gsql2rsql-0.1.4/tests/test_variable_length_path_field_naming.py +391 -0
  138. gsql2rsql-0.1.4/tests/transpile_tests/test_01_simple_node_lookup.py +137 -0
  139. gsql2rsql-0.1.4/tests/transpile_tests/test_02_node_with_property_filter.py +138 -0
  140. gsql2rsql-0.1.4/tests/transpile_tests/test_03_property_projection_aliases.py +136 -0
  141. gsql2rsql-0.1.4/tests/transpile_tests/test_06_single_hop_relationship.py +105 -0
  142. gsql2rsql-0.1.4/tests/transpile_tests/test_07_relationship_property_filter.py +175 -0
  143. gsql2rsql-0.1.4/tests/transpile_tests/test_08_undirected_relationship.py +192 -0
  144. gsql2rsql-0.1.4/tests/transpile_tests/test_09_optional_match.py +227 -0
  145. gsql2rsql-0.1.4/tests/transpile_tests/test_10_relationship_join_no_cartesian.py +145 -0
  146. gsql2rsql-0.1.4/tests/transpile_tests/test_11_aggregation_group_by.py +215 -0
  147. gsql2rsql-0.1.4/tests/transpile_tests/test_12_aggregation_order_by.py +204 -0
  148. gsql2rsql-0.1.4/tests/transpile_tests/test_14_collect_aggregation.py +195 -0
  149. gsql2rsql-0.1.4/tests/transpile_tests/test_15_distinct_rows.py +178 -0
  150. gsql2rsql-0.1.4/tests/transpile_tests/test_17_case_expression.py +188 -0
  151. gsql2rsql-0.1.4/tests/transpile_tests/test_18_exists_pattern.py +257 -0
  152. gsql2rsql-0.1.4/tests/transpile_tests/test_19_union.py +232 -0
  153. gsql2rsql-0.1.4/tests/transpile_tests/test_20_coalesce.py +174 -0
  154. gsql2rsql-0.1.4/tests/transpile_tests/test_21_variable_length_zero.py +304 -0
  155. gsql2rsql-0.1.4/tests/transpile_tests/test_22_parameterized_in.py +221 -0
  156. gsql2rsql-0.1.4/tests/transpile_tests/test_23_having_aggregation.py +227 -0
  157. gsql2rsql-0.1.4/tests/transpile_tests/test_24_all_any_predicate.py +311 -0
  158. gsql2rsql-0.1.4/tests/transpile_tests/test_25_unwind.py +597 -0
  159. gsql2rsql-0.1.4/tests/transpile_tests/test_26_unwind_cartesian.py +216 -0
  160. gsql2rsql-0.1.4/tests/transpile_tests/test_27_unwind_null_handling.py +219 -0
  161. gsql2rsql-0.1.4/tests/transpile_tests/test_28_unwind_aggregation.py +252 -0
  162. gsql2rsql-0.1.4/tests/transpile_tests/test_29_unwind_range.py +237 -0
  163. gsql2rsql-0.1.4/tests/transpile_tests/test_30_math_functions.py +300 -0
  164. gsql2rsql-0.1.4/tests/transpile_tests/test_31_list_comprehension.py +204 -0
  165. gsql2rsql-0.1.4/tests/transpile_tests/test_32_reduce.py +194 -0
  166. gsql2rsql-0.1.4/tests/transpile_tests/test_33_ordered_collect.py +174 -0
  167. gsql2rsql-0.1.4/tests/transpile_tests/test_34_datetime.py +251 -0
  168. gsql2rsql-0.1.4/tests/transpile_tests/test_35_map_literals.py +228 -0
  169. gsql2rsql-0.1.4/tests/transpile_tests/test_36_path_functions.py +192 -0
  170. gsql2rsql-0.1.4/tests/transpile_tests/test_37_source_node_filter_pushdown.py +310 -0
  171. gsql2rsql-0.1.4/tests/transpile_tests/test_38_undirected_predicate_pushdown.py +657 -0
  172. gsql2rsql-0.1.4/tests/transpile_tests/test_39_recursive_sink_filter_pushdown.py +597 -0
  173. gsql2rsql-0.1.4/tests/transpile_tests/test_40_conjunction_splitting_pushdown.py +1060 -0
  174. gsql2rsql-0.1.4/tests/transpile_tests/test_41_column_projection_through_aggregation.py +414 -0
  175. gsql2rsql-0.1.4/tests/transpile_tests/test_42_shared_variable_join_condition.py +282 -0
  176. gsql2rsql-0.1.4/tests/transpile_tests/test_43_bare_entity_in_group_by.py +221 -0
  177. gsql2rsql-0.1.4/tests/transpile_tests/test_44_match_after_aggregating_with.py +634 -0
  178. gsql2rsql-0.1.4/tests/transpile_tests/test_multi_edge_types.py +223 -0
  179. gsql2rsql-0.1.4/tests/transpile_tests/test_subquery_flattening.py +474 -0
  180. gsql2rsql-0.1.4/tests/utils/__init__.py +47 -0
  181. gsql2rsql-0.1.4/tests/utils/sample_data_generator.py +557 -0
  182. gsql2rsql-0.1.4/tests/utils/sql_assertions.py +518 -0
  183. gsql2rsql-0.1.4/tests/utils/sql_test_utils.py +406 -0
  184. gsql2rsql-0.1.4/uv.lock +548 -0
@@ -0,0 +1,44 @@
1
+ ## Description
2
+
3
+ <!-- Describe your changes in detail -->
4
+
5
+ ## Type of Change
6
+
7
+ <!-- Mark the relevant option with an "x" -->
8
+
9
+ - [ ] `feat`: New feature (triggers minor version bump)
10
+ - [ ] `fix`: Bug fix (triggers patch version bump)
11
+ - [ ] `perf`: Performance improvement (triggers patch version bump)
12
+ - [ ] `docs`: Documentation only changes
13
+ - [ ] `style`: Code style changes (formatting, missing semi colons, etc)
14
+ - [ ] `refactor`: Code refactoring without functionality changes
15
+ - [ ] `test`: Adding or updating tests
16
+ - [ ] `chore`: Changes to build process or auxiliary tools
17
+ - [ ] `ci`: Changes to CI configuration files and scripts
18
+
19
+ ## Motivation and Context
20
+
21
+ <!-- Why is this change required? What problem does it solve? -->
22
+
23
+ ## How Has This Been Tested?
24
+
25
+ <!-- Please describe the tests you ran to verify your changes -->
26
+
27
+ - [ ] Unit tests pass (`make test-no-pyspark`)
28
+ - [ ] PySpark tests pass (`make test-pyspark`)
29
+ - [ ] Linting passes (`make lint`)
30
+ - [ ] Type checking passes (`make typecheck`)
31
+
32
+ ## Checklist
33
+
34
+ - [ ] My code follows the code style of this project
35
+ - [ ] I have updated the documentation accordingly
36
+ - [ ] I have added tests to cover my changes
37
+ - [ ] All new and existing tests passed
38
+ - [ ] My commit messages follow the [Conventional Commits](https://www.conventionalcommits.org/) specification
39
+
40
+ ## Related Issues
41
+
42
+ <!-- Link any related issues here. Use "Closes #123" to auto-close issues when merged -->
43
+
44
+ Closes #
@@ -0,0 +1,68 @@
1
+ # Releasing gsql2rsql
2
+
3
+ ## Quick Reference
4
+
5
+ ### Commit Types → Version Bumps
6
+
7
+ ```bash
8
+ feat: new feature → 0.1.0 → 0.2.0 (minor)
9
+ fix: bug fix → 0.1.0 → 0.1.1 (patch)
10
+ perf: performance → 0.1.0 → 0.1.1 (patch)
11
+ docs: documentation → No bump
12
+ test: tests → No bump
13
+ chore: maintenance → No bump
14
+ ```
15
+
16
+ ### Breaking Changes → Major Version
17
+
18
+ ```bash
19
+ feat!: breaking change → 0.1.0 → 1.0.0 (major)
20
+
21
+ # Or with footer
22
+ feat: new API design
23
+
24
+ BREAKING CHANGE: Old API removed
25
+ ```
26
+
27
+ ## How Releases Work
28
+
29
+ 1. **Merge PR to main** with conventional commit message
30
+ 2. **GitHub Actions automatically**:
31
+ - Analyzes commits since last release
32
+ - Bumps version
33
+ - Generates CHANGELOG
34
+ - Creates GitHub Release
35
+ - Publishes to PyPI
36
+ - Deploys documentation
37
+
38
+ ## Makefile Commands
39
+
40
+ ```bash
41
+ make commit-feat # Interactive feature commit
42
+ make commit-fix # Interactive fix commit
43
+ make release-dry-run # Preview next release
44
+ make changelog # Generate changelog preview
45
+ ```
46
+
47
+ ## Manual Release (Emergency Only)
48
+
49
+ ```bash
50
+ make release # Creates release locally
51
+ make publish # Publishes to PyPI
52
+ ```
53
+
54
+ **Note**: Manual releases are discouraged. Use GitHub Actions.
55
+
56
+ ## Setup PyPI Trusted Publisher
57
+
58
+ 1. Go to https://pypi.org/manage/account/publishing/
59
+ 2. Add trusted publisher:
60
+ - Repository: `devmessias/gsql2rsql`
61
+ - Workflow: `release.yml`
62
+ - Environment: (empty)
63
+
64
+ No API tokens needed!
65
+
66
+ ## Full Documentation
67
+
68
+ See [docs/development/RELEASE_PROCESS.md](../docs/development/RELEASE_PROCESS.md)
@@ -0,0 +1,106 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v3
26
+
27
+ - name: Install dependencies
28
+ run: |
29
+ uv sync --extra dev
30
+ uv pip install -e ".[dev]"
31
+
32
+ - name: Lint with ruff
33
+ run: uv run ruff check .
34
+
35
+ - name: Type check with mypy
36
+ run: uv run mypy src/gsql2rsql
37
+
38
+ # - name: Generate golden files
39
+ # run: make generate-golden-files
40
+
41
+ # - name: Run unit tests
42
+ # run: make test-no-pyspark
43
+
44
+ - name: Upload coverage
45
+ uses: codecov/codecov-action@v4
46
+ if: matrix.python-version == '3.12'
47
+ with:
48
+ token: ${{ secrets.CODECOV_TOKEN }}
49
+
50
+ test-pyspark:
51
+ runs-on: ubuntu-latest
52
+ needs: test
53
+
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+
57
+ - name: Set up Python 3.12
58
+ uses: actions/setup-python@v5
59
+ with:
60
+ python-version: "3.12"
61
+
62
+ - name: Set up Java 11
63
+ uses: actions/setup-java@v4
64
+ with:
65
+ distribution: 'temurin'
66
+ java-version: '11'
67
+
68
+ - name: Install uv
69
+ uses: astral-sh/setup-uv@v3
70
+
71
+ - name: Install dependencies
72
+ run: |
73
+ uv sync --extra dev
74
+ uv pip install -e ".[dev]"
75
+
76
+ - name: Run PySpark tests
77
+ run: make test-pyspark
78
+
79
+ docs:
80
+ runs-on: ubuntu-latest
81
+
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+
85
+ - name: Set up Python 3.12
86
+ uses: actions/setup-python@v5
87
+ with:
88
+ python-version: "3.12"
89
+
90
+ - name: Install uv
91
+ uses: astral-sh/setup-uv@v3
92
+
93
+ - name: Install dependencies
94
+ run: |
95
+ uv sync
96
+ uv pip install -e .
97
+ uv pip install mkdocs-material mkdocs-awesome-pages-plugin mkdocs-minify-plugin mkdocs-macros-plugin
98
+
99
+ - name: Build documentation
100
+ run: make docs-build
101
+
102
+ - name: Upload docs artifact
103
+ uses: actions/upload-artifact@v4
104
+ with:
105
+ name: docs
106
+ path: site/
@@ -0,0 +1,17 @@
1
+ name: Lint Commits
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, edited, synchronize, reopened]
6
+
7
+ jobs:
8
+ commitlint:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ with:
13
+ fetch-depth: 0
14
+
15
+ - uses: wagoid/commitlint-github-action@v6
16
+ with:
17
+ configFile: .commitlintrc.json
@@ -0,0 +1,59 @@
1
+ name: Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - 'docs/**'
9
+ - 'examples/**'
10
+ - 'mkdocs.yml'
11
+ - 'requirements-docs.txt'
12
+ - 'scripts/generate_example_docs.py'
13
+ - '.github/workflows/docs.yml'
14
+ workflow_dispatch: # Allow manual trigger
15
+
16
+ permissions:
17
+ contents: write # Required for gh-pages deployment
18
+
19
+ jobs:
20
+ deploy:
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v4
26
+ with:
27
+ fetch-depth: 0 # Fetch all history for git-revision-date plugin
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: '3.12'
33
+
34
+ - name: Install uv
35
+ uses: astral-sh/setup-uv@v5
36
+ with:
37
+ enable-cache: true
38
+
39
+ - name: Install project and documentation dependencies
40
+ run: |
41
+ uv sync
42
+ uv pip install -e .
43
+ uv pip install -r requirements-docs.txt
44
+
45
+ - name: Generate transpilation artifacts
46
+ run: |
47
+ uv run python examples/generate_artifacts.py
48
+
49
+ - name: Generate documentation pages
50
+ run: |
51
+ uv run python scripts/generate_example_docs.py
52
+
53
+ - name: Build documentation
54
+ run: |
55
+ uv run mkdocs build
56
+
57
+ - name: Deploy to GitHub Pages
58
+ run: |
59
+ uv run mkdocs gh-deploy --force
@@ -0,0 +1,158 @@
1
+ name: Release & Publish
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch: # Allow manual trigger
8
+
9
+ permissions:
10
+ contents: write # Create releases and tags
11
+ id-token: write # OIDC for PyPI trusted publishing
12
+
13
+ jobs:
14
+ release:
15
+ name: Create Release
16
+ runs-on: ubuntu-latest
17
+ concurrency: release # Prevent concurrent releases
18
+
19
+ outputs:
20
+ released: ${{ steps.release.outputs.released }}
21
+ version: ${{ steps.release.outputs.version }}
22
+ tag: ${{ steps.release.outputs.tag }}
23
+
24
+ steps:
25
+ - name: Checkout code
26
+ uses: actions/checkout@v4
27
+ with:
28
+ fetch-depth: 0 # Full history for semantic-release
29
+ token: ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ - name: Set up Python 3.12
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: "3.12"
35
+
36
+ - name: Install uv
37
+ uses: astral-sh/setup-uv@v5
38
+ with:
39
+ enable-cache: true
40
+
41
+ - name: Install dependencies
42
+ run: |
43
+ uv sync --extra dev
44
+ uv pip install -e ".[dev]"
45
+ uv pip install python-semantic-release
46
+
47
+ # temporarily disabled tests to release other fixes
48
+ # - name: Generate golden files
49
+ # run: make generate-golden-files
50
+
51
+ # - name: Run tests
52
+ # run: make test-no-pyspark
53
+
54
+ - name: Semantic Release (version bump, changelog, tag)
55
+ id: release
56
+ uses: python-semantic-release/python-semantic-release@v9.8.0
57
+ with:
58
+ github_token: ${{ secrets.GITHUB_TOKEN }}
59
+
60
+ build:
61
+ name: Build Package
62
+ needs: release
63
+ if: needs.release.outputs.released == 'true'
64
+ runs-on: ubuntu-latest
65
+
66
+ steps:
67
+ - name: Checkout code at tag
68
+ uses: actions/checkout@v4
69
+ with:
70
+ ref: ${{ needs.release.outputs.tag }}
71
+
72
+ - name: Set up Python 3.12
73
+ uses: actions/setup-python@v5
74
+ with:
75
+ python-version: "3.12"
76
+
77
+ - name: Install uv
78
+ uses: astral-sh/setup-uv@v5
79
+ with:
80
+ enable-cache: true
81
+
82
+ - name: Install dependencies
83
+ run: |
84
+ uv sync --extra dev
85
+ uv pip install -e ".[dev]"
86
+
87
+ # - name: Run tests
88
+ # run: make test-no-pyspark
89
+
90
+ - name: Build package
91
+ run: |
92
+ uv pip install build
93
+ uv run python -m build
94
+
95
+ - name: Upload build artifacts
96
+ uses: actions/upload-artifact@v4
97
+ with:
98
+ name: python-package-distributions
99
+ path: dist/
100
+
101
+ publish-pypi:
102
+ name: Publish to PyPI
103
+ needs: [release, build]
104
+ if: needs.release.outputs.released == 'true'
105
+ runs-on: ubuntu-latest
106
+ environment:
107
+ name: pypi
108
+ url: https://pypi.org/project/gsql2rsql/
109
+
110
+ permissions:
111
+ id-token: write # OIDC for trusted publishing
112
+
113
+ steps:
114
+ - name: Download build artifacts
115
+ uses: actions/download-artifact@v4
116
+ with:
117
+ name: python-package-distributions
118
+ path: dist/
119
+
120
+ - name: Publish to PyPI
121
+ uses: pypa/gh-action-pypi-publish@release/v1
122
+ # OIDC trusted publisher - configure at: https://pypi.org/manage/account/publishing/
123
+ # Project: gsql2rsql
124
+ # Workflow: release.yml
125
+ # Environment: pypi
126
+
127
+ create-release:
128
+ name: Create GitHub Release
129
+ needs: [release, build, publish-pypi]
130
+ if: needs.release.outputs.released == 'true'
131
+ runs-on: ubuntu-latest
132
+
133
+ steps:
134
+ - name: Download build artifacts
135
+ uses: actions/download-artifact@v4
136
+ with:
137
+ name: python-package-distributions
138
+ path: dist/
139
+
140
+ - name: Create GitHub Release
141
+ uses: softprops/action-gh-release@v1
142
+ with:
143
+ tag_name: ${{ needs.release.outputs.tag }}
144
+ files: dist/*
145
+ generate_release_notes: true
146
+
147
+ notify:
148
+ name: Notify Release
149
+ needs: [release, create-release]
150
+ if: needs.release.outputs.released == 'true'
151
+ runs-on: ubuntu-latest
152
+
153
+ steps:
154
+ - name: Print release info
155
+ run: |
156
+ echo "🎉 Released version ${{ needs.release.outputs.version }}"
157
+ echo "📦 Published to PyPI: https://pypi.org/project/gsql2rsql/${{ needs.release.outputs.version }}/"
158
+ echo "🏷️ Tag: ${{ needs.release.outputs.tag }}"
@@ -0,0 +1,221 @@
1
+ tests/output
2
+ out/
3
+ # Byte-compiled / optimized / DLL files
4
+ __pycache__/
5
+ *.py[codz]
6
+ *$py.class
7
+ tests/output/
8
+ docs/development
9
+ docs_help_dev
10
+ .vscode
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py.cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ # For a library or package, you might want to ignore these files since the code is
92
+ # intended to run in multiple environments; otherwise, check them in:
93
+ # .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ # Pipfile.lock
101
+
102
+ # UV
103
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ # uv.lock
107
+
108
+ # poetry
109
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
111
+ # commonly ignored for libraries.
112
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113
+ # poetry.lock
114
+ # poetry.toml
115
+
116
+ # pdm
117
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
118
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
119
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
120
+ # pdm.lock
121
+ # pdm.toml
122
+ .pdm-python
123
+ .pdm-build/
124
+
125
+ # pixi
126
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
127
+ # pixi.lock
128
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
129
+ # in the .venv directory. It is recommended not to include this directory in version control.
130
+ .pixi
131
+
132
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
133
+ __pypackages__/
134
+
135
+ # Celery stuff
136
+ celerybeat-schedule
137
+ celerybeat.pid
138
+
139
+ # Redis
140
+ *.rdb
141
+ *.aof
142
+ *.pid
143
+
144
+ # RabbitMQ
145
+ mnesia/
146
+ rabbitmq/
147
+ rabbitmq-data/
148
+
149
+ # ActiveMQ
150
+ activemq-data/
151
+
152
+ # SageMath parsed files
153
+ *.sage.py
154
+
155
+ # Environments
156
+ .env
157
+ .envrc
158
+ .venv
159
+ env/
160
+ venv/
161
+ ENV/
162
+ env.bak/
163
+ venv.bak/
164
+
165
+ # Spyder project settings
166
+ .spyderproject
167
+ .spyproject
168
+
169
+ # Rope project settings
170
+ .ropeproject
171
+
172
+ # mkdocs documentation
173
+ /site
174
+
175
+ # mypy
176
+ .mypy_cache/
177
+ .dmypy.json
178
+ dmypy.json
179
+
180
+ # Pyre type checker
181
+ .pyre/
182
+
183
+ # pytype static type analyzer
184
+ .pytype/
185
+
186
+ # Cython debug symbols
187
+ cython_debug/
188
+
189
+ # PyCharm
190
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
191
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
192
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
193
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
194
+ # .idea/
195
+
196
+ # Abstra
197
+ # Abstra is an AI-powered process automation framework.
198
+ # Ignore directories containing user credentials, local state, and settings.
199
+ # Learn more at https://abstra.io/docs
200
+ .abstra/
201
+
202
+ # Visual Studio Code
203
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
204
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
205
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
206
+ # you could uncomment the following to ignore the entire vscode folder
207
+ # .vscode/
208
+
209
+ # Ruff stuff:
210
+ .ruff_cache/
211
+
212
+ # PyPI configuration file
213
+ .pypirc
214
+
215
+ # Marimo
216
+ marimo/_static/
217
+ marimo/_lsp/
218
+ __marimo__/
219
+
220
+ # Streamlit
221
+ .streamlit/secrets.toml