From 36462c380cc6df251b167d877f63dcc5a744c520 Mon Sep 17 00:00:00 2001 From: klemen1999 Date: Fri, 31 Jul 2026 11:04:45 +0200 Subject: [PATCH] Fix setuptools constraint for pip >= 26.2 via PIP_BUILD_CONSTRAINT pip 26.2 enforces that PIP_CONSTRAINT no longer applies to isolated build environments, so the setuptools pin stopped protecting the mmcv sdist build (setup.py imports pkg_resources, removed in setuptools 82). Export PIP_BUILD_CONSTRAINT alongside PIP_CONSTRAINT and relax the unittests pin to the verified bound (<82, matching end2end and constraints.txt). --- .github/workflows/end2end_tests.yaml | 8 ++++++++ .github/workflows/unittests.yaml | 9 ++++++++- README.md | 4 +++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/end2end_tests.yaml b/.github/workflows/end2end_tests.yaml index bb04309..bdc04ea 100644 --- a/.github/workflows/end2end_tests.yaml +++ b/.github/workflows/end2end_tests.yaml @@ -45,6 +45,10 @@ jobs: CONSTRAINTS_FILE="$GITHUB_WORKSPACE/constraints.txt" echo "setuptools<82" > "$CONSTRAINTS_FILE" export PIP_CONSTRAINT="$CONSTRAINTS_FILE" + # pip >= 26.2 no longer applies PIP_CONSTRAINT to isolated build + # environments (needed for the mmcv sdist build, see + # https://github.com/open-mmlab/mmcv/issues/3325) + export PIP_BUILD_CONSTRAINT="$CONSTRAINTS_FILE" pip install -e .[dev] - name: Run full public tests @@ -93,6 +97,10 @@ jobs: CONSTRAINTS_FILE="$GITHUB_WORKSPACE/constraints.txt" echo "setuptools<82" > "$CONSTRAINTS_FILE" export PIP_CONSTRAINT="$CONSTRAINTS_FILE" + # pip >= 26.2 no longer applies PIP_CONSTRAINT to isolated build + # environments (needed for the mmcv sdist build, see + # https://github.com/open-mmlab/mmcv/issues/3325) + export PIP_BUILD_CONSTRAINT="$CONSTRAINTS_FILE" pip install -e .[dev] - name: Run representative public tests diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index a307644..9bc3956 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -60,8 +60,12 @@ jobs: working-directory: ${{ inputs.tools_ref != '' && 'tools' || '' }} run: | CONSTRAINTS_FILE="$GITHUB_WORKSPACE/constraints.txt" - echo "setuptools<81" > "$CONSTRAINTS_FILE" + echo "setuptools<82" > "$CONSTRAINTS_FILE" export PIP_CONSTRAINT="$CONSTRAINTS_FILE" + # pip >= 26.2 no longer applies PIP_CONSTRAINT to isolated build + # environments (needed for the mmcv sdist build, see + # https://github.com/open-mmlab/mmcv/issues/3325) + export PIP_BUILD_CONSTRAINT="$CONSTRAINTS_FILE" pip install -e .[dev] pip install coverage-badge>=1.1.0 pytest-cov>=4.1.0 @@ -72,6 +76,9 @@ jobs: env: ML_REF: ${{ inputs.ml_ref }} run: | + CONSTRAINTS_FILE="$GITHUB_WORKSPACE/constraints.txt" + export PIP_CONSTRAINT="$CONSTRAINTS_FILE" + export PIP_BUILD_CONSTRAINT="$CONSTRAINTS_FILE" pip uninstall luxonis-ml -y pip install \ "luxonis-ml[data,nn-archive,utils] @ git+https://github.com/luxonis/luxonis-ml.git@${ML_REF}" \ diff --git a/README.md b/README.md index dd6c0da..da5228b 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,9 @@ cd tools ```bash # Install the package -PIP_CONSTRAINT=constraints.txt pip install . +# (PIP_BUILD_CONSTRAINT is required with pip >= 26.2, which no longer +# applies PIP_CONSTRAINT to isolated build environments) +PIP_CONSTRAINT=constraints.txt PIP_BUILD_CONSTRAINT=constraints.txt pip install . # Running the package tools yolov6nr4.pt --imgsz "416" ```