-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
891e190
Add `__doc__` crate
ShaharNaveh e74c26f
Base auto-generate ci
ShaharNaveh d6e00ba
Add dummy files
ShaharNaveh b309e90
Update docs
ShaharNaveh d35a6bd
Set codegen-units to 1 for doc db
ShaharNaveh 232fe6d
Mark `*.inc.rs` as auto generated
ShaharNaveh 231318a
Disable doctest
ShaharNaveh aaa2006
Reset docs
ShaharNaveh c2b2249
Simplify `generate.py`
ShaharNaveh 2db1227
No need for optimizatins in dev
ShaharNaveh c3b191e
simplify `lib.rs`
ShaharNaveh 34d4f32
Regenerate docs
ShaharNaveh 83ab568
ignore cspell
ShaharNaveh efd4de9
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh 6140114
Configurable python-version
ShaharNaveh 7a432ec
Fix logic error
ShaharNaveh a590b8d
Output as json
ShaharNaveh 315ef1d
GHA now uploads `data.inc.rs`
ShaharNaveh 100a803
Generate `data.inc.rs`
ShaharNaveh 833c786
Add info comments
ShaharNaveh 25cf146
Fix typo of missing type
ShaharNaveh 83c03a5
Fix typo
ShaharNaveh 4e21b6f
Assert raw_doc is not None
ShaharNaveh 174cb87
Check if attr is callable
ShaharNaveh 1542895
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh 4544be3
Rename to `rustpython-doc`
ShaharNaveh e089740
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh 15546ab
Rename to `crates/doc`
ShaharNaveh 4bee896
Merge remote-tracking branch 'upstream/main' into move-doc
ShaharNaveh 9e5ed29
Increase unix CI timeout to 35 minutes (was 30)
ShaharNaveh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: Update doc DB | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| python-version: | ||
| description: Target python version to generate doc db for | ||
| type: string | ||
| default: "3.13.9" | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
| working-directory: ./crates/rustpython-doc | ||
|
|
||
| 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 | ||
|
|
||
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | ||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
|
|
||
| - name: Generate docs | ||
| run: python ./generate.py | ||
|
|
||
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | ||
| with: | ||
| name: doc-db-${{ inputs.python-version }}-${{ matrix.os }} | ||
| path: "crates/rustpython-doc/generated/*.json" | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
| overwrite: true | ||
|
|
||
| merge: | ||
| runs-on: ubuntu-latest | ||
| needs: generate | ||
| steps: | ||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| sparse-checkout: | | ||
| crates/rustpython-doc | ||
|
|
||
| - name: Download generated doc DBs | ||
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | ||
| with: | ||
| pattern: "doc-db-${{ inputs.python-version }}-**" | ||
| path: crates/rustpython-doc/generated/ | ||
| merge-multiple: true | ||
|
|
||
| - name: Transform JSON | ||
| run: | | ||
| # Merge all artifacts | ||
| jq -s "add" --sort-keys generated/*.json > generated/merged.json | ||
|
|
||
| # Format merged json for the phf macro | ||
| jq -r 'to_entries[] | " \(.key | @json) => \(.value | @json),"' generated/merged.json > generated/raw_entries.txt | ||
|
|
||
| OUTPUT_FILE='src/data.inc.rs' | ||
|
|
||
| echo -n '' > $OUTPUT_FILE | ||
|
|
||
| echo '// This file was auto-generated by `.github/workflows/update-doc-db.yml`.' >> $OUTPUT_FILE | ||
| echo "// CPython version: ${{ inputs.python-version }}" >> $OUTPUT_FILE | ||
| echo '// spell-checker: disable' >> $OUTPUT_FILE | ||
|
|
||
| echo '' >> $OUTPUT_FILE | ||
|
|
||
| echo "pub static DB: phf::Map<&'static str, &'static str> = phf::phf_map! {" >> $OUTPUT_FILE | ||
| cat generated/raw_entries.txt >> $OUTPUT_FILE | ||
| echo '};' >> $OUTPUT_FILE | ||
|
|
||
| - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | ||
| with: | ||
| name: doc-db-${{ inputs.python-version }} | ||
| path: "crates/rustpython-doc/src/data.inc.rs" | ||
| if-no-files-found: error | ||
| retention-days: 7 | ||
| overwrite: true | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| generated/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [package] | ||
| name = "rustpython-doc" | ||
| version.workspace = true | ||
| authors.workspace = true | ||
| edition.workspace = true | ||
| rust-version.workspace = true | ||
| repository.workspace = true | ||
| license-file = "LICENSE" | ||
|
|
||
| [dependencies] | ||
| phf = { workspace = true } | ||
|
|
||
| [lib] | ||
| doctest = false # Crashes when true | ||
|
|
||
| [lints] | ||
| workspace = true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.