From c8c1c615f2bf63e6a1ad9be70a340058bd813919 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 22 Mar 2016 14:29:47 +0900 Subject: [PATCH] Normalize path for upper-constraints It seems pip distinguishes paths with .. or extra / for constraints. For example, the following directories are considered different. /path/to/dir /path/to//dir /path/to/dir/subdir/.. This commit tries to normalize the given directory name to avoid "Could not satisfy constraints for 'xxxx': installation from path or url cannot be constrained to a version" error due to directory name mismatch. Reference: https://github.com/pypa/pip/pull/3582 Closes-Bug: #1542545 Change-Id: Iae9d58c27d3b10bca16e4a471507c4d5c16439a0 --- inc/python | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inc/python b/inc/python index 35bab6f1e0..495150d4b8 100644 --- a/inc/python +++ b/inc/python @@ -300,6 +300,13 @@ function _setup_package_with_constraints_edit { local flags=$2 local extras=$3 + # Normalize the directory name to avoid + # "installation from path or url cannot be constrained to a version" + # error. + # REVISIT(yamamoto): Remove this when fixed in pip. + # https://github.com/pypa/pip/pull/3582 + project_dir=$(cd $project_dir && pwd) + if [ -n "$REQUIREMENTS_DIR" ]; then # Constrain this package to this project directory from here on out. local name