-
Notifications
You must be signed in to change notification settings - Fork 56
Add support for loading intersphinx inventory from file #882
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
Open
idclifford
wants to merge
7
commits into
twisted:master
Choose a base branch
from
idclifford:881-intersphinx-local-url
base: master
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.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
633d8bd
Add support for file:// URLs for intersphinx
e74792e
Merge branch 'twisted:master' into 881-intersphinx-local-url
idclifford c6205ff
--intersphinx-file option added
1fa9238
Tests for --intersphinx-file
c3f5b59
New test for --intersphinx-file
2ff4251
Documentation for --intersphinx-file
e8dee1b
Revert modified test
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 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 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 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 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 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 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.
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.
Interesting... so if I understand correctly, your generating links that do not include a http scheme but are paths to files directly. Can you tell me more about your usage of this feature ? are you serving all pydoctor generated pages for many projects under the same folder, so these links are all relative in practice ?
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.
I have just pushed the test you requested. It needed some adjustment to work, but I hope it's now okay. i have also updated sphinx-integration.rst as you requested.
I am using pydoctor for local projects that are not hosted online, mostly because the source code includes confidential data and we don't want to upload the source code to github, etc.
These updates to pydoctor were implemented and tested for one project so far. Here, the links are absolute and point to a location on a shared file system. I don't see any reason why they couldn't be relative, though.
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.
Ok I understand your usage.
Another use case for loading a inventory files from disk is when the API documentation are actually served somewhere (but behind a login page of some sort or in a inaccessible network segment), in that situation pydoctor won't be able to retrieve the inventory file itself from the URL. To accommodate this kind of usage, the
--intersphinx-file
option could have the following formatPATH[:BASE_URL]
where the base url is optional, but when used the links generated will be actually HTTP links.Tell me what you think,
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.
I'm not sure I fully understand how this would work in practice. Are you saying that the code documentation is accessible but the inventory file is not. The user would have to manually download the inventory file to the local file system and use this to build the links. The resulting http links would then point to the html pages that are not behind a security page.
If I understand correctly, this is doable.
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.
Let’s say the documentation is behind a basic authenticated website. Pydoctor doesn’t support authentication to retrieve intersphinx inventory at the moment. So the solution would be to download objects.inv files with
curl -u user:password https://someprotectedsite/project1/api/objects.inv > project.inv
before calling pydoctor with option—intersphinx-file=./project.inv:https://someprotectedsite/project1/api
.Tell me what you think
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.
Hi @idclifford, are you interested in implementing this feature?
If you do not wish to invest more time that this, I understand.
Many thanks