-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package resolution fails if the package name contains a dot #6206
Comments
Works if you put quotes around package name.
|
Does fixing this really requires code intervention or just documentation? |
I am not sure we can fix it with code, because the shell command is what gets confused by the dot. Unless you know of a way ... |
Analysis of Issue #62061. Problem SummaryThe core issue is that Pipenv fails to resolve and install packages if the package name contains a dot (".") without being enclosed in quotes. This is because the shell interprets the dot as a path separator, leading to confusion during package resolution. 2. Comment Discussion Analysis
3. Proposed ResolutionWhile a complete code-based solution to prevent the shell from misinterpreting dots may be challenging, the following steps can effectively address the issue:
4. Potential Code ChangesImproved error handling in for package_name, dep in deps.items():
if not dep:
continue
# Check if package name contains a dot and is not enclosed in quotes
if "." in package_name and not (
package_name.startswith('"') and package_name.endswith('"')
):
raise exceptions.ResolutionFailure(
message=f"Package name '{package_name}' contains a dot (.) and must be enclosed in quotes."
)
canonical_package_name = canonicalize_name(package_name) This modification will catch the problematic package name before resolution, raising a specific error message instructing the user to enclose the name in quotes. 5. Additional Steps/Investigations
By combining clear documentation and improved error handling, Pipenv can effectively address this issue, making the package installation process smoother for users dealing with packages containing dots in their names. |
Issue description
I am trying to install mach.py with pipenv but it fails:
Expected result
The package mach.py should not raise an exception.
Actual result
$ pipenv --support
Pipenv version:
'2024.0.1'
Pipenv location:
'/usr/lib/python3.12/site-packages/pipenv'
Python location:
'/usr/bin/python3.12'
OS Name:
'posix'
User pip version:
'24.0'
user Python installations found:
PEP 508 Information:
If you're on macOS, run the following:
If you're on Windows, run the following:
If you're on Linux, run the following:
The text was updated successfully, but these errors were encountered: