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

Implement PEP 660 allowing both "strict" and "lax/loose" approaches #3265

Merged
merged 55 commits into from Jun 15, 2022

Commits on Feb 4, 2022

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

Commits on Apr 22, 2022

  1. Copy the full SHA
    2bddfdf View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2022

  1. Copy the full SHA
    c6106b7 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    ad803ae View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    e36951e View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    e55e51d View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    1afb6c0 View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    0e6870b View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    da6dd05 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    e7123c6 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    821d664 View commit details
    Browse the repository at this point in the history
  10. Editable rework dist_info to use --output-dir instead of --egg-base

    Changes:
    
    - Deprecate the --egg-base parameter for dist_info and add --output-dir as
      replacement
    
      (Since the egg format is mostly deprecated, it is nice to move away from
      this nomenclature...)
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    c642529 View commit details
    Browse the repository at this point in the history
  11. Copy the full SHA
    5bb97d0 View commit details
    Browse the repository at this point in the history
  12. Copy the full SHA
    3e9f441 View commit details
    Browse the repository at this point in the history
  13. Copy the full SHA
    5866b85 View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    aee3245 View commit details
    Browse the repository at this point in the history
  15. Copy the full SHA
    33f2431 View commit details
    Browse the repository at this point in the history
  16. Copy the full SHA
    06fbc36 View commit details
    Browse the repository at this point in the history
  17. Rework PEP 660 PoC to re-use bdist_wheel

    Avoid using the editables dependency
      - The current implementation is using it to simply place .pth file
        pointing to the project directory anyway...
      - Adding a dependency for creating a file with a single line is a bit
        overkill.
    
    Avoid importing pkg_resources directly
    - Setuptools wants to move away from pkg_resources
    
    Replace custom wheel build with re-use of bdist_wheel
      - pro: avoid re-implementing the archiving logic and make sure it is
        compatible with the same archive format used by the final wheels.
      - con: the API of wheel is not exactly stable or exported as public.
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    0bf1d4c View commit details
    Browse the repository at this point in the history
  18. Copy the full SHA
    7b402eb View commit details
    Browse the repository at this point in the history
  19. Remove unused function

    abravalheri committed Jun 15, 2022
    Copy the full SHA
    a31df2e View commit details
    Browse the repository at this point in the history
  20. Copy the full SHA
    7ae5a69 View commit details
    Browse the repository at this point in the history
  21. Handle namespace_packages in editable_wheel

    This change is heavily inspired by the existing develop command
    
    - Use namespaces.Installer to ensure legacy namespaces are handled.
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    a13adc8 View commit details
    Browse the repository at this point in the history
  22. Copy the full SHA
    14eb855 View commit details
    Browse the repository at this point in the history
  23. Add namespace test

    abravalheri committed Jun 15, 2022
    Copy the full SHA
    8cb1344 View commit details
    Browse the repository at this point in the history
  24. Add initial implementation of editable strategy based on .pth file

    - Improve the skeleton that would allow the separation between different
      editable strategies
    - Extract strategy for static .pth files
    - Recognise the static .pth file as the primary strategy for src-layout
      packages in a "non"-strict scenario
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    f997500 View commit details
    Browse the repository at this point in the history
  25. Copy the full SHA
    73c65b2 View commit details
    Browse the repository at this point in the history
  26. Copy the full SHA
    59a39d9 View commit details
    Browse the repository at this point in the history
  27. Add tests for editable install focusing on namespaces

    - Move test_editable_prefix from test_develop to test_editable_install
    - Add more tests for editable install focusing on packages using
      namespaces (legacy or PEP 420)
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    a27b96b View commit details
    Browse the repository at this point in the history
  28. Copy the full SHA
    1a531db View commit details
    Browse the repository at this point in the history
  29. Copy the full SHA
    dd9886c View commit details
    Browse the repository at this point in the history
  30. Copy the full SHA
    f210f16 View commit details
    Browse the repository at this point in the history
  31. Copy the full SHA
    994ca21 View commit details
    Browse the repository at this point in the history
  32. Copy the full SHA
    fba8717 View commit details
    Browse the repository at this point in the history
  33. Copy the full SHA
    3ba7ec4 View commit details
    Browse the repository at this point in the history
  34. Fix error with Python 3.7

    abravalheri committed Jun 15, 2022
    Copy the full SHA
    01ceef6 View commit details
    Browse the repository at this point in the history
  35. Copy the full SHA
    55260a7 View commit details
    Browse the repository at this point in the history
  36. Copy the full SHA
    730b6e7 View commit details
    Browse the repository at this point in the history
  37. Copy the full SHA
    50afbf4 View commit details
    Browse the repository at this point in the history
  38. Copy the full SHA
    40f2f0f View commit details
    Browse the repository at this point in the history
  39. Initial editable MetaPathFinder for top-level pkgs

    - Add improvements and small fixes for the static .pth file strategy
    - Add initial implementation of an editable strategy based on
      MetaPathFinder but just for the top-level packages/modules
      - The idea here is to create a "loose/lax" mechanism that is able to
        handle the complex mapping mechanisms supported by setuptools (via
        package_dir) while still allowing new modules and files to be added to
        existing packages.
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    f5643f5 View commit details
    Browse the repository at this point in the history
  40. Copy the full SHA
    4112379 View commit details
    Browse the repository at this point in the history
  41. Add temporary workaround for packages.find.exclude

    This workaround can be reverted when issue 3261 is fixed.
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    008a718 View commit details
    Browse the repository at this point in the history
  42. Copy the full SHA
    f3786f3 View commit details
    Browse the repository at this point in the history
  43. Copy the full SHA
    06d52fe View commit details
    Browse the repository at this point in the history
  44. Ignore transient warning

    abravalheri committed Jun 15, 2022
    Copy the full SHA
    9dc2588 View commit details
    Browse the repository at this point in the history
  45. Copy the full SHA
    92c90db View commit details
    Browse the repository at this point in the history
  46. Copy the full SHA
    a4e16fe View commit details
    Browse the repository at this point in the history
  47. Copy the full SHA
    99cf706 View commit details
    Browse the repository at this point in the history
  48. Copy the full SHA
    3c71c87 View commit details
    Browse the repository at this point in the history
  49. Add editable strategy based on a link tree

    - Add implementation of editable strategy based on a link tree
      - This is the `strict` implementation.
      - Only files are linked, not directories.
        - This approach makes it possible to use harlinks when softlinks are not
          available (e.g. Windows)
        - It also guarantees files that would not be part of the final wheel are
          not available in the editable install.
    - Add non-editable files to the produced wheel wheel (e.g. `headers`,
      `scripts`, `data`)
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    d9c4a41 View commit details
    Browse the repository at this point in the history
  50. Copy the full SHA
    2ca60ad View commit details
    Browse the repository at this point in the history
  51. Copy the full SHA
    501aec9 View commit details
    Browse the repository at this point in the history
  52. Copy the full SHA
    4687243 View commit details
    Browse the repository at this point in the history
  53. Ensure namespaces from ImportFinder handle additions to path

    According to the PEP 420, namespace packages need to gracefully handle
    later additions to path.
    
    - Use a `PathEntryFinder` + an arbitrary placeholder entry on `sys.path`
      to force `PathFinder` to create a namespace spec.
      - Since `_NamespacePath` and `_NamespaceLoader` are private classes (or
        just documented for comparison purposes), there is no other way to
        implement this behaviour directly [^1].
    
    [^1]: Reimplementing _NamespacePath + a custom logic to maintain
          namespace portions don't have a corresponding path entry also
          seems to have the same end result.
    abravalheri committed Jun 15, 2022
    Copy the full SHA
    daaf3ab View commit details
    Browse the repository at this point in the history