aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

CloudFormation helper scripts (2.0-34) & Python 3.13: deprecation warning - pkg_resources package is slated for removal as early as 2025-11-30

Open
#2,357 1 comment 11 reactions 0 assignees View on GitHub
NeedTriage other
Dominant language
No language data
Stars
1.1k
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### Resource Name

AWS::*

### Details

Installing the currently latest cloudformation helper scripts from [1], version 2.0-34, on linux distributions having python 3.13 as system standard, works.
However, when invoking any of the tools, at runtime, the following deprecation warning is shown:

```
/opt/pipx/venvs/aws-cfn-bootstrap/lib/python3.13/site-packages/cfnbootstrap/resources/documents/__init__.py:35: UserWarning: pkg_resources is deprecated as an API.
See https://setuptools.pypa.io/en/latest/pkg_resources.html
The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
```

https://setuptools.pypa.io/en/latest/pkg_resources.html states:
_Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata).
Some useful APIs are also provided by packaging (e.g. requirements and version parsing).
Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions._

Depending on the distributions update cycle to upstream python, the CloudFormation helper scripts might stop working at the beginning of December this year.

Falling back to python 3.12 isn't always an option, as the older python version is often not available on newer distributions anymore.
Pinning some python packages might work temporarily, but introduces compliance issues in the long run, as one can not guarantee having relevant security fixes in time.

As this adjustment reagrding the deprecation of pkg_resources seems to be required anyway, i would assume it would make sense to consider starting it sooner than later.

Currently, this introduces uncertainty wheter it is prudent to upgrade to newer versions of linux distributions using python 3.13., as it is unclear if this issue will break things in December.
On the other hand, one can't stay on the older OS versions forever, as their end of life dates also get closer, as their successors have been released.

[1] https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz

Contributor guide

Open the contributing guide

Research direction

Start with cfnbootstrap/resources/documents/__init__.py, where the Python 3.13 warning is emitted, and inspect the pkg_resources import. Run the CloudFormation helper tools on Python 3.13 to reproduce the warning and verify that the tools run without it after the dependency usage is updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.