Skip to content

Commit 4a6ae15

Browse files
zklausNicolasHug
andauthored
Replace direct calls to setup.py with modern alternatives (#9161)
Co-authored-by: Nicolas Hug <[email protected]>
1 parent dffbf2d commit 4a6ae15

File tree

4 files changed

+6
-20
lines changed

4 files changed

+6
-20
lines changed

.github/scripts/setup-env.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,8 @@ if [[ $GPU_ARCH_TYPE == 'cuda' ]]; then
8080
fi
8181
echo '::endgroup::'
8282

83-
echo '::group::Install third party dependencies prior to TorchVision install'
84-
# Installing with `easy_install`, e.g. `python setup.py install` or `python setup.py develop`, has some quirks when
85-
# when pulling in third-party dependencies. For example:
86-
# - On Windows, we often hit an SSL error although `pip` can install just fine.
87-
# - It happily pulls in pre-releases, which can lead to more problems down the line.
88-
# `pip` does not unless explicitly told to do so.
89-
# Thus, we use `easy_install` to extract the third-party dependencies here and install them upfront with `pip`.
90-
python setup.py egg_info
91-
# The requires.txt cannot be used with `pip install -r` directly. The requirements are listed at the top and the
92-
# optional dependencies come in non-standard syntax after a blank line. Thus, we just extract the header.
93-
sed -e '/^$/,$d' *.egg-info/requires.txt | tee requirements.txt
94-
pip install --progress-bar=off -r requirements.txt
95-
echo '::endgroup::'
96-
9783
echo '::group::Install TorchVision'
98-
python setup.py develop
84+
pip install -e . -v --no-build-isolation
9985
echo '::endgroup::'
10086

10187
echo '::group::Install torchvision-extra-decoders'

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ details.
5858
```bash
5959
git clone https://github.com/pytorch/vision.git
6060
cd vision
61-
python setup.py develop # use install instead of develop if you don't care about development.
61+
pip install -e . -v --no-build-isolation # leave out the -e switch if you don't care about development.
6262
# or, for OSX
63-
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py develop
63+
# MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ pip install -e . -v --no-build-isolation
6464
# for C++ debugging, use DEBUG=1
65-
# DEBUG=1 python setup.py develop
65+
# DEBUG=1 pip install -e . -v --no-build-isolation
6666
```
6767

6868
By default, GPU support is built if CUDA is found and `torch.cuda.is_available()` is true. It's possible to force

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Torchvision currently supports the following video backends:
7171

7272
```
7373
conda install -c conda-forge 'ffmpeg<4.3'
74-
python setup.py install
74+
pip install . -v --no-build-isolation
7575
```
7676

7777
# Using the models on C++

torchvision/csrc/io/decoder/gpu/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ GPU decoder depends on ffmpeg for demuxing, uses NVDECODE APIs from the nvidia-v
1818

1919
.. code:: bash
2020
21-
python setup.py install
21+
pip install . -v --no-build-isolation

0 commit comments

Comments
 (0)