Skip to content

[build] modernize build-frontend: python setup.py develop/install -> [uv ]pip install --no-build-isolation [-e ].#156027

Closed
XuehaiPan wants to merge 54 commits intogh/XuehaiPan/283/basefrom
gh/XuehaiPan/283/head
Closed

[build] modernize build-frontend: python setup.py develop/install -> [uv ]pip install --no-build-isolation [-e ].#156027
XuehaiPan wants to merge 54 commits intogh/XuehaiPan/283/basefrom
gh/XuehaiPan/283/head

Conversation

@XuehaiPan
Copy link
Collaborator

@XuehaiPan XuehaiPan commented Jun 15, 2025

Modernize the development installation:

# python setup.py develop
python -m pip install --no-build-isolation -e .

# python setup.py install
python -m pip install --no-build-isolation .

Now, the python setup.py develop is a wrapper around python -m pip install -e . since setuptools>=80.0:

python setup.py install is deprecated and will emit a warning during run. The warning will become an error on October 31, 2025.

SetuptoolsDeprecationWarning.emit(
    "setup.py install is deprecated.",
    """
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.
    """,
    see_url="https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html",
    due_date=(2025, 10, 31),
)

Additional Resource:

Stack from ghstack (oldest at bottom):

cc @seemethere @malfet @osalpekar @atalman

[ghstack-poisoned]
@XuehaiPan XuehaiPan requested a review from a team as a code owner June 15, 2025 16:22
@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Jun 15, 2025
@pytorch-bot
Copy link

pytorch-bot bot commented Jun 15, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/156027

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures

As of commit 872688b with merge base 476874b (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jun 15, 2025
@XuehaiPan XuehaiPan added module: binaries Anything related to official binaries that we release to users module: build Build system issues ciflow/binaries Trigger all binary build and upload jobs on the PR ciflow/trunk Trigger trunk jobs on your pull request release notes: releng release notes category release notes: build release notes category ciflow/binaries_wheel Trigger binary build and upload jobs for wheel on the PR ciflow/binaries_libtorch Trigger binary build and upload jobs for libtorch on the PR topic: build and removed oncall: jit Add this issue/PR to JIT oncall triage queue release notes: onnx torch.onnx related changes that should show up in the release notes labels Jun 15, 2025
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added a commit to XuehaiPan/pytorch that referenced this pull request Jun 15, 2025
…> `[uv ]pip install[ -e] .`

Modernize the development installation:

```bash
python -m pip install -e .

python -m pip install .
```


ghstack-source-id: 6127c08
Pull-Request: pytorch#156027
[ghstack-poisoned]
[ghstack-poisoned]
XuehaiPan added 5 commits July 4, 2025 00:52
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@XuehaiPan
Copy link
Collaborator Author

The Docker image build failure is due to the non-existence of pip index URL for stable torch cu129, which is unrelated to this PR.

[ghstack-poisoned]
@ezyang
Copy link
Contributor

ezyang commented Jul 9, 2025

@pytorchbot merge -r

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/XuehaiPan/283/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/156027)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 jobs have failed, first few of them are: Build Official Docker Images / build (12.9, 12.9.1, 9, runtime, linux/amd64), Build Official Docker Images / build (12.9, 12.9.1, 9, devel, linux/amd64)

Details for Dev Infra team Raised by workflow job

@XuehaiPan
Copy link
Collaborator Author

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 2 checks: Build Official Docker Images / build (12.9, 12.9.1, 9, runtime, linux/amd64), Build Official Docker Images / build (12.9, 12.9.1, 9, devel, linux/amd64)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@XuehaiPan
Copy link
Collaborator Author

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 2 checks: Build Official Docker Images / build (12.9, 12.9.1, 9, runtime, linux/amd64), Build Official Docker Images / build (12.9, 12.9.1, 9, devel, linux/amd64)

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@albanD
Copy link
Collaborator

albanD commented Jul 22, 2025

@XuehaiPan @ezyang doesn't this new recommendation break ccache due to folder randomization?
Why do we recommend that??

@rgommers
Copy link
Collaborator

It shouldn't, pip just defaults to building in the build folder nowadays, that was changed several years ago. uv does the same.

@albanD
Copy link
Collaborator

albanD commented Jul 22, 2025

But then I'm surprised of the very big warning that was added to vllm recently: https://docs.vllm.ai/en/latest/getting_started/installation/gpu.html#full-build-with-compilation ?

@rgommers
Copy link
Collaborator

rgommers commented Jul 22, 2025

Those vllm instructions omit --no-build-isolation in their default instructions, which is a really bad idea: it re-installs all build dependencies on each invocation into a temporary venv, and yes that does change to a random path which will break ccache.

Doing an editable build with build isolation never really makes sense when dealing with compiled code, you'll never be able to do an incremental build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/binaries_libtorch Trigger binary build and upload jobs for libtorch on the PR ciflow/binaries_wheel Trigger binary build and upload jobs for wheel on the PR ciflow/binaries Trigger all binary build and upload jobs on the PR ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: binaries Anything related to official binaries that we release to users module: build Build system issues open source release notes: build release notes category release notes: releng release notes category topic: build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup.py develop command is disappearing soon from setuptools

8 participants