René's URL Explorer Experiment


Title: Fail `test_installation` on warnings, and remove deprecated license classifier by EliahKagan · Pull Request #2054 · gitpython-developers/GitPython · GitHub

Open Graph Title: Fail `test_installation` on warnings, and remove deprecated license classifier by EliahKagan · Pull Request #2054 · gitpython-developers/GitPython

X Title: Fail `test_installation` on warnings, and remove deprecated license classifier by EliahKagan · Pull Request #2054 · gitpython-developers/GitPython

Description: The license trove classifier was imprecise and deprecated The main way we indicate the license in the project's metadata is: GitPython/setup.py Line 72 in 46c439b license="BSD-3-Clause", However, we have for some time, until this PR, also had a trove classifier indicating "BSD License": GitPython/setup.py Line 98 in 46c439b "License :: OSI Approved :: BSD License", This has a couple of problems. One is that there is no specific "BSD License", but instead various BSD licenses, of which two are very popular: BSD-3-Clause, which this project uses, and BSD-2-Clause, which is not what this project uses. (No PyPI-recognized trove classifiers for those specific BSD licenses exist.) The other problem is that all usage of License :: ... trove classifiers has been deprecated. When the package is installed, the build backend generates a warning. The warning is typically not shown when using pip, but it will be shown if -v is passed, and it will be shown and cause an error if PYTHONWARNINGS=error is set in the environment. (Running python -Werror -m pip … is not sufficient to produce it, because it is not passed down to the subprocess running setuptools, which is where the warning occurs.) SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: BSD License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! The "BSD-3-Clause" value of the license argument we pass to setuptools.setup is already such an SDPX license expression. So all that is needed to fix both these problems is to remove the deprecated trove classifier. However, there are other related problems, some of which make sense to fix at the same time. The installation test didn't detect warnings, nor report errors clearly test_installation seeks to detect problems installing GitPython, and with #2053 it is back running and passing on all platforms we test. But it has not treated warnings during installation as errors. Especially considering the small number of dependencies GitPython has (when not installing the test or doc extra), we shouldn't ordinarily have any warnings on any supported platform and Python version, and anytime we do, we probably want to know about it. I think it would not be reasonable to set PYTHONWARNINGS=error in the top-level pip install '.[test]' commands in the CI test workflows, but that this is a good thing to do in test_installation. Setting it in test_installation does reveal that an error occurs, but without making other changes to the test, it does not reveal in a readily understandable way what error occurs. test_installation contains this code (and some other code like it): GitPython/test/test_installation.py Lines 16 to 25 in 46c439b result = subprocess.run( [venv.pip, "install", "."], stdout=subprocess.PIPE, cwd=venv.sources, ) self.assertEqual( 0, result.returncode, msg=result.stderr or result.stdout or "Can't install project", ) The intent of result.stderr or result.stdout or "Can't install project" is to show what, if anything, was written to stderr; otherwise show what, if anything, was written to stdout; and otherwise show the prewritten message. It's true that the most important information to understand an error is often on stderr. The problem is that it will never show what was written to stderr, because the call to subprocess.run captures only stdout, then attempts to access stderr as though it had been captured too. Here's a simplified demonstration of that problem: >>> from subprocess import run, PIPE >>> result = run(["sh", "-c", "echo 'this is stdout'; echo 'this is stderr' >&2"], stdout=PIPE) this is stderr >>> result.stdout b'this is stdout\n' >>> result.stderr >>> Depending on how the test runner (usually pytest, which is the only runner the whole test suite supports) is run, the stderr message may be captured by the test runner and not shown, captured by the test runner and shown later where it may not be readily identified, or not captured by the test runner and possibly seen at some point either at the intuitive position or interleaved elsewhere. The fixes This PR: Refactors test_installation and its helpers to decrease code duplication and to clarify what the steps that set up the new virtual environment are doing, fixes the test bug where stderr was not captured, interacts with the python and pip subprocesses assuming text-based streams and includes in the assertion message the prewritten summary as well as stdout and stderr (labeling each), and runs the subprocesses with PYTHONWARNINGS=error. This surfaces the deprecation warning and causes it to fail test_installation with fully detailed output reporting the problem. Removes the deprecated trove classifier from setup.py. This is sufficient to make the test pass, as there are no other diagnostic messages of warning or higher level. Outscoped Improve license metadata by Hugo van Kemenade, though not at all specific to GitPython, covers both the problem with some license classifiers (including "BSD License") being unclear and the deprecation, pointing out that an SPDX string should be used to identify in metadata what license a project has chosen. However, it recommends that one also specify the paths to one's license files using license-files. This is already something we were not doing, and removing the deprecated classifier does not worsen that situation. Our LICENSE file also does not have customized elements besides a listed author, who is also one of the authors listed in metadata about authorship. Most importantly, this is just about metadata: the LICENSE file is part of the project and listed in MANIFEST.in (and various files in the project also carry notices). Nonetheless, it would be good to do something like this. I don't know if we can straightforwardly achieve the effect of license-files in setup.py. That blog post covers static project definitions in pyproject.toml. In addition, that meaning in pyproject.toml of license and license-files is only recognized in sufficiently new versions of build backends. Usually this isn't a problem, but some of these changes to the way licenses are expected to be indicated are actually fairly recent. GitPython supports some old versions of Python that are older than supported by the oldest version of setuptools that recognizes pyproject.toml with a license value that is an SPDX string (even aside from supporting license-files). The packaging guide shows the current status for this (PEP 639). One implication here is that it looks like we will have to choose between: Not using pyproject.toml to specify license as an SPDX identifier (and I think maybe not switching to pyproject.toml at all, and maybe not being able to specify license-files or equivalent at all). Dropping Python 3.7 and 3.8 support. This is not unreasonable and will definitely happen eventually--they are end-of-life, after all--but I'd rather the reason we stop supporting them relate either to something that matters at runtime, broader maintainability considerations, or major benefits of unconditionally using newer features. GitPython has a lot of users, and while hopefully just about everyone is using a supported Python, I'd be interested in moving slowly on dropping old versions, at least as far as 3.8 is concerned. Using pyproject.toml with an old, less useful license value, which will generate deprecation warnings, and which will eventually--sometime in 2026, I believe--stop the project from being able to be installed and/or published properly. (This deprecation is a more serious deprecation than the one fixed here with classifiers.) Switching from the setuptools build backend to another build backend that continues to support older Python versions and also supports modern license and license-files, such as flit-core or (if we drop 3.7 by then) hatchling. Although the original plan was to stick with setuptools per #1716 (comment), some time has passed since then and I suspect there may end up being other reasons to switch build backends. I think it may be best to decide all this at the same time, and when actually making the project definition declarative. Therefore, I have not attempted to add license-files or equivalent metadata in this PR.

