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

Commits on Oct 3, 2022

  1. Add optional param from_dir to format_requirement

    If passed, it will attempt to relative-ize the resulting URL (if possible).
    
    Add helper: fragment_string
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    a912b13 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c90d969 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    11ffba6 View commit details
    Browse the repository at this point in the history
  4. Add abs_ireq for normalizing ireqs, and related tests

    Tests:
    
    - abs_ireq_preserves_source_ireqs
    - format_requirement_impossible_relative_path_becomes_absolute (Windows-only)
    
    Also, ensure copy_install_requirement preserves our custom attributes.
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    65c489c View commit details
    Browse the repository at this point in the history
  5. Update test to expect and accept more Windows file URIs

    Specifically ones which start like file:///C:/
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    987d90b View commit details
    Browse the repository at this point in the history
  6. Add writer test for annotation accuracy regarding source ireqs

    Ensure source ireqs' comes_from attr is credited in annotations
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    6713b60 View commit details
    Browse the repository at this point in the history
  7. Add optional param from_dir to _comes_from_as_string

    This brings with it more involved string manipulation
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    0f2cf1d View commit details
    Browse the repository at this point in the history
  8. Add optional from_dir param to parse_requirements

    If passed, from_dir will be used instead of CWD to interpret relative paths.
    
    Special care is taken to guarantee _was_relative in the yielded ireqs,
    if originally relative.
    
    When calling format_requirement,
    _was_relative's presence now determines what's passed as from_dir:
    either CWD or None (None leads to an absolute path output)
    
    For ths to work we also re-assign the _was_relative attr
    to ireqs generated from candidates in the backtracking resolver.
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    f2350e1 View commit details
    Browse the repository at this point in the history
  9. Add flag for compile: --write-relative-to-output

    With test, and needed changes:
    
    - Use this flag to decide what to pass as from_dir to parse_requirements
    - Add init param to OutputWriter: write_relative_to_output
    - Add corresponding from_dir logic and use to OutputWriter._format_requirement
    - Add test_write_relative_to_output which runs with the new flag both on and off
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    8edf988 View commit details
    Browse the repository at this point in the history
  10. Add test_local_editable_vcs_package

    This ensures absolute intact paths for git+file: reqs
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    bc00d62 View commit details
    Browse the repository at this point in the history
  11. Add flag to sync: --read-relative-to-input

    With test_sync_relative_path
    
    If the reqs in the output were written relative to that output file
    (pip-compile --write-relative-to-output), then it's wise for pip-sync
    to interpret reqs it finds in there from the location of the output file.
    
    This is now possible with pip-sync --read-relative-to-input.
    
    To be clear: pip-sync's "input" is pip-compile's "output."
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    a9784a1 View commit details
    Browse the repository at this point in the history
  12. Absolute-ize src_file paths and more safely determine output file paths

    This fixes at least two problems, for which tests are added.
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    996f21c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a92729f View commit details
    Browse the repository at this point in the history
  14. Add flag for compile: --read-relative-to-input

    And add tests via parameterization
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    f46a2d5 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7e55700 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    4004f96 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    7ef7b98 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    48d05fd View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    6084450 View commit details
    Browse the repository at this point in the history
  20. Avoid choking on a relative path without scheme prefix, with fragment

    e.g. ../../rawr#egg=rawr-cli
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    8117c1d View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    ece9e14 View commit details
    Browse the repository at this point in the history
  22. Improve consistency of output regarding fragments and extras

    This fixes false-positive _was_relative assignments
    for some direct references like:
    
    ptrender[yaml] @ file:///home/andy/Code/ptrender
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    3345abc View commit details
    Browse the repository at this point in the history
  23. Add test_url_package_with_extras and fix it for backtracking

    An ireq's extras may be any Collection,
    not necessarily a set,
    so we can't rely on set operators working implicity.
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    eee3e8a View commit details
    Browse the repository at this point in the history
  24. Remove fragment_string parameter omit_extras

    As we always want to set that True
    AndydeCleyre committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    4ed481d View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    2d27659 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    88eb70d View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    6468e37 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    aa3ee0f View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2022

  1. Configuration menu
    Copy the full SHA
    f853ba9 View commit details
    Browse the repository at this point in the history