-
-
Notifications
You must be signed in to change notification settings - Fork 910
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
Use upgraded pip in test fixture virtual environment #1864
Conversation
This is not yet a usable fix, because venv.create only supports upgrade_deps on Python 3.9 and higher.
Because the upgrade_deps parameter to venv.create, as well as related functionality such as the EnvBuilder.upgrade_dependencies method that it uses, are only available starting in Python 3.9. This also puts the name of the VirtualEnvironment.__init__ parameter for setting up pip in the test fixture virtual environment back from need_pip to with_pip, which may be more intuitive.
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.
Thanks so much for helping with this!
The line that indicates the culprit is something I once again missed. It looks like I really can't investigate test-failures anymore, while also admitting that I only scroll all the way down to see the one-line summary of the failure. Searching for the test-case should help, next time.
Supporting this many python versions and platforms isn't easy, and I am impressed by your ability to dig through all that anyway.
Until an improvement is made related to the xfail distraction issue discussed at #1853 (comment) and #1853 (comment), a technique I've found useful--in addition to searching for the test-case name as you mention--is to scan upward for when the percentages shown at the ends of most lines change color from yellow/gold to red. This always marks the the first test with "FAIL" status in the test run. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [GitPython](https://github.com/gitpython-developers/GitPython) | `==3.1.42` -> `==3.1.43` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/GitPython/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/GitPython/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/GitPython/3.1.42/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/GitPython/3.1.42/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>gitpython-developers/GitPython (GitPython)</summary> ### [`v3.1.43`](https://github.com/gitpython-developers/GitPython/releases/tag/3.1.43) [Compare Source](https://github.com/gitpython-developers/GitPython/compare/3.1.42...3.1.43) #### Particularly Important Changes These are likely to affect you, please do take a careful look. - Issue and test deprecation warnings by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1886](https://github.com/gitpython-developers/GitPython/pull/1886) - Fix version_info cache invalidation, typing, parsing, and serialization by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1838](https://github.com/gitpython-developers/GitPython/pull/1838) - Document manual refresh path treatment by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1839](https://github.com/gitpython-developers/GitPython/pull/1839) - Improve static typing and docstrings related to git object types by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1859](https://github.com/gitpython-developers/GitPython/pull/1859) #### Other Changes - Test in Docker with Alpine Linux on CI by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1826](https://github.com/gitpython-developers/GitPython/pull/1826) - Build online docs (RTD) with -W and dependencies by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1843](https://github.com/gitpython-developers/GitPython/pull/1843) - Suggest full-path refresh() in failure message by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1844](https://github.com/gitpython-developers/GitPython/pull/1844) - `repo.blame` and `repo.blame_incremental` now accept `None` as the `rev` parameter. by [@​Gaubbe](https://github.com/Gaubbe) in [https://github.com/gitpython-developers/GitPython/pull/1846](https://github.com/gitpython-developers/GitPython/pull/1846) - Make sure diff always uses the default diff driver when `create_patch=True` by [@​can-taslicukur](https://github.com/can-taslicukur) in [https://github.com/gitpython-developers/GitPython/pull/1832](https://github.com/gitpython-developers/GitPython/pull/1832) - Revise docstrings, comments, and a few messages by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1850](https://github.com/gitpython-developers/GitPython/pull/1850) - Expand what is included in the API Reference by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1855](https://github.com/gitpython-developers/GitPython/pull/1855) - Restore building of documentation downloads by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1856](https://github.com/gitpython-developers/GitPython/pull/1856) - Revise type annotations slightly by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1860](https://github.com/gitpython-developers/GitPython/pull/1860) - Updating regex pattern to handle unicode whitespaces. by [@​jcole-crowdstrike](https://github.com/jcole-crowdstrike) in [https://github.com/gitpython-developers/GitPython/pull/1853](https://github.com/gitpython-developers/GitPython/pull/1853) - Use upgraded pip in test fixture virtual environment by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1864](https://github.com/gitpython-developers/GitPython/pull/1864) - lint: replace `flake8` with `ruff` check by [@​Borda](https://github.com/Borda) in [https://github.com/gitpython-developers/GitPython/pull/1862](https://github.com/gitpython-developers/GitPython/pull/1862) - lint: switch Black with `ruff-format` by [@​Borda](https://github.com/Borda) in [https://github.com/gitpython-developers/GitPython/pull/1865](https://github.com/gitpython-developers/GitPython/pull/1865) - Update readme and tox.ini for recent tooling changes by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1868](https://github.com/gitpython-developers/GitPython/pull/1868) - Split tox lint env into three envs, all safe by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1870](https://github.com/gitpython-developers/GitPython/pull/1870) - Slightly broaden Ruff, and update and clarify tool configuration by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1871](https://github.com/gitpython-developers/GitPython/pull/1871) - Add a "doc" extra for documentation build dependencies by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1872](https://github.com/gitpython-developers/GitPython/pull/1872) - Describe `Submodule.__init__` parent_commit parameter by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1877](https://github.com/gitpython-developers/GitPython/pull/1877) - Include TagObject in git.types.Tree_ish by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1878](https://github.com/gitpython-developers/GitPython/pull/1878) - Improve Sphinx role usage, including linking Git manpages by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1879](https://github.com/gitpython-developers/GitPython/pull/1879) - Replace all wildcard imports with explicit imports by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1880](https://github.com/gitpython-developers/GitPython/pull/1880) - Clarify how tag objects are usually tree-ish and commit-ish by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1881](https://github.com/gitpython-developers/GitPython/pull/1881) #### New Contributors - [@​Gaubbe](https://github.com/Gaubbe) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1846](https://github.com/gitpython-developers/GitPython/pull/1846) - [@​can-taslicukur](https://github.com/can-taslicukur) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1832](https://github.com/gitpython-developers/GitPython/pull/1832) - [@​jcole-crowdstrike](https://github.com/jcole-crowdstrike) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1853](https://github.com/gitpython-developers/GitPython/pull/1853) - [@​Borda](https://github.com/Borda) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1862](https://github.com/gitpython-developers/GitPython/pull/1862) **Full Changelog**: gitpython-developers/GitPython@3.1.42...3.1.43 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [GitPython](https://github.com/gitpython-developers/GitPython) | `==3.1.42` -> `==3.1.43` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/GitPython/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/GitPython/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/GitPython/3.1.42/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/GitPython/3.1.42/3.1.43?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>gitpython-developers/GitPython (GitPython)</summary> ### [`v3.1.43`](https://github.com/gitpython-developers/GitPython/releases/tag/3.1.43) [Compare Source](https://github.com/gitpython-developers/GitPython/compare/3.1.42...3.1.43) #### Particularly Important Changes These are likely to affect you, please do take a careful look. - Issue and test deprecation warnings by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1886](https://github.com/gitpython-developers/GitPython/pull/1886) - Fix version_info cache invalidation, typing, parsing, and serialization by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1838](https://github.com/gitpython-developers/GitPython/pull/1838) - Document manual refresh path treatment by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1839](https://github.com/gitpython-developers/GitPython/pull/1839) - Improve static typing and docstrings related to git object types by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1859](https://github.com/gitpython-developers/GitPython/pull/1859) #### Other Changes - Test in Docker with Alpine Linux on CI by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1826](https://github.com/gitpython-developers/GitPython/pull/1826) - Build online docs (RTD) with -W and dependencies by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1843](https://github.com/gitpython-developers/GitPython/pull/1843) - Suggest full-path refresh() in failure message by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1844](https://github.com/gitpython-developers/GitPython/pull/1844) - `repo.blame` and `repo.blame_incremental` now accept `None` as the `rev` parameter. by [@​Gaubbe](https://github.com/Gaubbe) in [https://github.com/gitpython-developers/GitPython/pull/1846](https://github.com/gitpython-developers/GitPython/pull/1846) - Make sure diff always uses the default diff driver when `create_patch=True` by [@​can-taslicukur](https://github.com/can-taslicukur) in [https://github.com/gitpython-developers/GitPython/pull/1832](https://github.com/gitpython-developers/GitPython/pull/1832) - Revise docstrings, comments, and a few messages by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1850](https://github.com/gitpython-developers/GitPython/pull/1850) - Expand what is included in the API Reference by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1855](https://github.com/gitpython-developers/GitPython/pull/1855) - Restore building of documentation downloads by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1856](https://github.com/gitpython-developers/GitPython/pull/1856) - Revise type annotations slightly by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1860](https://github.com/gitpython-developers/GitPython/pull/1860) - Updating regex pattern to handle unicode whitespaces. by [@​jcole-crowdstrike](https://github.com/jcole-crowdstrike) in [https://github.com/gitpython-developers/GitPython/pull/1853](https://github.com/gitpython-developers/GitPython/pull/1853) - Use upgraded pip in test fixture virtual environment by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1864](https://github.com/gitpython-developers/GitPython/pull/1864) - lint: replace `flake8` with `ruff` check by [@​Borda](https://github.com/Borda) in [https://github.com/gitpython-developers/GitPython/pull/1862](https://github.com/gitpython-developers/GitPython/pull/1862) - lint: switch Black with `ruff-format` by [@​Borda](https://github.com/Borda) in [https://github.com/gitpython-developers/GitPython/pull/1865](https://github.com/gitpython-developers/GitPython/pull/1865) - Update readme and tox.ini for recent tooling changes by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1868](https://github.com/gitpython-developers/GitPython/pull/1868) - Split tox lint env into three envs, all safe by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1870](https://github.com/gitpython-developers/GitPython/pull/1870) - Slightly broaden Ruff, and update and clarify tool configuration by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1871](https://github.com/gitpython-developers/GitPython/pull/1871) - Add a "doc" extra for documentation build dependencies by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1872](https://github.com/gitpython-developers/GitPython/pull/1872) - Describe `Submodule.__init__` parent_commit parameter by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1877](https://github.com/gitpython-developers/GitPython/pull/1877) - Include TagObject in git.types.Tree_ish by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1878](https://github.com/gitpython-developers/GitPython/pull/1878) - Improve Sphinx role usage, including linking Git manpages by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1879](https://github.com/gitpython-developers/GitPython/pull/1879) - Replace all wildcard imports with explicit imports by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1880](https://github.com/gitpython-developers/GitPython/pull/1880) - Clarify how tag objects are usually tree-ish and commit-ish by [@​EliahKagan](https://github.com/EliahKagan) in [https://github.com/gitpython-developers/GitPython/pull/1881](https://github.com/gitpython-developers/GitPython/pull/1881) #### New Contributors - [@​Gaubbe](https://github.com/Gaubbe) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1846](https://github.com/gitpython-developers/GitPython/pull/1846) - [@​can-taslicukur](https://github.com/can-taslicukur) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1832](https://github.com/gitpython-developers/GitPython/pull/1832) - [@​jcole-crowdstrike](https://github.com/jcole-crowdstrike) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1853](https://github.com/gitpython-developers/GitPython/pull/1853) - [@​Borda](https://github.com/Borda) made their first contribution in [https://github.com/gitpython-developers/GitPython/pull/1862](https://github.com/gitpython-developers/GitPython/pull/1862) **Full Changelog**: gitpython-developers/GitPython@3.1.42...3.1.43 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/lettuce-financial/github-bot-signed-commit). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
A couple of GitPython's tests create their own virtual environments. One of those tests,
test_installation
, usespip
in it. But it does not upgradepip
in that virtual environment before using it, so an old version is often used. (The virtual environment is deliberately isolated, sopip
being current in the environment used to run the tests is not sufficient.)This creates a problem with
pip
on Cygwin.pip
vendorspytoml
to readpyproject.toml
files. But the version ofpytoml
vendored by some old versions ofpip
--including the one currently used in a virtual environment in whichpip
has not been upgraded--is apparently unable to parse some syntactically correct TOML, at least on some platforms. This was undetected because the contents ofpyproject.toml
on the main branch do not trigger the bug.This is the cause of the Cygwin test failure in #1862 (at a083e81). The failing test is
test_installation
; the detailed information on the failure begins here in the log. The key is these lines from the error message:Often, such warnings are unrelated to errors that precede them, but in this case the low version of
pip
really is the cause. Changing theVirtualEnvironment
test fixture to upgradepip
when it creates a virtual environment wherepip
is going to be used is sufficient to fix the problem.This pull request makes that change. It also upgrades
setuptools
when the Python version is lower than 3.12, which is recommended to do. From Python 3.9 on,venv.create
has anupgrade_deps
parameter that would make all of this very straightforward...except that using that would maketest_installation
incompatible with Python 3.7 and Python 3.8 (including on systems other than Cygwin). So I ended up doing it manually instead.This pull request has the main branch in the upstream GitPython repository as its base, but I have also tested these changes on top of #1862 (as it stands currently, with a083e81 at its tip) and verified that they fix the problem reported there and allow all CI checks to pass, including the Cygwin test workflow and the linting workflow with Ruff.
I'm not sure what the best way is to integrate the changes here and in #1862. This could be merged to main, and then #1862 could be updated. Or this could be merged, and #1862 merged without updating it, trusting that the checks would go green on the main branch. Or the changes here could be replayed there (e.g., by fast-forwarding it to my ruff-pip-toml branch), or that could be merged first with the failing check and then this could be merged, etc. (I have no objection if these changes are integrated in a way results in this pull request itself being closed without merging.)