flowyml-notebook 1.0.0__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 (117) hide show
  1. flowyml_notebook-1.0.0/.github/recovery/last_release_version.txt +1 -0
  2. flowyml_notebook-1.0.0/.github/workflows/MANUAL_DOCS_PUBLISH.yml +78 -0
  3. flowyml_notebook-1.0.0/.github/workflows/MANUAL_PYPI_PUBLISH.yml +62 -0
  4. flowyml_notebook-1.0.0/.github/workflows/PRECOMMITS.yml +47 -0
  5. flowyml_notebook-1.0.0/.github/workflows/PR_PREVIEW.yml +55 -0
  6. flowyml_notebook-1.0.0/.github/workflows/RELEASE.yml +226 -0
  7. flowyml_notebook-1.0.0/.github/workflows/UTESTS.yml +131 -0
  8. flowyml_notebook-1.0.0/.gitignore +59 -0
  9. flowyml_notebook-1.0.0/.pre-commit-config.yaml +42 -0
  10. flowyml_notebook-1.0.0/CHANGELOG.md +25 -0
  11. flowyml_notebook-1.0.0/CODE_OF_CONDUCT.md +54 -0
  12. flowyml_notebook-1.0.0/CONTRIBUTING.md +122 -0
  13. flowyml_notebook-1.0.0/FlowyML E2E Demo.py +60 -0
  14. flowyml_notebook-1.0.0/LICENSE +201 -0
  15. flowyml_notebook-1.0.0/Makefile +121 -0
  16. flowyml_notebook-1.0.0/PKG-INFO +359 -0
  17. flowyml_notebook-1.0.0/README.md +289 -0
  18. flowyml_notebook-1.0.0/SECURITY.md +43 -0
  19. flowyml_notebook-1.0.0/assets/logo.png +0 -0
  20. flowyml_notebook-1.0.0/assets/screenshot_dag.png +0 -0
  21. flowyml_notebook-1.0.0/assets/screenshot_editor.png +0 -0
  22. flowyml_notebook-1.0.0/assets/screenshot_landing.png +0 -0
  23. flowyml_notebook-1.0.0/docs/api.md +173 -0
  24. flowyml_notebook-1.0.0/docs/architecture.md +135 -0
  25. flowyml_notebook-1.0.0/docs/assets/hero.png +0 -0
  26. flowyml_notebook-1.0.0/docs/assets/logo.png +0 -0
  27. flowyml_notebook-1.0.0/docs/collaboration.md +265 -0
  28. flowyml_notebook-1.0.0/docs/exploration.md +87 -0
  29. flowyml_notebook-1.0.0/docs/features.md +338 -0
  30. flowyml_notebook-1.0.0/docs/getting-started.md +163 -0
  31. flowyml_notebook-1.0.0/docs/index.md +153 -0
  32. flowyml_notebook-1.0.0/docs/integration.md +252 -0
  33. flowyml_notebook-1.0.0/docs/recipes.md +161 -0
  34. flowyml_notebook-1.0.0/docs/screenshots/apps.png +0 -0
  35. flowyml_notebook-1.0.0/docs/screenshots/assets.png +0 -0
  36. flowyml_notebook-1.0.0/docs/screenshots/comments.png +0 -0
  37. flowyml_notebook-1.0.0/docs/screenshots/dag.png +0 -0
  38. flowyml_notebook-1.0.0/docs/screenshots/deploy.png +0 -0
  39. flowyml_notebook-1.0.0/docs/screenshots/flowy-connection.png +0 -0
  40. flowyml_notebook-1.0.0/docs/screenshots/github.png +0 -0
  41. flowyml_notebook-1.0.0/docs/screenshots/notebook.png +0 -0
  42. flowyml_notebook-1.0.0/docs/screenshots/pandas-display.png +0 -0
  43. flowyml_notebook-1.0.0/docs/screenshots/pandas-display2.png +0 -0
  44. flowyml_notebook-1.0.0/docs/screenshots/pangas-display3.png +0 -0
  45. flowyml_notebook-1.0.0/docs/screenshots/pipelines.png +0 -0
  46. flowyml_notebook-1.0.0/docs/screenshots/recipies.png +0 -0
  47. flowyml_notebook-1.0.0/docs/screenshots/recommendations.png +0 -0
  48. flowyml_notebook-1.0.0/docs/screenshots/reports.png +0 -0
  49. flowyml_notebook-1.0.0/docs/screenshots/snapshots.png +0 -0
  50. flowyml_notebook-1.0.0/docs/stylesheets/extra.css +112 -0
  51. flowyml_notebook-1.0.0/flowyml_notebook/__init__.py +49 -0
  52. flowyml_notebook-1.0.0/flowyml_notebook/ai/__init__.py +1 -0
  53. flowyml_notebook-1.0.0/flowyml_notebook/ai/assistant.py +340 -0
  54. flowyml_notebook-1.0.0/flowyml_notebook/cells.py +451 -0
  55. flowyml_notebook-1.0.0/flowyml_notebook/cli.py +231 -0
  56. flowyml_notebook-1.0.0/flowyml_notebook/connection.py +276 -0
  57. flowyml_notebook-1.0.0/flowyml_notebook/core.py +745 -0
  58. flowyml_notebook-1.0.0/flowyml_notebook/deployer.py +187 -0
  59. flowyml_notebook-1.0.0/flowyml_notebook/dev_server.py +468 -0
  60. flowyml_notebook-1.0.0/flowyml_notebook/frontend/dist/assets/index-CdAI7Rrf.css +10 -0
  61. flowyml_notebook-1.0.0/flowyml_notebook/frontend/dist/assets/index-CxaUFb4m.js +1434 -0
  62. flowyml_notebook-1.0.0/flowyml_notebook/frontend/dist/index.html +17 -0
  63. flowyml_notebook-1.0.0/flowyml_notebook/frontend/index.html +16 -0
  64. flowyml_notebook-1.0.0/flowyml_notebook/frontend/package-lock.json +3629 -0
  65. flowyml_notebook-1.0.0/flowyml_notebook/frontend/package.json +33 -0
  66. flowyml_notebook-1.0.0/flowyml_notebook/frontend/postcss.config.js +6 -0
  67. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/App.jsx +320 -0
  68. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/AIPanel.jsx +294 -0
  69. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/AppPublisher.jsx +278 -0
  70. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/CellEditor.jsx +274 -0
  71. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/CellList.jsx +79 -0
  72. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/CellOutput.jsx +234 -0
  73. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/CellRecipes.jsx +1593 -0
  74. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/ChartRenderer.jsx +179 -0
  75. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/CommandPalette.jsx +147 -0
  76. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/CommentsPanel.jsx +331 -0
  77. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/ConnectionConfig.jsx +175 -0
  78. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/DataFrameExplorer.jsx +1375 -0
  79. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/FileUploader.jsx +128 -0
  80. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/FilesExplorer.jsx +165 -0
  81. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/FlowyMLPanel.jsx +686 -0
  82. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/InputWidgets.jsx +221 -0
  83. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/MarkdownRenderer.jsx +205 -0
  84. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/NotebookHeader.jsx +229 -0
  85. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/NotebookManager.jsx +238 -0
  86. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/PipelineDAG.jsx +291 -0
  87. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/PipelineDAGViewer.jsx +316 -0
  88. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/ReportGenerator.jsx +205 -0
  89. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/Sidebar.jsx +588 -0
  90. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/StatusBar.jsx +95 -0
  91. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/components/VersionHistory.jsx +177 -0
  92. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/hooks/useNotebook.js +531 -0
  93. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/index.css +2504 -0
  94. flowyml_notebook-1.0.0/flowyml_notebook/frontend/src/main.jsx +10 -0
  95. flowyml_notebook-1.0.0/flowyml_notebook/frontend/tailwind.config.js +42 -0
  96. flowyml_notebook-1.0.0/flowyml_notebook/frontend/vite.config.js +20 -0
  97. flowyml_notebook-1.0.0/flowyml_notebook/github_sync.py +587 -0
  98. flowyml_notebook-1.0.0/flowyml_notebook/kernel.py +280 -0
  99. flowyml_notebook-1.0.0/flowyml_notebook/magics.py +153 -0
  100. flowyml_notebook-1.0.0/flowyml_notebook/notebook_manager.py +227 -0
  101. flowyml_notebook-1.0.0/flowyml_notebook/reactive.py +341 -0
  102. flowyml_notebook-1.0.0/flowyml_notebook/recipes_store.py +134 -0
  103. flowyml_notebook-1.0.0/flowyml_notebook/reporting.py +457 -0
  104. flowyml_notebook-1.0.0/flowyml_notebook/scheduler_bridge.py +134 -0
  105. flowyml_notebook-1.0.0/flowyml_notebook/server.py +2015 -0
  106. flowyml_notebook-1.0.0/flowyml_notebook/sql/__init__.py +5 -0
  107. flowyml_notebook-1.0.0/flowyml_notebook/sql/engine.py +168 -0
  108. flowyml_notebook-1.0.0/flowyml_notebook/ui/__init__.py +315 -0
  109. flowyml_notebook-1.0.0/flowyml_notebook/ui/app_mode.py +733 -0
  110. flowyml_notebook-1.0.0/flowyml_notebook/ui/flowyml_widgets.py +336 -0
  111. flowyml_notebook-1.0.0/mkdocs.yml +118 -0
  112. flowyml_notebook-1.0.0/pyproject.toml +121 -0
  113. flowyml_notebook-1.0.0/tests/__init__.py +1 -0
  114. flowyml_notebook-1.0.0/tests/run_tests.py +164 -0
  115. flowyml_notebook-1.0.0/tests/test_cells.py +257 -0
  116. flowyml_notebook-1.0.0/tests/test_core.py +177 -0
  117. flowyml_notebook-1.0.0/tests/test_reactive.py +193 -0
@@ -0,0 +1,78 @@
1
+ name: "Manual Documentation Publish"
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ RELEASE_VERSION:
7
+ required: true
8
+ type: string
9
+ description: "Release version for documentation"
10
+ UPDATE_LATEST:
11
+ required: true
12
+ type: boolean
13
+ default: true
14
+ description: "Update the 'latest' alias to point to this version"
15
+
16
+ permissions:
17
+ contents: write
18
+
19
+ jobs:
20
+ UPDATE_DOCS:
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@v4
25
+ with:
26
+ ref: main
27
+ fetch-depth: 1
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.11"
33
+
34
+ - name: Install dependencies
35
+ run: |
36
+ python -m pip install --upgrade pip
37
+ pip install ".[docs]"
38
+
39
+ - name: Fetch gh-pages branch
40
+ run: |
41
+ git config user.name "${{ github.actor }}"
42
+ git config user.email "${{ github.actor }}@users.noreply.github.com"
43
+
44
+ # Fetch the gh-pages branch
45
+ git fetch origin gh-pages:gh-pages || echo "No gh-pages branch exists yet"
46
+
47
+ - name: Release documentation with mike
48
+ id: deploy_docs
49
+ run: |
50
+ echo "Deploying documentation for version ${{ inputs.RELEASE_VERSION }}"
51
+
52
+ # Set up command based on whether to update latest alias
53
+ if [[ "${{ inputs.UPDATE_LATEST }}" == "true" ]]; then
54
+ echo "Updating 'latest' alias to point to version ${{ inputs.RELEASE_VERSION }}"
55
+ COMMAND="mike deploy --push --update-aliases ${{ inputs.RELEASE_VERSION }} latest"
56
+ else
57
+ echo "Not updating 'latest' alias"
58
+ COMMAND="mike deploy --push ${{ inputs.RELEASE_VERSION }}"
59
+ fi
60
+
61
+ # Execute the command
62
+ $COMMAND
63
+ continue-on-error: true
64
+
65
+ - name: Retry documentation release on failure
66
+ if: steps.deploy_docs.outcome == 'failure'
67
+ run: |
68
+ echo "First documentation deploy attempt failed, retrying..."
69
+
70
+ # Force-fetch the latest gh-pages branch
71
+ git fetch origin gh-pages:gh-pages --force
72
+
73
+ # Set up command based on whether to update latest alias
74
+ if [[ "${{ inputs.UPDATE_LATEST }}" == "true" ]]; then
75
+ mike deploy --push --update-aliases --force ${{ inputs.RELEASE_VERSION }} latest
76
+ else
77
+ mike deploy --push --force ${{ inputs.RELEASE_VERSION }}
78
+ fi
@@ -0,0 +1,62 @@
1
+ name: "Manual PyPI Publish"
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ RELEASE_VERSION:
7
+ required: true
8
+ type: string
9
+ description: "Release version to publish to PyPI"
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ PYPI_PUBLISH:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - name: Checkout repository
19
+ uses: actions/checkout@v4
20
+ with:
21
+ ref: main
22
+ fetch-depth: 1
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.11"
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install build twine
33
+
34
+ - name: Install project dependencies
35
+ run: |
36
+ pip install ".[all]"
37
+
38
+ - name: Set version for publishing
39
+ run: |
40
+ echo "Setting package version to ${{ inputs.RELEASE_VERSION }}"
41
+ sed -i "s/^version = .*/version = \"${{ inputs.RELEASE_VERSION }}\"/" pyproject.toml
42
+
43
+ - name: Build and publish to PyPI
44
+ id: publish_pypi
45
+ run: |
46
+ python -m build
47
+ twine upload dist/*
48
+ env:
49
+ TWINE_USERNAME: __token__
50
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
51
+ continue-on-error: true
52
+
53
+ - name: Retry PyPI publish on failure
54
+ if: steps.publish_pypi.outcome == 'failure'
55
+ run: |
56
+ echo "First attempt failed, retrying..."
57
+ sleep 10
58
+ python -m build
59
+ twine upload dist/*
60
+ env:
61
+ TWINE_USERNAME: __token__
62
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,47 @@
1
+ name: Pre-commit checks
2
+ on:
3
+ pull_request:
4
+ branches:
5
+ - dev
6
+ - main
7
+ types:
8
+ - opened
9
+ - edited
10
+ - synchronize
11
+ workflow_dispatch:
12
+
13
+ concurrency:
14
+ group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
15
+ cancel-in-progress: true
16
+
17
+ jobs:
18
+ pre-commit-checks:
19
+ runs-on: ["ubuntu-latest"]
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Set up Python
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.11"
26
+ - name: Check Pull Request Title
27
+ uses: Slashgear/action-check-pr-title@main
28
+ with:
29
+ regexp: '(break|build|ci|docs|feat|fix|perf|refactor|style|test|ops|hotfix)\\([a-z,A-Z,0-9,\\-,\\_,\\/,:]+\\)(:)\\s{1}([\\w\\s]+)' # Regex the title should match.
30
+ - name: Getting changed files list
31
+ id: files
32
+ uses: jitterbit/get-changed-files@master
33
+ - name: Checking changed files
34
+ shell: bash
35
+ run: |
36
+ echo "Changed files"
37
+ echo ${{ steps.files.outputs.all }}
38
+ echo "Github Client version"
39
+ echo $(gh --version)
40
+ - name: Pre-Commit Checks
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ pip install pre-commit
44
+ echo "Running pre-commit scans:"
45
+ # adding log display in case of pre-commit errors
46
+ pre-commit run -v --files ${{ steps.files.outputs.all }}
47
+ shell: bash
@@ -0,0 +1,55 @@
1
+ name: Deploy PR Pages Preview
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches:
7
+ - dev
8
+ - main
9
+ paths:
10
+ - "docs/**"
11
+ - mkdocs.yml
12
+ pull_request:
13
+ branches:
14
+ - dev
15
+ - main
16
+ paths:
17
+ - "docs/**"
18
+ - mkdocs.yml
19
+ types:
20
+ - opened
21
+ - reopened
22
+ - edited
23
+ - synchronize
24
+
25
+ concurrency: preview-${{ github.ref }}
26
+
27
+ jobs:
28
+ deploy-pr-preview:
29
+ runs-on: ["ubuntu-latest"]
30
+ steps:
31
+ - name: Checkout
32
+ uses: actions/checkout@v4
33
+
34
+ - name: Set up Python 3.11
35
+ uses: actions/setup-python@v5
36
+ with:
37
+ python-version: "3.11"
38
+
39
+ - name: Install Python dependencies
40
+ shell: bash
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ pip install ".[docs]"
44
+
45
+ - name: Install and Build
46
+ shell: bash
47
+ run: |
48
+ mkdocs build
49
+ echo "DOC GENERATED - OK!"
50
+
51
+ - name: Deploy preview
52
+ uses: rossjrw/pr-preview-action@v1
53
+ with:
54
+ source-dir: ./site/
55
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,226 @@
1
+ name: "Semantic Release"
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ DRY_RUN:
7
+ required: false
8
+ default: false
9
+ type: boolean
10
+ description: "Run in dry run mode (no actual release)"
11
+ RELEASE_VERSION:
12
+ required: false
13
+ type: string
14
+ description: "Manually specify release version (only for manual publish/docs jobs)"
15
+ SKIP_RELEASE:
16
+ required: false
17
+ default: false
18
+ type: boolean
19
+ description: "Skip semantic release and use existing version (for recovery)"
20
+
21
+ permissions:
22
+ contents: write
23
+ pages: write
24
+ id-token: write
25
+
26
+ jobs:
27
+ SEMANTIC_RELEASE:
28
+ if: ${{ !inputs.SKIP_RELEASE }}
29
+ runs-on: ubuntu-latest
30
+ outputs:
31
+ new_release_version: ${{ steps.semantic-release.outputs.new_release_version }}
32
+ release_created: ${{ steps.semantic-release.outputs.new_release_published }}
33
+ steps:
34
+ - name: Checkout repository
35
+ uses: actions/checkout@v4
36
+ with:
37
+ fetch-depth: 0
38
+ token: ${{ secrets.GITHUB_TOKEN }}
39
+
40
+ - name: Set up Python
41
+ uses: actions/setup-python@v5
42
+ with:
43
+ python-version: "3.11"
44
+
45
+ - name: Install dependencies
46
+ run: |
47
+ python -m pip install --upgrade pip
48
+ pip install python-semantic-release
49
+
50
+ - name: Semantic Release
51
+ id: semantic-release
52
+ run: |
53
+ if [[ "${{ inputs.DRY_RUN }}" == "true" ]]; then
54
+ echo "Running in dry-run mode"
55
+ semantic-release version --print
56
+ echo "new_release_published=false" >> $GITHUB_OUTPUT
57
+ else
58
+ semantic-release version
59
+ if [ $? -eq 0 ]; then
60
+ VERSION=$(semantic-release version --print)
61
+ echo "new_release_published=true" >> $GITHUB_OUTPUT
62
+ echo "new_release_version=$VERSION" >> $GITHUB_OUTPUT
63
+ else
64
+ echo "new_release_published=false" >> $GITHUB_OUTPUT
65
+ fi
66
+ fi
67
+ env:
68
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69
+
70
+ - name: Show release information
71
+ shell: bash
72
+ run: |
73
+ echo "Release created: ${{ steps.semantic-release.outputs.new_release_published }}"
74
+ echo "New version: ${{ steps.semantic-release.outputs.new_release_version }}"
75
+
76
+ - name: Save release version
77
+ if: steps.semantic-release.outputs.new_release_published == 'true'
78
+ run: |
79
+ echo "Saving release version for recovery"
80
+ mkdir -p .github/recovery
81
+ echo "${{ steps.semantic-release.outputs.new_release_version }}" > .github/recovery/last_release_version.txt
82
+ git config user.name "${{ github.actor }}"
83
+ git config user.email "${{ github.actor }}@users.noreply.github.com"
84
+ git add .github/recovery/last_release_version.txt
85
+ git commit -m "chore: save last release version for recovery [skip ci]" || echo "No changes to commit"
86
+ git push || echo "Failed to push recovery file"
87
+
88
+ PYPI_PUBLISH:
89
+ needs: [SEMANTIC_RELEASE]
90
+ if: ${{ needs.SEMANTIC_RELEASE.outputs.release_created == 'true' || inputs.SKIP_RELEASE }}
91
+ runs-on: ubuntu-latest
92
+ steps:
93
+ - name: Checkout repository
94
+ uses: actions/checkout@v4
95
+ with:
96
+ ref: main
97
+ fetch-depth: 1
98
+
99
+ - name: Get version to publish
100
+ id: get_version
101
+ run: |
102
+ if [[ "${{ inputs.SKIP_RELEASE }}" == "true" ]]; then
103
+ if [[ -n "${{ inputs.RELEASE_VERSION }}" ]]; then
104
+ echo "Using manually specified version: ${{ inputs.RELEASE_VERSION }}"
105
+ echo "VERSION=${{ inputs.RELEASE_VERSION }}" >> $GITHUB_OUTPUT
106
+ else
107
+ if [[ -f ".github/recovery/last_release_version.txt" ]]; then
108
+ VERSION=$(cat .github/recovery/last_release_version.txt)
109
+ echo "Using recovered version: $VERSION"
110
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
111
+ else
112
+ echo "ERROR: No version specified and no recovery file found"
113
+ exit 1
114
+ fi
115
+ fi
116
+ else
117
+ echo "Using version from semantic-release: ${{ needs.SEMANTIC_RELEASE.outputs.new_release_version }}"
118
+ echo "VERSION=${{ needs.SEMANTIC_RELEASE.outputs.new_release_version }}" >> $GITHUB_OUTPUT
119
+ fi
120
+
121
+ - name: Set up Python
122
+ uses: actions/setup-python@v5
123
+ with:
124
+ python-version: "3.11"
125
+
126
+ - name: Install dependencies
127
+ run: |
128
+ python -m pip install --upgrade pip
129
+ pip install build twine
130
+
131
+ - name: Set version for publishing
132
+ run: |
133
+ echo "Setting package version to ${{ steps.get_version.outputs.VERSION }}"
134
+ sed -i "s/^version = .*/version = \"${{ steps.get_version.outputs.VERSION }}\"/" pyproject.toml
135
+
136
+ - name: Build and publish to PyPI
137
+ id: publish_pypi
138
+ run: |
139
+ python -m build
140
+ twine upload dist/*
141
+ env:
142
+ TWINE_USERNAME: __token__
143
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
144
+ continue-on-error: true
145
+
146
+ - name: Retry PyPI publish on failure
147
+ if: steps.publish_pypi.outcome == 'failure'
148
+ run: |
149
+ echo "First attempt failed, retrying..."
150
+ sleep 10
151
+ python -m build
152
+ twine upload dist/*
153
+ env:
154
+ TWINE_USERNAME: __token__
155
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
156
+
157
+ UPDATE_DOCS:
158
+ needs: [SEMANTIC_RELEASE, PYPI_PUBLISH]
159
+ if: ${{ (needs.SEMANTIC_RELEASE.outputs.release_created == 'true' && !failure('PYPI_PUBLISH')) || inputs.SKIP_RELEASE }}
160
+ runs-on: ubuntu-latest
161
+ steps:
162
+ - name: Checkout repository
163
+ uses: actions/checkout@v4
164
+ with:
165
+ ref: main
166
+ fetch-depth: 1
167
+
168
+ - name: Get version for docs
169
+ id: get_docs_version
170
+ run: |
171
+ if [[ "${{ inputs.SKIP_RELEASE }}" == "true" ]]; then
172
+ if [[ -n "${{ inputs.RELEASE_VERSION }}" ]]; then
173
+ echo "Using manually specified version: ${{ inputs.RELEASE_VERSION }}"
174
+ echo "VERSION=${{ inputs.RELEASE_VERSION }}" >> $GITHUB_OUTPUT
175
+ else
176
+ if [[ -f ".github/recovery/last_release_version.txt" ]]; then
177
+ VERSION=$(cat .github/recovery/last_release_version.txt)
178
+ echo "Using recovered version: $VERSION"
179
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
180
+ else
181
+ echo "ERROR: No version specified and no recovery file found"
182
+ exit 1
183
+ fi
184
+ fi
185
+ else
186
+ echo "Using version from semantic-release: ${{ needs.SEMANTIC_RELEASE.outputs.new_release_version }}"
187
+ echo "VERSION=${{ needs.SEMANTIC_RELEASE.outputs.new_release_version }}" >> $GITHUB_OUTPUT
188
+ fi
189
+
190
+ - name: Set up Python
191
+ uses: actions/setup-python@v5
192
+ with:
193
+ python-version: "3.11"
194
+
195
+ - name: Install dependencies
196
+ run: |
197
+ python -m pip install --upgrade pip
198
+ pip install ".[docs]"
199
+
200
+ - name: Fetch gh-pages branch
201
+ run: |
202
+ git config user.name "${{ github.actor }}"
203
+ git config user.email "${{ github.actor }}@users.noreply.github.com"
204
+
205
+ # Fetch the gh-pages branch
206
+ git fetch origin gh-pages:gh-pages || echo "No gh-pages branch exists yet"
207
+
208
+ - name: Release documentation with mike
209
+ id: deploy_docs
210
+ run: |
211
+ echo "Deploying documentation for version ${{ steps.get_docs_version.outputs.VERSION }}"
212
+
213
+ # Attempt to deploy docs
214
+ mike deploy --push --update-aliases ${{ steps.get_docs_version.outputs.VERSION }} latest
215
+ continue-on-error: true
216
+
217
+ - name: Retry documentation release on failure
218
+ if: steps.deploy_docs.outcome == 'failure'
219
+ run: |
220
+ echo "First documentation deploy attempt failed, retrying..."
221
+
222
+ # Force-fetch the latest gh-pages branch
223
+ git fetch origin gh-pages:gh-pages --force
224
+
225
+ # Use the version from recovery process
226
+ mike deploy --push --update-aliases --force ${{ steps.get_docs_version.outputs.VERSION }} latest
@@ -0,0 +1,131 @@
1
+ name: "Unit-tests"
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - dev
7
+ - main
8
+ paths:
9
+ - "**.py"
10
+ - "pyproject.toml"
11
+ - "tests/**"
12
+ pull_request:
13
+ branches:
14
+ - dev
15
+ - main
16
+ types:
17
+ - opened
18
+ - edited
19
+ - synchronize
20
+ paths:
21
+ - "**.py"
22
+ - "pyproject.toml"
23
+ - "tests/**"
24
+ workflow_dispatch:
25
+ inputs:
26
+ PYTHON_VERSION:
27
+ required: false
28
+ default: "3.11"
29
+
30
+ concurrency:
31
+ group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
32
+ cancel-in-progress: true
33
+
34
+ jobs:
35
+ # Fast smoke test job for quick feedback
36
+ smoke-test:
37
+ runs-on: ubuntu-latest
38
+ if: github.event_name == 'pull_request'
39
+ steps:
40
+ - uses: actions/checkout@v4
41
+ - name: Set up Python
42
+ uses: actions/setup-python@v5
43
+ with:
44
+ python-version: "3.11"
45
+ - name: Install dependencies
46
+ run: |
47
+ python -m pip install --upgrade pip
48
+ pip install ".[all]"
49
+ pip install pytest pytest-cov
50
+ - name: Run smoke tests
51
+ run: |
52
+ # Run a quick subset of tests for fast feedback
53
+ pytest tests/ -v --maxfail=3 --tb=short -x
54
+ timeout-minutes: 3
55
+
56
+ # Main test matrix
57
+ test-matrix:
58
+ runs-on: ubuntu-latest
59
+ needs: [smoke-test]
60
+ if: always() && (needs.smoke-test.result == 'success' || github.event_name != 'pull_request')
61
+ strategy:
62
+ fail-fast: false
63
+ matrix:
64
+ python-version: ["3.10", "3.11", "3.12"]
65
+
66
+ steps:
67
+ - uses: actions/checkout@v4
68
+ - name: Set up Python ${{ matrix.python-version }}
69
+ uses: actions/setup-python@v5
70
+ with:
71
+ python-version: ${{ matrix.python-version }}
72
+ cache: 'pip'
73
+
74
+ - name: Install dependencies
75
+ run: |
76
+ python -m pip install --upgrade pip
77
+ pip install ".[all]"
78
+ pip install pytest pytest-cov
79
+
80
+ - name: Run tests
81
+ run: |
82
+ pytest tests/ -v --maxfail=10
83
+ timeout-minutes: 15
84
+
85
+ - name: Upload test results
86
+ uses: actions/upload-artifact@v4
87
+ if: always()
88
+ with:
89
+ name: test-results-${{ matrix.python-version }}
90
+ path: |
91
+ pytest.xml
92
+ retention-days: 7
93
+
94
+ # Coverage job (only on main Python version)
95
+ coverage:
96
+ runs-on: ubuntu-latest
97
+ needs: [test-matrix]
98
+ if: always() && needs.test-matrix.result == 'success'
99
+ steps:
100
+ - uses: actions/checkout@v4
101
+ - name: Set up Python
102
+ uses: actions/setup-python@v5
103
+ with:
104
+ python-version: "3.11"
105
+
106
+ - name: Install dependencies
107
+ run: |
108
+ python -m pip install --upgrade pip
109
+ pip install ".[all]"
110
+ pip install pytest pytest-cov
111
+
112
+ - name: Run tests with coverage
113
+ run: |
114
+ pytest tests/ --cov=flowyml_notebook --cov-report=xml --cov-report=html --cov-report=term-missing -v
115
+ timeout-minutes: 20
116
+
117
+ - name: Upload coverage to Codecov
118
+ uses: codecov/codecov-action@v4
119
+ with:
120
+ file: ./coverage.xml
121
+ flags: unittests
122
+ name: codecov-umbrella
123
+ fail_ci_if_error: false
124
+ continue-on-error: true
125
+
126
+ - name: Upload coverage report
127
+ uses: actions/upload-artifact@v4
128
+ with:
129
+ name: coverage-report
130
+ path: htmlcov/
131
+ retention-days: 30
@@ -0,0 +1,59 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Virtual Environments
26
+ .venv/
27
+ venv/
28
+ ENV/
29
+ env/
30
+
31
+ # IDEs
32
+ .vscode/
33
+ .idea/
34
+ *.swp
35
+ *.swo
36
+ .DS_Store
37
+
38
+ # Frontend
39
+ node_modules/
40
+ /flowyml_notebook/frontend/npm-debug.log*
41
+
42
+ # Documentation
43
+ site/
44
+ .mkdocs/
45
+
46
+ # Environment
47
+ .env
48
+ .env.*
49
+ !.env.example
50
+
51
+ # Tests
52
+ .pytest_cache/
53
+ .coverage
54
+ htmlcov/
55
+ nosetests.xml
56
+ coverage.xml
57
+ *.cover
58
+ .tox/
59
+ .hypothesis/
@@ -0,0 +1,42 @@
1
+ default_language_version:
2
+ python: python3.12
3
+
4
+ default_stages: [pre-commit]
5
+ default_install_hook_types: [pre-commit, commit-msg]
6
+
7
+ repos:
8
+ - repo: https://github.com/astral-sh/ruff-pre-commit
9
+ rev: v0.1.11
10
+ hooks:
11
+ # Run the linter.
12
+ - id: ruff
13
+ args: [--fix]
14
+ # Run the formatter.
15
+ - id: ruff-format
16
+
17
+ - repo: https://github.com/pre-commit/pre-commit-hooks
18
+ rev: v4.1.0
19
+ hooks:
20
+ - id: check-yaml
21
+ args: ["--allow-multiple-documents", "--unsafe"]
22
+ - id: end-of-file-fixer
23
+ - id: trailing-whitespace
24
+ - id: check-docstring-first
25
+ - id: check-toml
26
+ - id: check-added-large-files
27
+ args: ["--maxkb=1024"]
28
+ - id: requirements-txt-fixer
29
+ - id: check-merge-conflict
30
+ - id: debug-statements
31
+ - id: pretty-format-json
32
+ args:
33
+ - "--autofix"
34
+ - "--indent=2"
35
+ - repo: local
36
+ hooks:
37
+ - id: validate-commit-msg
38
+ name: Commit Message is Valid
39
+ language: pygrep
40
+ entry: ^(break|build|ci|docs|feat|fix|perf|refactor|style|test|ops|hotfix|release|maint|init|enh|revert|reformat)(\([\w.,\-()/]+\))?(!)?\:\s.+$
41
+ stages: [commit-msg]
42
+ args: [--negate]