René's URL Explorer Experiment


Title: The API Reference documents too few modules · Issue #1854 · gitpython-developers/GitPython · GitHub

Open Graph Title: The API Reference documents too few modules · Issue #1854 · gitpython-developers/GitPython

X Title: The API Reference documents too few modules · Issue #1854 · gitpython-developers/GitPython

Description: The API Reference in the Sphinx documentation is missing some modules. But I am unsure exactly which ones should be added. There seem to be three cases. At least one omission should be corrected: The top-level git module is not listed, a...

Open Graph Description: The API Reference in the Sphinx documentation is missing some modules. But I am unsure exactly which ones should be added. There seem to be three cases. At least one omission should be corrected: T...

X Description: The API Reference in the Sphinx documentation is missing some modules. But I am unsure exactly which ones should be added. There seem to be three cases. At least one omission should be corrected: T...

Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1854

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The API Reference documents too few modules","articleBody":"The [API Reference](https://gitpython.readthedocs.io/en/latest/reference.html) in the Sphinx documentation is missing some modules. But I am unsure exactly which ones should be added. There seem to be three cases.\r\n\r\nAt least one omission should be corrected:\r\n\r\n1. The top-level `git` module is not listed, and while its `__version__` attribute is listed explicitly, `git.refresh` is not, so the `Git.refresh` method that should only be called directly in rare, unusual cases has its documentation included in the reference page, while the `git.refresh` function that is much more reasonable to call is omitted.\r\n\r\nBut for some of the other modules that aren't listed there, it seems intentional. These appear to divide into two more cases:\r\n\r\n2. Modules that are packages where everything interesting is defined in submodules.\r\n\r\n4. Modules where it may make sense to avoid creating the appearance that users of GitPython should ever directly use anything from them.\r\n\r\nThese are all the modules of GitPython that are not listed in `doc/source/reference.rst`, such that they do not have their public symbols automatically collected, and presented with docstrings, by Sphinx autodoc:\r\n\r\n```text\r\ngit\r\ngit.compat\r\ngit.db\r\ngit.index\r\ngit.objects\r\ngit.objects.submodule\r\ngit.refs\r\ngit.repo\r\ngit.types\r\n```\r\n\r\nCase 1, which should be included at least to get `git.refresh` and its docstring, is of course:\r\n\r\n```text\r\ngit\r\n```\r\n\r\nCase 2, where maybe they shouldn't be included because nothing of interest is directly contained in them, are:\r\n\r\n```text\r\ngit.index\r\ngit.objects\r\ngit.objects.submodule\r\ngit.refs\r\ngit.repo\r\n```\r\n\r\nCase 3, where maybe they shouldn't be included, or shouldn't be included without making clear in their module docstrings that they should not usually be used, are:\r\n\r\n```text\r\ngit.compat\r\ngit.db\r\ngit.types\r\n```\r\n\r\nRegarding this third case, symbols in these modules are referenced in docstrings or type annotations. More of these references are references from a technical Sphinx perspective than before, as of #1850, but it was always necessary to be able to understand what was in them, to understand what some names referred to and their significance.\r\n\r\nTherefore, for this third case, even if I am correct in my belief that they were omitted to discourage direct use, it seems to me that it may be best include them, with suitable guidance added in module docstrings (which autodoc will ensure is rendered at the top of the relevant section).\r\n\r\nI am unsure what should be done here, and unsure if all three of those modules of the third kind are really in the same situation. But even if they are and the approach I suggest is to be taken, I am unsure how strongly their use should be discouraged, and if a reason should be given (and if so, what reasons). This is what I know about them, that is related to this:\r\n\r\n- `git.compat` is to some extent a relic of when Python 2 was supported, and besides that it is mostly used within GitPython to deal with encoding, yet it may no longer be needed if/when GitPython's handling of strings and bytes is improved in the future, and it may not be useful for use in codebases that handle such things correctly from the start.\r\n- `git.db` is related to the gitdb library, and one of the symbols is includes in `__all__` is `GitDB`, whose use is today discouraged. The other symbol is `GitCmdObjectDB`. That might be seen today as a workaround for the way GitPython expects to receive an injected object database dependency with a `GitDB`-like interface. However, `GitCmdObjectDB` appears in various places and it's useful to understand it to understand the significance of it being the default. It seems to me that the `git.db` module should not only be included in documentation, but that no special effort should be made to discourage its use (though the `GitDB` could be clarified as not recommended).\r\n- `git.types` provides types used throughout GitPython, and the `assume_never` function. The types do not have docstrings. However, it may still be useful to list them so references in Sphinx documentation to them are rendered as links and so it is clear they really are part of GitPython rather than external. In addition, some of the types are `TypedDict`s, and I *think* autodoc will list the members. (If what ought to be done hinges on that, then I can to an experiment first to check; you can let me know.)\r\n\r\nMy sense is that `git.db` and `git.types` should be promoted to have the same status as most modules; while `git.compat` should either be similarly promoted, or a discouragement to use it added to its docstring, or both.\r\n\r\nThese are all part of GitPython's public interface: they are named as conventionally public names, and while the documentation currently omits pages for them, it nowhere characterizes them as private or states that they should not be used in code outside GitPython. So to avoid breaking backward compatibility, they should remain public.\r\n\r\nBut public use of them (use outside GitPython) could be *deprecated* if appropriate. As far as I can tell, that should either be done in `git.compat` only, or nowhere. If it is to be done for `git.compat`, then it could be accompanied by renaming it to `git._compat` and having uses in GitPython use that name, while `git.compat` would re-export its public names (and could also emit `DeprecationWarning`).","author":{"url":"https://github.com/EliahKagan","@type":"Person","name":"EliahKagan"},"datePublished":"2024-03-02T01:39:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1854/GitPython/issues/1854"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:76113dca-72cb-9e41-585b-41877b6d426f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC504:3A11D:79518:9DF64:696898DB
html-safe-nonce7237696c66be8cb08b654626b7e6340ac475000fbfed0828c14be4d57a8edb6a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTA0OjNBMTFEOjc5NTE4OjlERjY0OjY5Njg5OERCIiwidmlzaXRvcl9pZCI6IjM5NjAwNjczMTczNTIxNDMwNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf7a151a5c8d9820c633c6d5cd0df298ffa4e7d404bbc76019d4200a22ddb8301
hovercard-subject-tagissue:2164480215
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/1854/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b1e3f433009f929b4b4628fd295b0230f77486656a3297c244abf2f295f0614e/gitpython-developers/GitPython/issues/1854
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b1e3f433009f929b4b4628fd295b0230f77486656a3297c244abf2f295f0614e/gitpython-developers/GitPython/issues/1854
og:image:altThe API Reference in the Sphinx documentation is missing some modules. But I am unsure exactly which ones should be added. There seem to be three cases. At least one omission should be corrected: T...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameEliahKagan
hostnamegithub.com
expected-hostnamegithub.com
Nonefdc7c66bd36a6c12eb8e771e806db863266e573fc299e77f27505a768d4f8a98
turbo-cache-controlno-preview
go-importgithub.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git
octolytics-dimension-user_id503709
octolytics-dimension-user_logingitpython-developers
octolytics-dimension-repository_id1126087
octolytics-dimension-repository_nwogitpython-developers/GitPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1126087
octolytics-dimension-repository_network_root_nwogitpython-developers/GitPython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3223a6503d318917691422cdadfbe16cd8fb21e5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/issues/1854#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1854
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fissues%2F1854
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1854
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1854
Reloadhttps://github.com/gitpython-developers/GitPython/issues/1854
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1854
Notifications https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Fork 964 https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Star 5k https://github.com/login?return_to=%2Fgitpython-developers%2FGitPython
Code https://github.com/gitpython-developers/GitPython
Issues 169 https://github.com/gitpython-developers/GitPython/issues
Pull requests 8 https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/gitpython-developers/GitPython/security
Please reload this pagehttps://github.com/gitpython-developers/GitPython/issues/1854
Insights https://github.com/gitpython-developers/GitPython/pulse
Code https://github.com/gitpython-developers/GitPython
Issues https://github.com/gitpython-developers/GitPython/issues
Pull requests https://github.com/gitpython-developers/GitPython/pulls
Discussions https://github.com/gitpython-developers/GitPython/discussions
Actions https://github.com/gitpython-developers/GitPython/actions
Security https://github.com/gitpython-developers/GitPython/security
Insights https://github.com/gitpython-developers/GitPython/pulse
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1854
New issuehttps://github.com/login?return_to=https://github.com/gitpython-developers/GitPython/issues/1854
#1855https://github.com/gitpython-developers/GitPython/pull/1855
The API Reference documents too few moduleshttps://github.com/gitpython-developers/GitPython/issues/1854#top
#1855https://github.com/gitpython-developers/GitPython/pull/1855
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com/EliahKagan
https://github.com/EliahKagan
EliahKaganhttps://github.com/EliahKagan
on Mar 2, 2024https://github.com/gitpython-developers/GitPython/issues/1854#issue-2164480215
API Referencehttps://gitpython.readthedocs.io/en/latest/reference.html
#1850https://github.com/gitpython-developers/GitPython/pull/1850
acknowledgedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22acknowledged%22
help wantedhttps://github.com/gitpython-developers/GitPython/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.