Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Apr 19, 2024
1 parent b0c6423 commit 2cee943
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pipx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def get_venv_args(parsed_args: Dict[str, str]) -> List[str]:
return venv_args


def package_is_url(package: str, raise: bool = True): -> bool
def package_is_url(package: str, raise_error: bool = True) -> bool:
url_parse_package = urllib.parse.urlparse(package)
if url_parse_package.scheme and url_parse_package.netloc:
if not raise:
if not raise_error:
return True
raise PipxError("Package cannot be a URL. A valid package name should be passed instead.")
return False
Expand All @@ -197,7 +197,7 @@ def run_pipx_command(args: argparse.Namespace, subparsers: Dict[str, argparse.Ar
package_is_url(package)

if "spec" in args and args.spec is not None:
if package_is_url(args.spec, raise=False):
if package_is_url(args.spec, raise_error=False):
if "#egg=" not in args.spec:
args.spec = args.spec + f"#egg={package}"

Expand Down

0 comments on commit 2cee943

Please sign in to comment.