File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -322,6 +322,7 @@ def _make_pip_command(base_path):
322322 str (base_path / "requirements.txt" ),
323323 "--target" ,
324324 str (base_path / "build" ),
325+ "setuptools<82" ,
325326 ]
326327
327328 @staticmethod
Original file line number Diff line number Diff line change 11{{ support_lib_name }}>= 2.1.9
2+ setuptools < 82
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def find_version(*file_paths):
4040 install_requires = [
4141 "cloudformation-cli>=0.2.26" ,
4242 "types-dataclasses>=0.1.5" ,
43- "setuptools" ,
43+ "setuptools<82 " ,
4444 ],
4545 entry_points = {
4646 "rpdk.v1.languages" : [
Original file line number Diff line number Diff line change @@ -553,6 +553,17 @@ def test__build_pip(plugin):
553553 mock_pip .assert_called_once_with (sentinel .base_path )
554554
555555
556+ def test__make_pip_command_pins_setuptools_lt_82 (tmp_path ):
557+ """setuptools<82 must be in the pip command to prevent pkg_resources removal."""
558+ cmd = PythonLanguagePlugin ._make_pip_command (tmp_path )
559+ assert "setuptools<82" in cmd , (
560+ "setuptools<82 must be pinned in pip command — setuptools 82+ removes "
561+ "pkg_resources which breaks cloudformation-cli-python-lib at runtime"
562+ )
563+ assert str (tmp_path / "requirements.txt" ) in cmd
564+ assert str (tmp_path / "build" ) in cmd
565+
566+
556567def test__build_pip_posix (plugin ):
557568 patch_os_name = patch ("rpdk.python.codegen.os.name" , "posix" )
558569 patch_subproc = patch ("rpdk.python.codegen.subprocess_run" )
You can’t perform that action at this time.
0 commit comments