Raising requires-python to 3.11 won't close your soupsieve alerts
Python 3.10 reached end of life in October, so a lot of projects are bumping requires-python to >=3.11 to finally close their Dependabot alerts. Pillow 13, filelock 4.2 and others dropped 3.10, so that bump makes sense.
Python 3.10 reached end of life in October, so a lot of projects are bumping requires-python to >=3.11 to finally close their Dependabot alerts. Pillow 13, filelock 4.2 and others dropped 3.10, so that bump makes sense.
But if your project has beautifulsoup4 anywhere in the tree, there's a catch: soupsieve.
The catch
The patched soupsieve releases need Python 3.11.5 or later, not 3.11. You can check it on PyPI: soupsieve 4.1.1 declares requires-python >=3.11.5. The early 3.0 releases were even yanked because they allowed Python versions with a broken regex engine, which was fixed in 3.11.5.
So when you set requires-python = ">=3.11", uv does the right thing: it still has to support 3.11.0 to 3.11.4, so it splits the lock at 3.11.5 and keeps the old soupsieve for those versions. Your uv.lock ends up with something like this:
{ name = "soupsieve", version = "2.10", marker = "python_full_version < '3.11.5'" },
{ name = "soupsieve", version = "4.1.1", marker = "python_full_version >= '3.11.5'" },
2.10 is still a vulnerable version. Dependabot sees it in the lock, and the alert stays open. You raised the floor, regenerated the lock, and nothing changed for soupsieve.
Sometimes uv picks a different way out: instead of keeping old soupsieve, it moves beautifulsoup4 itself way back for those Python versions. On one project I tested, Python 3.11.0β3.11.4 got beautifulsoup4 4.6.3, from 2018.
How to check your project
grep -n "3.11.5" uv.lock
If you see soupsieve or beautifulsoup4 with a < '3.11.5' marker, you have it.
The fix
Use >=3.11.5 instead of >=3.11:
requires-python = ">=3.11.5"
Then run uv lock again. The split goes away and you get one patched soupsieve. Python 3.11.5 came out in August 2023, so very few people should still be on 3.11.0 to 3.11.4.
Why I noticed
I found this same split in four public projects this month, all of them dropping 3.10 to clear alerts. In most of them, the PR or issue said the alerts would close, and the soupsieve ones wouldn't have.
I build depquiet, an open source tool that works out what to change to close your dependency alerts and checks it with uv or Poetry on a copy of your project. When the floor you'd pick still leaves a split like this, it tries the split points and suggests the exact one, here >=3.11.5:
pip install depquiet pip-audit
depquiet --fix-plan --raise-python-floor
It only checks that the versions resolve together, not that your code works with them. Your tests still decide that.
https://github.com/samuelrojas-dev/depquiet
I used Claude Code to help dig through the lock files and write the tool.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.