rules_python icon indicating copy to clipboard operation
rules_python copied to clipboard

Track pip-compile USERPROFILE workaround

Open aignas opened this issue 1 year ago • 2 comments

Based on https://github.com/bazelbuild/rules_python/pull/1067/#issuecomment-2282845919

Once the issue is fixed upstream, we can remove our workaround.

aignas avatar Aug 15 '24 10:08 aignas

Heads up: https://github.com/pypa/distutils/pull/278 merged.

What still remains is:

  • setuptools needs to "vendor" the change made to distutils
  • a new version of setuptools needs to be released
  • rules_python needs to upgrade to a version of setuptools that include the change

then, I believe it may be okay to remove the workaround.

However, it may be best to keep the workaround (and perhaps even expand it to behave similarly on other platforms). See: https://github.com/pypa/distutils/pull/278#issuecomment-2305056919 https://github.com/pypa/distutils/pull/278#issuecomment-2310967837 https://github.com/pypa/distutils/pull/278#issuecomment-2311193875

cj81499 avatar Aug 26 '24 22:08 cj81499

I believe the USERPROFILE workaround unfortunately breaks .netrc discovery on windows, which we use for private package index auth. Specifically, USERPROFILE is used to resolve an os.path.expanduser("~/.netrc") call within Pip.

It looks to me like setuptools has picked up the distutils change here, which made it into setuptools 74.0. So perhaps we're now able to remove the workaround? Resetting USERPROFILE is quite a blunt hammer here that no doubt has a variety of other unintended consequences.

LaurenceTews avatar Oct 28 '25 03:10 LaurenceTews