ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
34k stars 5.78k forks source link

[Core] No dependency on setuptools results in broken build #36742

Open mezuzza opened 1 year ago

mezuzza commented 1 year ago

What happened + What you expected to happen

Importing Ray results in the following exception unless setuptools is installed:

webserver-dev  | Traceback (most recent call last):
webserver-dev  |   File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
webserver-dev  |     return _run_code(code, main_globals, None,
webserver-dev  |   File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
webserver-dev  |     exec(code, run_globals)
webserver-dev  |   File "/workspace/src/daimon/server/__main__.py", line 3, in <module>
webserver-dev  |     from .main import main
webserver-dev  |   File "/workspace/src/daimon/server/main.py", line 7, in <module>
webserver-dev  |     import ray
webserver-dev  |   File "/root/.local/share/pdm/venvs/workspace-6rDWGpm2-docker/lib/python3.10/site-packages/ray/__init__.py", line 136, in <module>
webserver-dev  |     from ray._private.worker import (  # noqa: E402,F401
webserver-dev  |   File "/root/.local/share/pdm/venvs/workspace-6rDWGpm2-docker/lib/python3.10/site-packages/ray/_private/worker.py", line 50, in <module>
webserver-dev  |     import ray._private.parameter
webserver-dev  |   File "/root/.local/share/pdm/venvs/workspace-6rDWGpm2-docker/lib/python3.10/site-packages/ray/_private/parameter.py", line 4, in <module>
webserver-dev  |     import pkg_resources
webserver-dev  | ModuleNotFoundError: No module named 'pkg_resources'

Expectation: No exception is thrown and module initializes without issue.

Versions / Dependencies

Versions:

Reproduction script

pyproject.toml

[build-system]
build-backend = "pdm.backend"
requires = ["pdm-backend"]

[project]
dependencies = [
    "ray[default, serve]>=2.5.0,<2.6.0",
]

test.py

import ray

Issue Severity

Low: It annoys or frustrates me.

rkooo567 commented 1 year ago

Please feel free to make a contribution!