pytorch / pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration
https://pytorch.org
Other
83.84k stars 22.6k forks source link

Add a requirements.txt for windows pip packages #103354

Open ZainRizvi opened 1 year ago

ZainRizvi commented 1 year ago

Goal: Enable pytorch devs to add/update pip packages for windows builds and tests in a single PR

Context

Today, if you're introducing a PR that takes a dependency on a new python package, for Windows you need to:

  1. Add a manual, temporary pip install somewhere in the workflow so that your PR passes
  2. Create a test-infra PR that adds that pip package to the AMI here: https://github.com/pytorch/test-infra/blob/main/aws/ami/windows/scripts/Installers/Install-Pip-Dependencies.ps1
  3. Remove the manual pip install line from step 1

That's pretty tedious

The Ask

Instead we should do the following:

  1. Define a dedicated requirements.txt file for windows in python/python, following the pattern used for https://github.com/pytorch/pytorch/blob/main/.github/requirements/pip-requirements-macOS.txt
  2. In that ps1 file, download the req.txt file from the prev step (you'll need to get it from the py/py repo) and install the packages it specifies.
  3. In the windows build & test workflows, we also always install packages from the requirements.txt file if they’re not already installed.

Benefits

  1. This would make future installations/upgrades easy by putting all the package changes in a single folder
  2. We have dependencies defined in one place
  3. We have safe guard in case the dependencies are not found in the AMI (which is expected for a small time window when a new package/upgrade is freshly added)

cc @kit1980 @huydhn @clee2000

nin1ten1do commented 6 months ago

python3 -m pip install -r requirements.txt

this shet basicly nevr work.. can anybody,.., fix that crap??