-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
Choose an approach for coherent path handling #1067
Comments
Some things I like about
|
…y and VCS reqs; fixes jazzband#881 and jazzband#293 Change Notes ------------ - Annotations now include reqsin/setup.py/stdin info when relevant - Always send reverse_dependencies to writer._format_requirement as a dict, even if empty - Invert checks for primary requirements not getting annotations, as they now do - Bypass annotation noise in tests which don't target annotations anyway, by passing --no-annotate - ireqs returned by get_best_match now have the parameter ireq's _source_ireqs, if any - reverse_dependencies are no longer passed around independently outside the resolver/cache, but rather determined from an ireq's comes_from and _source_ireqs - primary_packages are no longer passed around independently, but rather determined by an ireq's constraint - In tests, reverse dependencies for fake ireqs are now specified by setting the ireq's comes_from - These changes do _not_ improve handling of relative paths to reqsin files in annotations (see jazzband#1067) Co-authored-by: Albert Tugushev <albert@tugushev.ru>
I'm in favor of |
@atugushev alright, can we make that I still don't prefer |
Yeah, that's unfortunate, but hopefully, pip (i.e. pip-tools) drops py2 support someday. BTW, could you elaborate on |
This comment has been minimized.
This comment has been minimized.
Probably we can get much safer and more reliable behavior than we have without using anything other than diff --git a/piptools/scripts/compile.py b/piptools/scripts/compile.py
index 0572cd3..670c215 100755
--- a/piptools/scripts/compile.py
+++ b/piptools/scripts/compile.py
@@ -235,7 +235,7 @@ def cli(
)
# Otherwise derive the output file from the source file
else:
- base_name = src_files[0].rsplit(".", 1)[0]
+ base_name = os.path.splitext(src_files[0])[0]
file_name = base_name + ".txt"
output_file = click.open_file(file_name, "w+b", atomic=True, lazy=True) I may be more tempted to go an all- |
Oh, I see. That's great if |
What's the problem this feature will solve?
pip-tools currently handles paths in general a bit weakly:
./requirements.in
vsrequirements.in
)We need to reliably inspect and transform paths, absolute and relative, for issues present and future.
Describe the solution you'd like
I'd like to build a consensus on a high level approach to more robust and consistent path handling (which modules to use and how it will affect the packaging of pip-tools itself), and then use that approach to fix up and improve path operations.
Here's an example problem in the current code:
Similarly, if
some.txt
content is uncommented,pip-compile
fails because it tries to parse that for existing requirements.See also: #1061 #204 #966 #616 #395 #1084 and discussion at #1058
Alternatives and Considerations
pathlib
(stdlib) +pathlib2
(pypi or vendored)os.path
plumbum
(which could also supplantclick
)The text was updated successfully, but these errors were encountered: