Skip to content

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Apr 20, 2025

Removes reliance on easy_install while retaining a develop command, providing some extended support for the develop command while unblocking removal of easy_install.

Ref #917

  • Replace develop command with redirection to pip.
  • Ensure the deprecation warning is retained.
  • Bring back support for no-deps.

Summary of changes

Closes

Pull Request Checklist

@jaraco jaraco marked this pull request as ready for review April 27, 2025 00:45
@jaraco jaraco force-pushed the debt/develop-uses-pip branch from c519001 to 018a20c Compare April 27, 2025 00:52
@jaraco
Copy link
Member Author

jaraco commented Apr 27, 2025

There are almost certainly some incompatibilities with this change. For example, it increases the reliance on pip. It removes uninstall support (although uninstall is still available using pip). The output almost certainly changes. Also, because the installation goes through PEP 517, the installation layout will be different.

That said, this feature is intended to provide a soft landing for the users and workflows still reliant on setup.py develop. Users truly reliant on the prior behavior can pin to the prior version of Setuptools.

@jaraco jaraco merged commit 9653305 into main Apr 27, 2025
32 of 36 checks passed
@jaraco jaraco deleted the debt/develop-uses-pip branch April 27, 2025 01:52
pytorchmergebot pushed a commit to pytorch/pytorch that referenced this pull request Jul 9, 2025
…> `[uv ]pip install --no-build-isolation [-e ].` (#156027)

Modernize the development installation:

```bash
# 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`:

- pypa/setuptools#4955

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

- https://github.com/pypa/setuptools/blob/9c4d383631d3951fcae0afd73b5d08ff5a262976/setuptools/command/install.py#L58-L67

> ```python
> 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),
> )
> ```

- pypa/setuptools#3849

Additional Resource:

- [Why you shouldn't invoke setup.py directly](https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html)

Pull Request resolved: #156027
Approved by: https://github.com/ezyang
hail-ci-robot pushed a commit to hail-is/hail that referenced this pull request Sep 12, 2025
## Change Description

Fixes #15009

At some point, following the steps to spin up the dev server began to
fail with an error like
```
  File "/Users/kchandra/workspace/hail/devbin/dev_proxy.py", line 8, in <module>
    from web_common import render_template, setup_aiohttp_jinja2, setup_common_static_routes
ImportError: cannot import name 'render_template' from 'web_common' (unknown location)
```

As far as I can tell, the context for what happened is something like
this:

- There is a long-standing effort to standardize Python builds and
installs - see [PEP517](https://peps.python.org/pep-0517/) and
[PEP660](https://peps.python.org/pep-0660/), which define a new standard
for editable installs.
- As part of this, the legacy mechanism used by `setuptools` for
editable installs will be deprecated in favor of the new standardized
solution: pypa/pip#11457
- Recent `setuptools` updates have begun to migrate users off of the
legacy mechanism (ex. pypa/setuptools#4955). In
theory, if our packages use `src` layout & have moved from `setup.py` to
`pyproject.toml`, this should have had no effect. Unfortunately, neither
of these conditions are true.
- Presumably because of resulting changes in behavior, we're now hitting
a [edge
case](https://setuptools.pypa.io/en/latest/userguide/development_mode.html#id2)
in `setuptools` where the dev proxy imports a local folder in the
current directory instead of the installed package with the same name.

[`uv_build`](https://docs.astral.sh/uv/concepts/build-backend/) supports
the new install mechanisms and we're using `uv` elsewhere already, so
this seemed like a good alternative to `setuptools` with the same
advantages as `uv`.

- `batch make devserver` works both when the packages are installed
normally and when they use an editable install.
- Verified the remote server still works after a `dev deploy`.


## Security Assessment

- This change potentially impacts the Hail Batch instance as deployed by
Broad Institute in GCP

### Impact Rating

- This change has no security impact

### Impact Description

This changes the build system for these three packages, but the build
artifacts should be the same as before.

### Appsec Review

- [ ] Required: The impact has been assessed and approved by appsec

---------

Co-authored-by: Patrick Schultz <[email protected]>
Co-authored-by: Chris Llanwarne <[email protected]>
Co-authored-by: Christopher Vittal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant