Update mypy to 2.1.0 - #575
Conversation
📝 WalkthroughWalkthroughThe PR updates the pinned version of ChangesDependency Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/requirements_dev.txt`:
- Line 2: Update the CI and dev environment to require Python 3.10+: change the
Travis CI configuration to use a Python 3.10+ runtime, uncomment and restore
installation of requirements_dev.txt in the Dockerfile and ensure the Docker
base image is a Python 3.10+ image, and add python_requires='>=3.10' to the
setup.py metadata to enforce the minimum Python version.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| @@ -1,3 +1,3 @@ | |||
| pytest | |||
| mypy==0.670 | |||
| mypy==2.1.0 | |||
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check Python version requirements and mypy configuration
# Check if there's a Python version specification
echo "Checking Python version specifications..."
fd -t f 'setup.py|setup.cfg|pyproject.toml|.python-version|runtime.txt' --exec cat {}
# Check for mypy configuration that might be affected by default changes
echo -e "\nChecking mypy configuration..."
fd -t f 'mypy.ini|.mypy.ini|setup.cfg|pyproject.toml' --exec cat {}
# Check CI/CD configuration for Python version
echo -e "\nChecking CI/CD Python versions..."
fd -t f '.travis.yml|.github/workflows/*.yml|.gitlab-ci.yml|tox.ini|Jenkinsfile' --exec cat {}Repository: salimfadhley/dockerized_python_playground
Length of output: 1275
🏁 Script executed:
# Check the actual content of setup.py for python_requires
cat -n setup.py | head -50Repository: salimfadhley/dockerized_python_playground
Length of output: 126
🏁 Script executed:
# Verify mypy version in requirements_dev.txt
cat -n src/requirements_dev.txtRepository: salimfadhley/dockerized_python_playground
Length of output: 138
🏁 Script executed:
# Check requirements.txt
cat -n requirements.txt 2>/dev/null || echo "requirements.txt not found in root"Repository: salimfadhley/dockerized_python_playground
Length of output: 120
🏁 Script executed:
# Check directory structure for .github/workflows
find . -type d -name "workflows" 2>/dev/null
find . -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null | head -20Repository: salimfadhley/dockerized_python_playground
Length of output: 121
🏁 Script executed:
# Check for .python-version or other Python version indicators
ls -la | grep -i pythonRepository: salimfadhley/dockerized_python_playground
Length of output: 140
🏁 Script executed:
# Check Travis CI configuration
cat -n .travis.ymlRepository: salimfadhley/dockerized_python_playground
Length of output: 267
🏁 Script executed:
# Check the python file (likely .python-version)
cat pythonRepository: salimfadhley/dockerized_python_playground
Length of output: 163
🏁 Script executed:
# Check docker-compose.yaml for Python image versions
cat -n docker-compose.yamlRepository: salimfadhley/dockerized_python_playground
Length of output: 588
🏁 Script executed:
# Look for Dockerfile or any Python base image specs
find . -name "Dockerfile*" -type f | head -5Repository: salimfadhley/dockerized_python_playground
Length of output: 98
🏁 Script executed:
# Check for pyproject.toml in src directory
cat -n src/pyproject.toml 2>/dev/null || echo "No pyproject.toml in src"Repository: salimfadhley/dockerized_python_playground
Length of output: 110
🏁 Script executed:
# Check src directory structure
ls -la src/Repository: salimfadhley/dockerized_python_playground
Length of output: 637
🏁 Script executed:
# Check the Dockerfile to see what Python base image is used
cat -n DockerfileRepository: salimfadhley/dockerized_python_playground
Length of output: 301
🏁 Script executed:
# Check src/setup.py for python_requires and other version specs
cat -n src/setup.pyRepository: salimfadhley/dockerized_python_playground
Length of output: 1453
Update CI/CD and development environment to support Python 3.10+ for mypy 2.1.0.
mypy 2.1.0 requires Python 3.10+ to run, but .travis.yml is configured to use Python 3.6. This will cause CI/CD to fail when attempting to install mypy. Additionally, the requirements_dev.txt installation is commented out in the Dockerfile (lines 3-4), and setup.py lacks a python_requires constraint to prevent this mismatch.
Required actions:
- Update
.travis.ymlto use Python 3.10 or later - Uncomment requirements_dev.txt installation in Dockerfile and ensure the base image supports Python 3.10+
- Add
python_requires='>=3.10'tosrc/setup.pyto enforce the minimum version requirement
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/requirements_dev.txt` at line 2, Update the CI and dev environment to
require Python 3.10+: change the Travis CI configuration to use a Python 3.10+
runtime, uncomment and restore installation of requirements_dev.txt in the
Dockerfile and ensure the Docker base image is a Python 3.10+ image, and add
python_requires='>=3.10' to the setup.py metadata to enforce the minimum Python
version.
|
Closing this in favor of #592 |
This PR updates mypy from 0.670 to 2.1.0.
Changelog
2.1
2.0
1.20.2
1.20.1
1.20