jazzband / pip-tools

A set of tools to keep your pinned Python dependencies fresh.
https://pip-tools.rtfd.io
BSD 3-Clause "New" or "Revised" License
7.67k stars 608 forks source link

Bug: presence of `PIP_EXTRA_INDEX_URL` breaks tens of tests #2023

Closed jamesbraza closed 7 months ago

jamesbraza commented 9 months ago

Environment Versions

  1. OS Type: macOS Ventura v13.5.2
  2. Python version: $ python -V 3.8.16
  3. pip version: $ pip --version 23.3.1
  4. pip-tools version: $ pip-compile --version https://github.com/jazzband/pip-tools/tree/f20d6ae0af45cfeb54e69d7ead9a9d09449b8d5c

Steps to replicate

export PIP_EXTRA_INDEX_URL=https://user:123@pypi.fury.io/name/
pytest

Expected result

Tests to pass, regardless of PIP_EXTRA_INDEX_URL being set (in my ~/.zshrc) or not

Actual result

Many tests fail due to the extra index URL being set

WhyNotHugo commented 7 months ago

Running with tox should prevent exactly this.

I don't think that it is realistic to support running tests with any mix of environment variables.

jamesbraza commented 7 months ago

Oh I see the tox.ini here, I didn't observe that earlier. Yeah tox is a viable solution, so feel free to close this out.

I don't think that it is realistic to support running tests with any mix of environment variables.

Fwiw, I was not posing any mix, really it's just one: PIP_EXTRA_INDEX_URL. But I know what you mean.

An alternate solution could be:

chrysle commented 7 months ago

I agree with @WhyNotHugo.