For Python >= 3.11 directly use packaging to compare package versions#1416
Merged
j-bennet merged 2 commits intodbcli:mainfrom Sep 12, 2023
Merged
For Python >= 3.11 directly use packaging to compare package versions#1416j-bennet merged 2 commits intodbcli:mainfrom
j-bennet merged 2 commits intodbcli:mainfrom
Conversation
Contributor
|
Hi @blag , thank you for improving pgcli! I see some errors in CI, would you be able to address those? Let me know if you need any help. |
Member
|
This is only used to detect the version of vi_modes = {
InputMode.INSERT: "I",
InputMode.NAVIGATION: "N",
InputMode.REPLACE: "R",
InputMode.INSERT_MULTIPLE: "M",
}
if parse_version(prompt_toolkit.__version__) >= parse_version("3.0.6"):
vi_modes[InputMode.REPLACE_SINGLE] = "R"We could surely check the existence of vi_modes = {...}
if "REPLACE_SINGLE" in {e.name for e in InputMode}: # available in prompt_toolkit >= 3.0.6
vi_modes[InputMode.REPLACE_SINGLE] = "R"(or use a try/except clause, or |
Contributor
Author
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1416 +/- ##
==========================================
- Coverage 84.15% 79.50% -4.66%
==========================================
Files 21 25 +4
Lines 2720 2981 +261
==========================================
+ Hits 2289 2370 +81
- Misses 431 611 +180
☔ View full report in Codecov by Sentry. |
Contributor
|
Looks good @blag , merging. 👍 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
On Python 3.11 and beyond,
pkg_resourcesno longer bundlespackaging:That causes this issue in
pgcli:So for Python 3.11+, we install the
packaging...package, and use it directly:Checklist
changelog.rst.AUTHORSfile (or it's already there).pip install pre-commit && pre-commit install), and ranblackon my code.