bigscience-workshop / bigscience-workshop/petals

Should psutil be a runtime dependency?

Open Beginner friendly
#632 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10.6k
Forks
650
PR merge metrics
No merged PRs in 30d

Description

The production server module imports psutil at module load ([src/petals/server/server.py:9-15](https://github.com/bigscience-workshop/petals/blob/22afba627a7eb4fcfe9418c49472c6a51334b8ac/src/petals/server/server.py#L9-L15)) and uses it to determine host memory ([src/petals/server/server.py:294-299](https://github.com/bigscience-workshop/petals/blob/22afba627a7eb4fcfe9418c49472c6a51334b8ac/src/petals/server/server.py#L294-L299)).

However, psutil is now only listed under [options.extras_require]. This means a clean production installation (e.g., pip install petals) will not include it, causing the server to crash immediately on startup with an ImportError.

**Proposed Fix**
Move psutil from the extra to the core _install_requires_ list in setup.cfg.

Contributor guide

No contributing guide indexed for this repository

Research direction

Read setup.cfg and compare psutil's current extras_require entry with the core install_requires list. Check the imports and host-memory usage in src/petals/server/server.py:9-15 and 294-299, then verify that a clean pip install petals includes psutil and the production server no longer fails with ImportError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, build-system
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
92/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.