Skip to content
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

Support relative paths and regularize path handling and formatting #1650

Closed
Closed
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a912b13
Add optional param from_dir to format_requirement
AndydeCleyre Jun 30, 2022
c90d969
Reuse fragment_string to simplify _build_direct_reference_best_efforts
AndydeCleyre Jun 30, 2022
11ffba6
Add working_dir context manager and corresponding test
AndydeCleyre Jun 30, 2022
65c489c
Add abs_ireq for normalizing ireqs, and related tests
AndydeCleyre Jun 30, 2022
987d90b
Update test to expect and accept more Windows file URIs
AndydeCleyre Jun 30, 2022
6713b60
Add writer test for annotation accuracy regarding source ireqs
AndydeCleyre Jun 30, 2022
0f2cf1d
Add optional param from_dir to _comes_from_as_string
AndydeCleyre Jun 30, 2022
f2350e1
Add optional from_dir param to parse_requirements
AndydeCleyre Jun 30, 2022
8edf988
Add flag for compile: --write-relative-to-output
AndydeCleyre Jun 30, 2022
bc00d62
Add test_local_editable_vcs_package
AndydeCleyre Jun 30, 2022
a9784a1
Add flag to sync: --read-relative-to-input
AndydeCleyre Jun 30, 2022
996f21c
Absolute-ize src_file paths and more safely determine output file paths
AndydeCleyre Jun 30, 2022
a92729f
Exit earlier when no output file is specified for multiple input files
AndydeCleyre Jun 30, 2022
f46a2d5
Add flag for compile: --read-relative-to-input
AndydeCleyre Jun 30, 2022
7e55700
Make annotation req file paths relative to the output file
AndydeCleyre Jun 30, 2022
4004f96
Add test_annotation_relative_paths for #1107
AndydeCleyre Jun 30, 2022
7ef7b98
Add test_format_requirement_annotation_impossible_relative_path
AndydeCleyre Jun 30, 2022
48d05fd
Reinject any lost url fragments during parse_requirements
AndydeCleyre Jun 30, 2022
6084450
Include extras syntax in direct references we construct
AndydeCleyre Jun 30, 2022
8117c1d
Avoid choking on a relative path without scheme prefix, with fragment
AndydeCleyre Jun 30, 2022
ece9e14
When copying ireqs, copy extras from a newly provided link
AndydeCleyre Jun 30, 2022
3345abc
Improve consistency of output regarding fragments and extras
AndydeCleyre Jun 30, 2022
eee3e8a
Add test_url_package_with_extras and fix it for backtracking
AndydeCleyre Jun 30, 2022
4ed481d
Remove fragment_string parameter omit_extras
AndydeCleyre Jun 30, 2022
2d27659
Add test_local_file_uri_with_extras
AndydeCleyre Jun 30, 2022
88eb70d
Add test_local_file_path_package for non-URI paths
AndydeCleyre Jun 30, 2022
6468e37
Use consistently canonicalized ireq name when writing direct reference
AndydeCleyre Jun 30, 2022
aa3ee0f
Construct relative req lines to match what pip install understands
AndydeCleyre Jun 30, 2022
f853ba9
Merge branch 'master' into feature/relpaths-post-6.8.0
ssbarnea Oct 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use consistently canonicalized ireq name when writing direct reference
  • Loading branch information
AndydeCleyre committed Oct 3, 2022
commit 6468e37fa23c8d9b25c573a48678f49b003c7691
3 changes: 2 additions & 1 deletion piptools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ def _build_direct_reference_best_efforts(ireq: InstallRequirement) -> str:
# We need to remove the egg if it exists and keep the rest of the fragments.
extras = f"[{','.join(sorted(ireq.extras))}]" if ireq.extras else ""
return (
f"{ireq.name.lower()}{extras} @ {ireq.link.url_without_fragment}"
f"{canonicalize_name(ireq.name)}{extras} @ "
f"{ireq.link.url_without_fragment}"
f"{fragment_string(ireq, omit_egg=True)}"
)

Expand Down