-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Move __doc__ crate to crates/doc
#6234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
891e190
e74c26f
d6e00ba
b309e90
d35a6bd
232fe6d
231318a
aaa2006
c2b2249
2db1227
c3b191e
34d4f32
83ab568
efd4de9
6140114
7a432ec
a590b8d
315ef1d
100a803
833c786
25cf146
83c03a5
4e21b6f
174cb87
1542895
4544be3
e089740
15546ab
4bee896
9e5ed29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: Update doc DB | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| open_pr: | ||
| description: Whether or not to open a PR with any possible changes | ||
| type: boolean | ||
| default: false | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| env: | ||
| PYTHON_VERSION: "3.13.9" | ||
|
|
||
| jobs: | ||
| generate: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| - windows-latest | ||
| - macos-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| sparse-checkout: | | ||
| crates/rustpython_doc_db | ||
|
|
||
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
|
|
||
| - name: Generate (${{ matrix.os }}) | ||
| run: python crates/rustpython_doc_db/generate.py | ||
|
|
||
| - name: Detect output file | ||
| id: diff | ||
| run: echo "diff=$(git diff --name-only)" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | ||
| with: | ||
| name: doc-db-${{ env.PYTHON_VERSION }}-${{ matrix.os }} | ||
| path: ${{ steps.diff.outputs.diff }} | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| overwrite: true | ||
| pr: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ain't sure if we want to open a PR, or just push the generated artifacts
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to update it only when target Python version is changed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, so probably not worth the effort in automating a PR |
||
| if: false && ${{ inputs.open_pr }} | ||
| needs: generate | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| sparse-checkout: | | ||
| crates/rustpython_doc_db | ||
|
|
||
| - name: Download generated doc DBs | ||
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | ||
| with: | ||
| pattern: "doc-db-${{ env.PYTHON_VERSION }}-**" | ||
| merge-multiple: true | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Major: Workflow fails if generate script produces no changes.
The workflow detects output via
git diff --name-only(line 43) and uploads artifacts withif-no-files-found: error(line 49). If the generated output is already up-to-date (no changes), the job fails, which contradicts the use case where this workflow may be idempotent.Additionally, line 39 runs the generate script with no explicit error handling—if it fails, the workflow continues to the artifact upload step.
Consider:
if-no-files-found: warninstead oferrorto allow the workflow to complete gracefully when no changes are detected.set -eor explicit checks after the generate step.Apply this diff:
- name: Generate (${{ matrix.os }}) run: python crates/rustpython_doc_db/generate.py - name: Detect output file id: diff run: echo "diff=$(git diff --name-only)" >> $GITHUB_OUTPUT - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: doc-db-${{ env.PYTHON_VERSION }}-${{ matrix.os }} path: ${{ steps.diff.outputs.diff }} - if-no-files-found: error + if-no-files-found: warnBased on learnings, the maintainers prefer simplicity and accept workflows that may fail gracefully in edge cases; however, the intent here is unclear.
🤖 Prompt for AI Agents