Open Graph Description: The license trove classifier was imprecise and deprecated The main way we indicate the license in the project's metadata is: GitPython/setup.py Line 72 i...

X Description: The license trove classifier was imprecise and deprecated The main way we indicate the license in the project's metadata is: GitPython/setup.py Line 72 ...

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

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/checks(.:format)
route-controllerpull_requests
route-actionchecks
fetch-noncev2:1d9161ad-0b8f-8872-5e6b-de509c3a33e0
current-catalog-service-hash87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a
request-idBA36:22275E:2140C51:2E42435:69693BEF
html-safe-nonce9ca4c9e5a56e129ea0e4d336a5b757c98bcf90f218caf37a7e8d08fa9af4af47
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTM2OjIyMjc1RToyMTQwQzUxOjJFNDI0MzU6Njk2OTNCRUYiLCJ2aXNpdG9yX2lkIjoiMTIzMjIxNzg4NTUzODU5Nzg3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc978170c2d5e6d2170869af91f002fa079129e40083cedcb856d27bc455fc11b
hovercard-subject-tagpull_request:2594447628
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/checks
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2054/checks
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:altThe license trove classifier was imprecise and deprecated The main way we indicate the license in the project's metadata is: GitPython/setup.py Line 72 i...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d
turbo-cache-controlno-cache
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 full-width-p-0
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released69ac0477df0f87da03b8b06cebd187012d7a930
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/gitpython-developers/GitPython/pull/2054/checks#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2054%2Fchecks
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%2F2054%2Fchecks
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%2Fchecks&source=header-repo&source_repo=gitpython-developers%2FGitPython
Reloadhttps://github.com/gitpython-developers/GitPython/pull/2054/checks
Reloadhttps://github.com/gitpython-developers/GitPython/pull/2054/checks
Reloadhttps://github.com/gitpython-developers/GitPython/pull/2054/checks
gitpython-developers https://github.com/gitpython-developers
GitPythonhttps://github.com/gitpython-developers/GitPython
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/2054/checks
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/2054/checks
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
EliahKaganhttps://github.com/EliahKagan
gitpython-developers:mainhttps://github.com/gitpython-developers/GitPython/tree/main
EliahKagan:deprecated-classifierhttps://github.com/EliahKagan/GitPython/tree/deprecated-classifier
Conversation 1 https://github.com/gitpython-developers/GitPython/pull/2054
Commits 7 https://github.com/gitpython-developers/GitPython/pull/2054/commits
Checks 27 https://github.com/gitpython-developers/GitPython/pull/2054/checks
Files changed 2 https://github.com/gitpython-developers/GitPython/pull/2054/files
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/2054/checks
Sign in for the full log viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgitpython-developers%2FGitPython%2Fpull%2F2054%2Fchecks
Fail test_installation on warnings, and remove deprecated license classifier https://github.com/gitpython-developers/GitPython/pull/2054/checks#top
Please reload this pagehttps://github.com/gitpython-developers/GitPython/pull/2054/checks
test-alpine on: pull_request https://github.com/gitpython-developers/GitPython/actions/runs/15672344475
test https://github.com/gitpython-developers/GitPython/actions/runs/15672344475/job/44145572794?pr=2054
CodeQL on: pull_request https://github.com/gitpython-developers/GitPython/actions/runs/15672344483
Analyze (actions) https://github.com/gitpython-developers/GitPython/actions/runs/15672344483/job/44145572834?pr=2054
Analyze (python) https://github.com/gitpython-developers/GitPython/actions/runs/15672344483/job/44145572832?pr=2054
test-cygwin on: pull_request https://github.com/gitpython-developers/GitPython/actions/runs/15672344490
test (fast) https://github.com/gitpython-developers/GitPython/actions/runs/15672344490/job/44145572833?pr=2054
test (perf) https://github.com/gitpython-developers/GitPython/actions/runs/15672344490/job/44145572825?pr=2054
Python package on: pull_request https://github.com/gitpython-developers/GitPython/actions/runs/15672344494
test (ubuntu, 3.7) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572882?pr=2054
test (ubuntu, 3.8) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572900?pr=2054
test (ubuntu, 3.9) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572885?pr=2054
test (ubuntu, 3.10) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572881?pr=2054
test (ubuntu, 3.11) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572887?pr=2054
test (ubuntu, 3.12) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572893?pr=2054
test (ubuntu, 3.13) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572897?pr=2054
test (ubuntu, 3.13t) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572889?pr=2054
test (macos, 3.8) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572891?pr=2054
test (macos, 3.9) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572896?pr=2054
test (macos, 3.10) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572907?pr=2054
test (macos, 3.11) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572917?pr=2054
test (macos, 3.12) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572906?pr=2054
test (macos, 3.13) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572923?pr=2054
test (windows, 3.7) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572908?pr=2054
test (windows, 3.8) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572905?pr=2054
test (windows, 3.9) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572922?pr=2054
test (windows, 3.10) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572921?pr=2054
test (windows, 3.11) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572932?pr=2054
test (windows, 3.12) https://github.com/gitpython-developers/GitPython/actions/runs/15672344494/job/44145572915?pr=2054
Lint on: pull_request https://github.com/gitpython-developers/GitPython/actions/runs/15672344497
lint https://github.com/gitpython-developers/GitPython/actions/runs/15672344497/job/44145572857?pr=2054
CodeQL https://github.com/gitpython-developers/GitPython/pull/2054/checks?check_run_id=44145848858
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.