Conversation
The inspiration for this change was the following warning from `poetry`:
Warning: The locked version 0.1.3 for types-pkg-resources is a yanked
version. Reason for being yanked: Use types-setuptools instead
Following that, adding `types-setuptools` allowed the removal of some
`type: ignore` comments, which then lead to a single issue needing to be
fixed:
tests/unit/test_setuptools_command.py:8: error: Argument 1 to "ISortCommand" has incompatible type "distutils.dist.Distribution"; expected "setuptools.dist.Distribution" [arg-type]
Co-authored-by: Matthew Hughes <matthewhughes934@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2327 +/- ##
==========================================
- Coverage 99.12% 99.12% -0.01%
==========================================
Files 39 39
Lines 3096 3094 -2
Branches 787 787
==========================================
- Hits 3069 3067 -2
Misses 15 15
Partials 12 12 |
|
Looks good! Here's a couple more updates we can make: diff --git a/isort/settings.py b/isort/settings.py
index 7f66dc47..f8bab979 100644
--- a/isort/settings.py
+++ b/isort/settings.py
@@ -252,11 +252,7 @@ class _Config:
def __post_init__(self) -> None:
py_version = self.py_version
if py_version == "auto": # pragma: no cover
- if sys.version_info.major == 2 and sys.version_info.minor <= 6:
- py_version = "2"
- elif sys.version_info.major == 3 and (
- sys.version_info.minor <= 5 or sys.version_info.minor >= 12
- ):
+ if sys.version_info.major == 3 and sys.version_info.minor >= 12:
py_version = "3"
else:
py_version = f"{sys.version_info.major}{sys.version_info.minor}"
diff --git a/scripts/lint.sh b/scripts/lint.sh
index 3d938a9a..e9118ff0 100755
--- a/scripts/lint.sh
+++ b/scripts/lint.sh
@@ -3,7 +3,7 @@ set -euxo pipefail
poetry run cruft check
poetry run mypy -p isort -p tests
-poetry run black --target-version py38 --check .
+poetry run black --target-version py39 --check .
poetry run isort --profile hug --check --diff isort/ tests/
poetry run isort --profile hug --check --diff example_*/
poetry run flake8 isort/ tests/Perhaps Plus we could also run pyupgrade: pip install pyupgrade
pyupgrade **/**.py --py39-plusAnd this will upgrade a lot of typing things, like using |
I did, and I think we can just use
I'd prefer to keep that out of scope for now. Running |
This MR contains the following updates: | Package | Type | Update | Change | OpenSSF | |---|---|---|---|---| | [isort](https://github.com/PyCQA/isort) ([changelog](https://github.com/PyCQA/isort/releases)) | dev | major | `^5.13.2` → `^7.0.0` | [](https://securityscorecards.dev/viewer/?uri=github.com/PyCQA/isort) | --- ### Release Notes <details> <summary>PyCQA/isort (isort)</summary> ### [`v7.0.0`](https://github.com/PyCQA/isort/releases/tag/7.0.0) [Compare Source](PyCQA/isort@6.1.0...7.0.0) #### Changes #### 💥 Breaking Changes - Drop support for Python 3.9 ([#​2430](PyCQA/isort#2430)) [@​DanielNoord](https://github.com/DanielNoord) #### 🚀 Features - Show absolute paths in skipped file messages ([#​2416](PyCQA/isort#2416)) [@​pranlawate](https://github.com/pranlawate) #### 🪲 Fixes - Some fixes for Python 3.14 ([#​2433](PyCQA/isort#2433)) [@​DanielNoord](https://github.com/DanielNoord) - Test on `3.14` and fix any bugs ([#​2425](PyCQA/isort#2425)) [@​DanielNoord](https://github.com/DanielNoord) - Update CHANGELOG.md + Fix Formatting and Grammar ([#​2419](PyCQA/isort#2419)) [@​lukbrew25](https://github.com/lukbrew25) - Fix output of hanging indent for long lines with noqa ([#​2407](PyCQA/isort#2407)) [@​matan1008](https://github.com/matan1008) #### :construction\_worker: Continuous Integration - Format with `ruff` instead of `black` ([#​2432](PyCQA/isort#2432)) [@​DanielNoord](https://github.com/DanielNoord) - Target 3.10 for `ruff` ([#​2431](PyCQA/isort#2431)) [@​DanielNoord](https://github.com/DanielNoord) - Update development dependencies to latest version ([#​2426](PyCQA/isort#2426)) [@​DanielNoord](https://github.com/DanielNoord) - docs: update pre-commit examples to version 6.1.0 ([#​2413](PyCQA/isort#2413)) [@​pranlawate](https://github.com/pranlawate) - Small cleanup for developer environment ([#​2418](PyCQA/isort#2418)) [@​DanielNoord](https://github.com/DanielNoord) #### 📦 Dependencies - Bump actions/setup-python from 5 to 6 in the github-actions group ([#​2411](PyCQA/isort#2411)) @​[dependabot\[bot\]](https://github.com/apps/dependabot) ### [`v6.1.0`](https://github.com/PyCQA/isort/blob/HEAD/CHANGELOG.md#610-October-1-2025) [Compare Source](PyCQA/isort@6.0.1...6.1.0) - Add python 3.14 classifier and badge ([#​2409](PyCQA/isort#2409)) [@​staticdev](https://github.com/staticdev) - Drop use of non-standard pkg\_resources API ([#​2405](PyCQA/isort#2405)) [@​dvarrazzo](https://github.com/dvarrazzo) ### [`v6.0.1`](https://github.com/PyCQA/isort/blob/HEAD/CHANGELOG.md#601-Febuary-26-2025) [Compare Source](PyCQA/isort@6.0.0...6.0.1) - Add OSError handling in find\_imports\_in\_file ([#​2331](PyCQA/isort#2331)) [@​kobarity](https://github.com/kobarity) ### [`v6.0.0`](https://github.com/PyCQA/isort/blob/HEAD/CHANGELOG.md#600-January-27-2025) [Compare Source](PyCQA/isort@5.13.2...6.0.0) - Remove support for Python 3.8 ([#​2327](PyCQA/isort#2327)) [@​DanielNoord](https://github.com/DanielNoord) - Python 3.13 support ([#​2306](PyCQA/isort#2306)) [@​mayty](https://github.com/mayty) - Speed up exists\_case\_sensitive calls ([#​2264](PyCQA/isort#2264)) [@​correctmost](https://github.com/correctmost) - Ensure that split\_on\_trailing\_comma works with as imports ([#​2340](PyCQA/isort#2340)) [@​DanielNoord](https://github.com/DanielNoord) - Black profile: enable magic comma ([#​2236](PyCQA/isort#2236)) [@​MrMino](https://github.com/MrMino) - Update line\_length and single\_line\_exclusions in google profile ([#​2149](PyCQA/isort#2149)) [@​jagapiou](https://github.com/jagapiou) - Allow --diff to be used with --jobs ([#​2302](PyCQA/isort#2302)) [@​mnakama](https://github.com/mnakama) - Fix wemake profile to have correct character limit ([#​2241](PyCQA/isort#2241)) [@​sobolevn](https://github.com/sobolevn) - Fix sort\_reexports code mangling ([#​2283](PyCQA/isort#2283)) [@​Helveg](https://github.com/Helveg) - Fix correct group by package tokenization ([#​2136](PyCQA/isort#2136)) [@​glasnt](https://github.com/glasnt) </details> --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yLjQiLCJ1cGRhdGVkSW5WZXIiOiI0My4yNS43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> See merge request swiss-armed-forces/cyber-command/cea/loom!284 Co-authored-by: Loom MR Pipeline Trigger <group_103951964_bot_9504bb8dead6d4e406ad817a607f24be@noreply.gitlab.com> Co-authored-by: shrewd-laidback palace <shrewd-laidback-palace-736-c41-2c1-e464fc974@swiss-armed-forces-open-source.ch>
chore(deps): update isort (major) This MR contains the following updates: | Package | Type | Update | Change | OpenSSF | |---|---|---|---|---| | [isort](https://github.com/PyCQA/isort) ([changelog](https://github.com/PyCQA/isort/releases)) | dev | major | `^5.13.2` → `^7.0.0` | [](https://securityscorecards.dev/viewer/?uri=github.com/PyCQA/isort) | --- ### Release Notes <details> <summary>PyCQA/isort (isort)</summary> ### [`v7.0.0`](https://github.com/PyCQA/isort/releases/tag/7.0.0) [Compare Source](PyCQA/isort@6.1.0...7.0.0) #### Changes #### 💥 Breaking Changes - Drop support for Python 3.9 ([#​2430](PyCQA/isort#2430)) [@​DanielNoord](https://github.com/DanielNoord) #### 🚀 Features - Show absolute paths in skipped file messages ([#​2416](PyCQA/isort#2416)) [@​pranlawate](https://github.com/pranlawate) #### 🪲 Fixes - Some fixes for Python 3.14 ([#​2433](PyCQA/isort#2433)) [@​DanielNoord](https://github.com/DanielNoord) - Test on `3.14` and fix any bugs ([#​2425](PyCQA/isort#2425)) [@​DanielNoord](https://github.com/DanielNoord) - Update CHANGELOG.md + Fix Formatting and Grammar ([#​2419](PyCQA/isort#2419)) [@​lukbrew25](https://github.com/lukbrew25) - Fix output of hanging indent for long lines with noqa ([#​2407](PyCQA/isort#2407)) [@​matan1008](https://github.com/matan1008) #### :construction\_worker: Continuous Integration - Format with `ruff` instead of `black` ([#​2432](PyCQA/isort#2432)) [@​DanielNoord](https://github.com/DanielNoord) - Target 3.10 for `ruff` ([#​2431](PyCQA/isort#2431)) [@​DanielNoord](https://github.com/DanielNoord) - Update development dependencies to latest version ([#​2426](PyCQA/isort#2426)) [@​DanielNoord](https://github.com/DanielNoord) - docs: update pre-commit examples to version 6.1.0 ([#​2413](PyCQA/isort#2413)) [@​pranlawate](https://github.com/pranlawate) - Small cleanup for developer environment ([#​2418](PyCQA/isort#2418)) [@​DanielNoord](https://github.com/DanielNoord) #### 📦 Dependencies - Bump actions/setup-python from 5 to 6 in the github-actions group ([#​2411](PyCQA/isort#2411)) @​[dependabot\[bot\]](https://github.com/apps/dependabot) ### [`v6.1.0`](https://github.com/PyCQA/isort/blob/HEAD/CHANGELOG.md#610-October-1-2025) [Compare Source](PyCQA/isort@6.0.1...6.1.0) - Add python 3.14 classifier and badge ([#​2409](PyCQA/isort#2409)) [@​staticdev](https://github.com/staticdev) - Drop use of non-standard pkg\_resources API ([#​2405](PyCQA/isort#2405)) [@​dvarrazzo](https://github.com/dvarrazzo) ### [`v6.0.1`](https://github.com/PyCQA/isort/blob/HEAD/CHANGELOG.md#601-Febuary-26-2025) [Compare Source](PyCQA/isort@6.0.0...6.0.1) - Add OSError handling in find\_imports\_in\_file ([#​2331](PyCQA/isort#2331)) [@​kobarity](https://github.com/kobarity) ### [`v6.0.0`](https://github.com/PyCQA/isort/blob/HEAD/CHANGELOG.md#600-January-27-2025) [Compare Source](PyCQA/isort@5.13.2...6.0.0) - Remove support for Python 3.8 ([#​2327](PyCQA/isort#2327)) [@​DanielNoord](https://github.com/DanielNoord) - Python 3.13 support ([#​2306](PyCQA/isort#2306)) [@​mayty](https://github.com/mayty) - Speed up exists\_case\_sensitive calls ([#​2264](PyCQA/isort#2264)) [@​correctmost](https://github.com/correctmost) - Ensure that split\_on\_trailing\_comma works with as imports ([#​2340](PyCQA/isort#2340)) [@​DanielNoord](https://github.com/DanielNoord) - Black profile: enable magic comma ([#​2236](PyCQA/isort#2236)) [@​MrMino](https://github.com/MrMino) - Update line\_length and single\_line\_exclusions in google profile ([#​2149](PyCQA/isort#2149)) [@​jagapiou](https://github.com/jagapiou) - Allow --diff to be used with --jobs ([#​2302](PyCQA/isort#2302)) [@​mnakama](https://github.com/mnakama) - Fix wemake profile to have correct character limit ([#​2241](PyCQA/isort#2241)) [@​sobolevn](https://github.com/sobolevn) - Fix sort\_reexports code mangling ([#​2283](PyCQA/isort#2283)) [@​Helveg](https://github.com/Helveg) - Fix correct group by package tokenization ([#​2136](PyCQA/isort#2136)) [@​glasnt](https://github.com/glasnt) </details> --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yLjQiLCJ1cGRhdGVkSW5WZXIiOiI0My4yNS43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==--> See merge request swiss-armed-forces/cyber-command/cea/loom!284 Co-authored-by: Loom MR Pipeline Trigger <group_103951964_bot_9504bb8dead6d4e406ad817a607f24be@noreply.gitlab.com> Co-authored-by: open-source Pipeline <group_90701827_bot_ed04ae348bc5f40af9966fb8b6867e99@noreply.gitlab.com>
Closes #2307
Deciding to take it a bit slower and merge stuff in smaller chunks.
@matthewhughes934 I cherry picked your change from #2325 as without it
poetry lock --no-updatedoesn't work.I need some more time to look into the other changes, which I hope to do tomorrow after merging this.
@mayty You mentioned that you couldn't get stuff to work without removing Python 3.8 in #2306 so let's first merge that and worry about Python 3.13 afterwards. That seems like a better procedure :)
Perhaps any of you or @hugovk could have a look at this? :)
Note that I'm taking it slow as some concern was raised in PyCQA/meta#64 that my efforts to merge some PRs might not be welcomed by the original maintainers of the library/package. Therefore I want to make extra sure I don't merge any bugs/issues and only merge stuff that is definitely okay.