Skip to content
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

Python v3.8 support breaks projects that require isort 6.0.0 #472

Open
robmoss2k opened this issue Feb 19, 2025 · 3 comments · Fixed by #473 · May be fixed by #471
Open

Python v3.8 support breaks projects that require isort 6.0.0 #472

robmoss2k opened this issue Feb 19, 2025 · 3 comments · Fixed by #473 · May be fixed by #471

Comments

@robmoss2k
Copy link

Describe the bug
isort 6.0.0 drops support for Python v3.8. Any project that uses isort 6.0.0 cannot use FawltyDeps, as FawltyDeps requires isort="^5.10".

To Reproduce

  • Create a Python v3.9 project.
  • poetry add isort
  • poetry add fawltydeps

Expected behavior
FawltyDeps should install alongside the current version of isort.

Environment

  • OS name + version: Windows 11
  • Version of the code: v0.18

Additional context
The only breaking change that isort 6.0.0 makes is dropping support for Python v3.8.

@robmoss2k robmoss2k linked a pull request Feb 19, 2025 that will close this issue
@jherland
Copy link
Member

Thanks for reporting this! Also I really appreciate the work you've put into #471, dropping support for v3.8! 😍

That said, we would prefer to keep working with older Python versions when we can do so without too much trouble. Unfortunately, I realize this is not what docs/CodeDesign.md is saying at the moment; we happen to have a parallel PR where we're about to update that. See this comment for more context/discussion: https://github.com/tweag/FawltyDeps/pull/449/files#r1905456955

The underlying rationale for retaining support for EOL Python versions is that we realize that a common use-case for FawltyDeps is to run it on some old Python project in order to fix its dependency declarations first. This will then make it easier to possibly tackle an upgrade to more modern Python versions

Therefore, I'd rather we first have a go at resolving this issue without dropping support for Python v3.8 just yet. I had a go at making this change in our pyproject.toml:

diff --git a/pyproject.toml b/pyproject.toml
index abd8b5a..38c40e3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -36,7 +36,11 @@ fawltydeps = "fawltydeps.main:main"
 # Do not add anything here that is only needed by CI/tests/linters/developers
 python = ">=3.8"
 importlib_metadata = ">=6.6.0"
-isort = "^5.10"
+isort = [
+    # v6 drops support for Python v3.8:
+    {version = ">=5.10", python = ">=3.9"},
+    {version = ">=5.10,<6", python = "<3.9"},
+]
 packaging = ">=24.0"
 pip-requirements-parser = ">=32.0.1"
 pydantic = ">=1.10.4,<3.0.0"

(plus the associated poetry lock --no-update), and this appears to solve the issue for me.

Does something like this work for you too? If so, I'd rather proceed with a more minimal patch like that for now, and then we'll hang on to your PR for when we eventually do want to drop Python 3.8 support.

@jherland
Copy link
Member

Oops, my other PR that referenced this issue, did not fix the isort issue. In the end we might be ready to drop v3.8 support after all: Rather than catering to older projects by running on EOLd Python versions, we should improve FawltyDeps' ability to analyze older Python code even when FawltyDeps itself is running on a modern Python version (see #460 for more details).

@jherland jherland reopened this Feb 21, 2025
@robmoss2k
Copy link
Author

#460 seems like the correct approach to me. Thanks for the attempt to fix it with a more minimal patch - I should have mentioned that I already tried that, sorry...

@jherland jherland linked a pull request Feb 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants