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

Fix CI for Python >= 3.12 #3223

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

jonathan343
Copy link
Contributor

Our CI for Python >= 3.12 has started failing since setuptools-71.0.0 was released on 7/17:

Now setuptools declares its own dependencies in the core extra. Dependencies are still vendored for bootstrapping purposes, but setuptools will prefer installed dependencies if present. The core extra is used for informational purposes and should not be declared in package metadata (e.g. build-requires). Downstream packagers can de-vendor by simply removing the setuptools/_vendor directory. Since Setuptools now prefers installed dependencies, those installing to an environment with old, incompatible dependencies will not work. In that case, either uninstall the incompatible dependencies or upgrade them to satisfy those declared in core. (#2825)

This CR installs pip install setuptools==67.8.0 before running CI as opposed to pip install setuptools. This matches the following requirement defined in requirements-dev.txt and prevents similar issues in the future:

setuptools==67.8.0;python_version>="3.12"

@jonathan343 jonathan343 changed the title pin setuptools in ci for python >= 3.12 Fix CI for Python >= 3.12 Jul 19, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.15%. Comparing base (b4a86ed) to head (63efaa9).
Report is 59 commits behind head on develop.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3223   +/-   ##
========================================
  Coverage    93.14%   93.15%           
========================================
  Files           66       66           
  Lines        14248    14252    +4     
========================================
+ Hits         13272    13276    +4     
  Misses         976      976           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chemelli74
Copy link

Why not install via "pip install -r requirements.txt" ?
This way CI is always aligned

@jonathan343
Copy link
Contributor Author

jonathan343 commented Jul 19, 2024

Why not install via "pip install -r requirements.txt" ? This way CI is always aligned

Hey @chemelli74,
We install requirements from our requirements-dev-lock.txt file which defines constraints on specific package versions we know work. However, starting in Python 3.12, the setuptools package isn't preinstalled in virtual environments created using venv.

  • gh-95299: Do not pre-install setuptools in virtual environments created with venv.

Because of this change in Python >= 3.12, we conditionally install setuptools==67.8.0;python_version>="3.12" in requirements-dev.txt. This information gets lost in the lock file since it's generated using Python 3.8 (our minimum supported version) so we need account for it in our install script.

The issue with installing from requirements-dev.txt directly is we'll run into similar issues with unbounded dependencies if they release a breaking change. We'll consider alternatives within our team, but this CR will resolve our CI in the meantime.

@jonathan343 jonathan343 merged commit 79681b9 into boto:develop Jul 19, 2024
34 checks passed
aws-sdk-python-automation added a commit that referenced this pull request Jul 22, 2024
* release-1.34.146:
  Bumping version to 1.34.146
  Update endpoints model
  Update to latest models
  Add changelog
  Remove deprecated AWS Mobile Hub service
  Bump aws-actions/closed-issue-message
  pin setuptools in ci for python >= 3.12 (#3223)
hswong3i pushed a commit to alvistack/boto-botocore that referenced this pull request Jul 23, 2024
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 this pull request may close these issues.

4 participants