-
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 1 commit
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
simplify
lib.rs
- Loading branch information
commit c3b191ecae5730438e67fed8b065f86f5a0d982e
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,19 @@ | ||
| pub type Result = std::result::Result<Option<&'static str>, ()>; | ||
| #[cfg(windows)] | ||
| include!("./win32.inc.rs"); | ||
|
|
||
| pub struct Database { | ||
| inner: phf::Map<&'static str, Option<&'static str>>, | ||
| } | ||
|
|
||
| impl Database { | ||
| pub fn shared() -> &'static Self { | ||
| static DATABASE: Database = { | ||
| #[cfg(windows)] | ||
| let data = include!("./win32.inc.rs"); | ||
|
|
||
| #[cfg(any(target_os = "linux", target_os = "android"))] | ||
| let data = include!("./linux.inc.rs"); | ||
| #[cfg(any(target_os = "linux", target_os = "android"))] | ||
| include!("./linux.inc.rs"); | ||
|
|
||
| #[cfg(any(target_os = "macos", target_os = "ios"))] | ||
| let data = include!("./darwin.inc.rs"); | ||
|
|
||
| Database { inner: data } | ||
| }; | ||
|
|
||
| &DATABASE | ||
| } | ||
|
|
||
| pub fn try_path(&self, path: &str) -> Result { | ||
| self.inner.get(path).copied().ok_or(()) | ||
| } | ||
|
|
||
| pub fn try_module_item(&self, module: &str, item: &str) -> Result { | ||
| self.try_path(&format!("{}.{}", module, item)) | ||
| } | ||
| } | ||
| #[cfg(any(target_os = "macos", target_os = "ios"))] | ||
| include!("./darwin.inc.rs"); | ||
|
|
||
| #[cfg(test)] | ||
| mod test { | ||
| use super::*; | ||
| use super::DB; | ||
|
|
||
| #[test] | ||
| fn test_module_item() { | ||
| let doc = Database::shared() | ||
| .try_module_item("array", "_array_reconstructor") | ||
| .unwrap(); | ||
| fn test_db() { | ||
| let doc = DB.get("array._array_reconstructor"); | ||
| assert!(doc.is_some()); | ||
| } | ||
| } | ||
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
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.
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.
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.
this is outdated. now everything is merged into a single file