-
-
Notifications
You must be signed in to change notification settings - Fork 169
Refactor to make sphinx a soft dependency #651
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
Draft
rossbar
wants to merge
14
commits into
numpy:main
Choose a base branch
from
rossbar:soft-sphinx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8a51c0a
DEP: Mv sphinx dep to optional.
rossbar fb070f9
MAINT: Make app setup optional in __init__.
rossbar 03c7593
Split history numpydoc/tests/test_docscrape.py to numpydoc/tests/test…
rossbar c9683e4
Split history numpydoc/tests/test_docscrape.py to numpydoc/tests/test…
rossbar e8a003d
Split history numpydoc/tests/test_docscrape.py to numpydoc/tests/test…
rossbar e61875f
Split history numpydoc/tests/test_docscrape.py to numpydoc/tests/test…
rossbar 3c4ffaf
TST: Split docscrape tests based on sphinx dep.
rossbar 4e38009
TST: Reuse test inputs in test_docscrape_sphinx.py.
rossbar cef7fd9
TST: Skip test_full if no sphinx installed.
rossbar f8f2310
MAINT: split _clean_text_signature out to _utils.
rossbar c3f1676
TST: Configure test collection per sphinx availability
rossbar da65208
DEP: Break numpydoc.cli dependence on sphinx.
rossbar 68cc1c0
Merge branch 'main' into soft-sphinx
rossbar 2d14fa0
Make linter happy.
rossbar 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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Configure test collection to skip doctests for modules that depend on sphinx | ||
| # when sphinx is not available in the environment. | ||
|
|
||
| try: | ||
| import sphinx | ||
|
|
||
| has_sphinx = True | ||
| except ImportError: | ||
| has_sphinx = False | ||
|
|
||
|
|
||
| collect_ignore = [] | ||
|
|
||
| if not has_sphinx: | ||
| collect_ignore += ["numpydoc/numpydoc.py", "numpydoc/docscrape_sphinx.py"] | ||
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,13 @@ | ||
| import re | ||
|
|
||
|
|
||
| def _clean_text_signature(sig): | ||
| if sig is None: | ||
| return None | ||
| start_pattern = re.compile(r"^[^(]*\(") | ||
| start, end = start_pattern.search(sig).span() | ||
| start_sig = sig[start:end] | ||
| sig = sig[end:-1] | ||
| sig = re.sub(r"^\$(self|module|type)(,\s|$)", "", sig, count=1) | ||
| sig = re.sub(r"(^|(?<=,\s))/,\s\*", "*", sig, count=1) | ||
| return start_sig + sig + ")" |
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
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.