Skip to content

Make fastapi install optional and relax pinning from setup.py requirements #4361

Closed

Description

@jmahlik

Describe the bug
68ff700#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R67-R72 introduced pinned dependencies in the setup.py.

These will inevitably conflict with downstream users ability to install sagemaker alongside fastapi or uvcorn. Relax the restrictions on the deps.

** edit **
On second thought, why are fastapi and uvicorn listed as dependencies? I don't see any references to them in the codebase on the current master/v2.203.0. These should either be removed or set as optional extra installs.

Not imported anywhere? Only shows in the setup.py.

git grep --ignore-case -e 'fastapi'
setup.py:    "fastapi==0.95.2",

Using pipdeptree shows these packages bring in other transitive deps which increases the install load if they aren't used or only used for a niche feature.

pipdeptree  -p fastapi,uvicorn
fastapi==0.95.2
├── pydantic [required: >=1.6.2,<2.0.0,!=1.8.1,!=1.8,!=1.7.3,!=1.7.2,!=1.7.1,!=1.7, installed: 1.10.13]
│   └── typing-extensions [required: >=4.2.0, installed: 4.9.0]
└── starlette [required: >=0.27.0,<0.28.0, installed: 0.27.0]
    └── anyio [required: >=3.4.0,<5, installed: 4.2.0]
        ├── idna [required: >=2.8, installed: 3.6]
        └── sniffio [required: >=1.1, installed: 1.3.0]
uvicorn==0.22.0
├── click [required: >=7.0, installed: 8.1.7]
│   └── colorama [required: Any, installed: 0.4.6]
└── h11 [required: >=0.8, installed: 0.14.0]

To reproduce
This was introduced in release 2.199.0.

python -m pip install sagemaker==2.203.0 results in unresolvable deps if fastapi is pinned in a users requirements.

Expected behavior
Install to resolve without restricting the version of fastapi.

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.203.0
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): n/a
  • Framework version: n/a
  • Python version: 3.12/3.11/3.10/3.9
  • CPU or GPU: cpu
  • Custom Docker image (Y/N): N

Additional context
Add any other context about the problem here.

Activity

  1. jmahlik commented on Jan 8, 2024

    @jmahlik
    ContributorAuthor

    Also releated: #4295

  2. changed the title [-]Relax version pinning from `setup.py` requirements[/-] [+]Make fastapi install optional and relax pinning from `setup.py` requirements[/+] on Jan 8, 2024
  3. added a commit that references this issue on Jan 8, 2024
    87281ba
  4. j-adamczyk commented on Jan 16, 2024

    @j-adamczyk

    +1. Why is this even included if it's not used?

  5. added 3 commits that reference this issue on Jan 17, 2024
    8f7021a
    cd1fd7d
    9300010
  6. added a commit that references this issue on Jan 24, 2024
    985f7bc
  7. added a commit that references this issue on Jan 30, 2024
    09c20dc
  8. added a commit that references this issue on Feb 5, 2024
    a97d24f
  9. added a commit that references this issue on Feb 8, 2024
    6925cbc
  10. added a commit that references this issue on Feb 29, 2024
    36b0966
  11. added a commit that references this issue on Jun 25, 2024
    3dcafdf
  12. added 2 commits that reference this issue on Jun 8, 2026
    f23d495
    7184db5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions