Skip to content

Commit

Permalink
change abspath to path
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Apr 27, 2024
1 parent 76b6266 commit 934d394
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelog.d/1354.bugfix.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Validate package(s) argument should not be absolute path(s).
Validate package(s) argument should not be path(s).
6 changes: 3 additions & 3 deletions src/pipx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def package_is_url(package: str, raise_error: bool = True) -> bool:
return False


def package_is_abspath(package: str):
def package_is_path(package: str):
if os.path.sep in package:
raise PipxError(
pipx_wrap(
Expand All @@ -207,7 +207,7 @@ def run_pipx_command(args: argparse.Namespace, subparsers: Dict[str, argparse.Ar
if "package" in args:
package = args.package
package_is_url(package)
package_is_abspath(package)
package_is_path(package)

if "spec" in args and args.spec is not None:
if package_is_url(args.spec, raise_error=False):
Expand All @@ -220,7 +220,7 @@ def run_pipx_command(args: argparse.Namespace, subparsers: Dict[str, argparse.Ar
if "packages" in args:
for package in args.packages:
package_is_url(package)
package_is_abspath(package)
package_is_path(package)
venv_dirs = {package: venv_container.get_venv_dir(package) for package in args.packages}
venv_dirs_msg = "\n".join(f"- {key} : {value}" for key, value in venv_dirs.items())
logger.info(f"Virtual Environment locations are:\n{venv_dirs_msg}")
Expand Down

0 comments on commit 934d394

Please sign in to comment.