FastApi-RESTful icon indicating copy to clipboard operation
FastApi-RESTful copied to clipboard

Consider adding psutil as an optional dependency. [FEATURE]

Open martincpt opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. I have concerns about having psutil as a default dependency. As far as I know, this package requires GCC, leading to the necessity of using a heavier Docker image. Additionally, it introduces another package to carry along that may not be in use at all.

Describe the solution you'd like Psutil could be added to the extras, for example fastapi-restful[timing].

Describe alternatives you've considered The original repository did not use psutil as a dependency. Was that solution outdated?

martincpt avatar Dec 12 '23 10:12 martincpt

Yeah sure that sounds great, however I'm not sure how I wish to handle it with my "breaking updates" policy so it would take some time to implement

You're welcome to submit PR

yuval9313 avatar Dec 14 '23 15:12 yuval9313

I just installed this package and ran into an issue with psutils, then found out that this was mentioned here. I am using python image python:3.11.7-slim-bullseye and when I try to build my app from dockerfile I get the error:

Failed building wheel for psutil Could not build wheels for psutil, which is required to install pyproject.toml-based projects.

What was your solution @martincpt ?

osmanaygun avatar Jan 04 '24 20:01 osmanaygun

@osmanaygun haven't had time to figure this out yet. I suppose there is a python image comes with pre-build gcc. Maybe try alpine or (non-slim) bullseye, see if that works.

Also, you didn't mention on what platform you trying to build, but there can be other issues if you are under mac like me.

martincpt avatar Jan 05 '24 08:01 martincpt

Thanks for the reply, adding the following lline on my Dockerfile solved it :

RUN apt-get update -y && apt-get install -y gcc

I am on macos m2 chip

osmanaygun avatar Jan 05 '24 13:01 osmanaygun