René's URL Explorer Experiment


Title: Add a "doc" extra for documentation build dependencies by EliahKagan · Pull Request #1872 · gitpython-developers/GitPython · GitHub

Open Graph Title: Add a "doc" extra for documentation build dependencies by EliahKagan · Pull Request #1872 · gitpython-developers/GitPython

X Title: Add a "doc" extra for documentation build dependencies by EliahKagan · Pull Request #1872 · gitpython-developers/GitPython

Description: Much as GitPython has a test extra to aid development by installing testing and--currently--most linting dependencies, this adds a doc extra that installs Sphinx and its theme and plugins. The test extra is built by parsing test-requirements.txt, and similarly the new doc extra is built by parsing doc/requirements.txt. The previous approach of running pip install -r doc/requirements.txt continues to work. The following are updated to use the new extra: The Read the Docs configuration in .readthedocs.yaml. Documentation build testing step in pythonpackage.yml. Documentation building tox environment in tox.ini. Before doing this, I factored out shared logic in the way metadata files are read in setup.py, wrote that code in a more streamlined way, and removed what appear to be small unintentional complexities in how two unusual situations are handled: The entire content of VERSION, which should always be exactly one line, is now used (except leading and trailing whitespace) as the version. The requirements files and readme are, as the VERSION file already had been, now found relative to the setup.py file rather than the current directory, in the rare case that those two locations are different. You might decide you actually only want that setup.py cleanup, and not the new doc extra. I believe it makes sense to have a doc extra because it is a convenient way to install documentation, and because adding a new extra for that is readily feasible without even though the project definition is not declarative, because the information is available for static inspection in its requirements file, which already exist. (In contrast, I have not proposed a new lint extra at this time, though I think we should have that, because it would currently involve either adding another requirements file or making it harder to statically inspect the dependencies with automated tools.) However, to a large extent this comes down to personal preference, and there is a reason many projects use a requirements file for their documentation dependencies: it tends to be a reasonably okay way to pin them all exactly, including indirect (transitive) dependencies, for greater stability. Read the Docs advocates this. But GitPython is not doing this. Currently documentation builld dependencies deliberately support ranges to support building on different Python versions. That is compatible with pinning if a tool like poetry is used (when multiple sets of precisely pinned direct and transitive dependencies, for multiple versions and sometimes platforms, have to be maintained, one wants a tool that fully automates doing so). Also, I think there is no reason to think GitPython will pin documentation build dependencies in the future yet not pin other extra/optional dependencies such as those for testing and linting. I think there is some symmetry between these things, for GitPython (and for many other projects). Theory you don't have to read that also isn't correct in real life In principle: Applications use a requirements.txt file, or something conceptually similar like Pipfile.lock, that lists all their Python package dependencies fully pinned, including indirect dependencies (which, for Python packages, are the same thing as transitive dependencies), and typically express unpinned or less pinned direct dependencies separately in a requirements.in file, or something conceptually similar like Pipfile. Libraries define their dependencies in setup.py, setup.cfg, or pyproject.toml, sometimes in a way affected by the choice of build backend, sometimes with the aid of dependency management tools such as poetry and sometimes not. The idea is that applications need specific pinned dependency versions to guarantee stability, while in contrast libraries need to accommodate the varying versions of whatever applications use them, either indirectly or through other libraries. The problems are that the distinction between an application and a library is more permeable than it may seem at first, and that there are various benefits of defining an application like a library (for example, a requirements.txt file will not facilitate automatically installing executable scripts, and will not facilitate finding the code from a different location, even a subdirectory within its source tree), and also that when automated tests are run on a library, it is being used like an application and there can even be a benefit to precisely pinning the test runner and other test dependencies. However, if you prefer not to take the addition of the "doc" extra, but do want the other changes to setup.py, then I can drop the commit that actually does the "doc" extra and the PR can be retitled accordingly. I have locally tested the parts of this change that are not automatically exercised by GitHub Actions checks and Read the Docs pull request builds: python -m build to build GitPython itself. Editable and non-editable installations. git.__version__ when imported from a non-editable installation, both from a prebuilt wheel and with pip omitting -e. Ability to install locally with the doc extra on a Windows environment set up dissimilarly to how Windows is set up on GitHub Actions runners. Ability to run make -C doc html successfully when the only installation command run was pip install -e '.[doc]' (as it would be used locally). Here's the Read the Docs build status for this pull request (passing at 74df5a8).

Open Graph Description: Much as GitPython has a test extra to aid development by installing testing and--currently--most linting dependencies, this adds a doc extra that installs Sphinx and its theme and plugins. The test...

X Description: Much as GitPython has a test extra to aid development by installing testing and--currently--most linting dependencies, this adds a doc extra that installs Sphinx and its theme and plugins. The test...

Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1872

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:eb3f9f23-bdc3-d5b7-cef1-aef4d55a87a9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDA68:1EC1CC:1E5F8A:2B01F0:6968B08B
html-safe-nonce0b6d08cd47cf121501587b00dc07c28d25bd354f53e92c91ee9cd040cc93d86c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTY4OjFFQzFDQzoxRTVGOEE6MkIwMUYwOjY5NjhCMDhCIiwidmlzaXRvcl9pZCI6IjU3ODc1NTM5ODAyODcwNzAzNDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb1bbfa7ba093728e080e8136a157484f8ddd319028237db1b7d5ce46fa31d0cb
hovercard-subject-tagpull_request:1771103909
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/1872/files
twitter:imagehttps://avatars.githubusercontent.com/u/1771172?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1771172?s=400&v=4
og:image:altMuch as GitPython has a test extra to aid development by installing testing and--currently--most linting dependencies, this adds a doc extra that installs Sphinx and its theme and plugins. The test...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonefdc7c66bd36a6c12eb8e771e806db863266e573fc299e77f27505a768d4f8a98
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
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/pull/1872/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F1872%2Ffiles
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%2Fpull%2F1872%2Ffiles
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%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1872/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1872/files
Reloadhttps://github.com/gitpython-developers/GitPython/pull/1872/files
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1872/files
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/pull/1872/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgitpython-developers%2FGitPython%2Fissues%2Fnew%2Fchoose
Byronhttps://github.com/Byron
gitpython-developers:mainhttps://github.com/gitpython-developers/GitPython/tree/main
EliahKagan:doc-extrahttps://github.com/EliahKagan/GitPython/tree/doc-extra
Conversation 1 https://github.com/gitpython-developers/GitPython/pull/1872
Commits 3 https://github.com/gitpython-developers/GitPython/pull/1872/commits
Checks 0 https://github.com/gitpython-developers/GitPython/pull/1872/checks
Files changed https://github.com/gitpython-developers/GitPython/pull/1872/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1872/files
Add a "doc" extra for documentation build dependencies https://github.com/gitpython-developers/GitPython/pull/1872/files#top
Show all changes 3 commits https://github.com/gitpython-developers/GitPython/pull/1872/files
1b43166 Group setup.py imports EliahKagan Mar 13, 2024 https://github.com/gitpython-developers/GitPython/pull/1872/commits/1b43166951caac29ed223c9d1522534626b3598e
26dccd7 Streamline setup.py file reading EliahKagan Mar 13, 2024 https://github.com/gitpython-developers/GitPython/pull/1872/commits/26dccd70713b2be6cb0af6892fd05703f17cda3e
74df5a8 Add a "doc" extra for documentation build dependencies EliahKagan Mar 13, 2024 https://github.com/gitpython-developers/GitPython/pull/1872/commits/74df5a8995b6f4e9ed053e126dda1cb6cfc465f5
Clear filters https://github.com/gitpython-developers/GitPython/pull/1872/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1872/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/1872/files
pythonpackage.yml https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-ee68bef8369ed7bc5460a288e72d62152784762ef66851e07bf134c4075a08f0
.readthedocs.yaml https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-03efc769b870804394632e45d7885272b44c16939517fb31c9d7c614d2ffae57
setup.py https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
tox.ini https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449
.github/workflows/pythonpackage.ymlhttps://github.com/gitpython-developers/GitPython/pull/1872/files#diff-ee68bef8369ed7bc5460a288e72d62152784762ef66851e07bf134c4075a08f0
View file https://github.com/EliahKagan/GitPython/blob/74df5a8995b6f4e9ed053e126dda1cb6cfc465f5/.github/workflows/pythonpackage.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1872/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-ee68bef8369ed7bc5460a288e72d62152784762ef66851e07bf134c4075a08f0
.readthedocs.yamlhttps://github.com/gitpython-developers/GitPython/pull/1872/files#diff-03efc769b870804394632e45d7885272b44c16939517fb31c9d7c614d2ffae57
View file https://github.com/EliahKagan/GitPython/blob/74df5a8995b6f4e9ed053e126dda1cb6cfc465f5/.readthedocs.yaml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1872/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-03efc769b870804394632e45d7885272b44c16939517fb31c9d7c614d2ffae57
setup.pyhttps://github.com/gitpython-developers/GitPython/pull/1872/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
View file https://github.com/EliahKagan/GitPython/blob/74df5a8995b6f4e9ed053e126dda1cb6cfc465f5/setup.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1872/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7
tox.inihttps://github.com/gitpython-developers/GitPython/pull/1872/files#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449
View file https://github.com/EliahKagan/GitPython/blob/74df5a8995b6f4e9ed053e126dda1cb6cfc465f5/tox.ini
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/gitpython-developers/GitPython/pull/1872/{{ revealButtonHref }}
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449
https://github.com/gitpython-developers/GitPython/pull/1872/files#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449
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.