diff --git a/tests/test_utils.py b/tests/test_utils.py index 0e4042c0..668a9fe7 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -278,7 +278,7 @@ def test_extract_matching_platforms() -> None: extract_matching_platforms(incorrect_platform) -def testsplit_path_and_extras() -> None: +def test_split_path_and_extras() -> None: # parse_with_extras s = "any/path[something, another]" path, extras = split_path_and_extras(s) diff --git a/unidep/_cli.py b/unidep/_cli.py index 43612ac7..1db12af7 100755 --- a/unidep/_cli.py +++ b/unidep/_cli.py @@ -850,7 +850,11 @@ def _pip_install_local( relative_prefix = ".\\" if os.name == "nt" else "./" folder = f"{relative_prefix}{folder}" # noqa: PLW2901 - if editable: + if ( + editable + and not str(folder).endswith(".whl") + and not str(folder).endswith(".zip") + ): pip_command.extend(["-e", str(folder)]) else: pip_command.append(str(folder)) diff --git a/unidep/_setuptools_integration.py b/unidep/_setuptools_integration.py index 51c32e8d..97923a9f 100755 --- a/unidep/_setuptools_integration.py +++ b/unidep/_setuptools_integration.py @@ -151,7 +151,10 @@ def get_python_dependencies( for paths in local_dependencies.values(): for path in paths: name = _package_name_from_path(path) - dependencies.append(f"{name} @ file://{path.as_posix()}") + # TODO: Consider doing this properly using pathname2url # noqa: FIX002 + # https://github.com/basnijholt/unidep/pull/214#issuecomment-2568663364 + uri = path.as_posix().replace(" ", "%20") + dependencies.append(f"{name} @ file://{uri}") return Dependencies(dependencies=dependencies, extras=extras)