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

Pants plugins: pack_metadata - python imports rules #6260

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Commits on Oct 11, 2024

  1. pants-plugins/pack_metadata: add pack_content_resource target type

    Now pack_metadata targets will generate pack_content_resource instead of just resource.
    pack_content_resource is still a resource, but this setup allows us to find
    the generated resource targets more simply.
    
    This also harmonizes the implementation of pack_metadata to follow the fields
    definition of resources (esp moving dependencies into moved_fields instead of core_fields).
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    95a0303 View commit details
    Browse the repository at this point in the history
  2. pants-plugins/pack_metadata: classify metadata type of pack_content_r…

    …esource targets
    
    This will allow rules to look up just action and sensor metadata (for example).
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    2222faf View commit details
    Browse the repository at this point in the history
  3. pants-plugins/pack_metadata: register actions/sensors in pants python…

    … module mapping
    
    Only handles the actual action/sensor python files. It does not yet handle:
    - <pack>/lib
    - <pack>/actions/lib
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    050b17e View commit details
    Browse the repository at this point in the history
  4. pants-plugins/pack_metadata: register lib and actions/lib in pants py…

    …thon module mapping
    
    This makes dependency inference aware of these which may be on the PYTHONPATH.
    - <pack>/lib
    - <pack>/actions/lib
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    9b5a90b View commit details
    Browse the repository at this point in the history
  5. pants: Remove <pack>/lib and <pack>/actions/lib from source roots

    The pack_metadata plugin now handles identifying these imports for dep inference.
    Next step, modify the PYTHONPATH as well.
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    8367663 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a816565 View commit details
    Browse the repository at this point in the history
  7. pants-plugins/pack_metadata: Add implementation notes for python_pack…

    …_content and related rules
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    8795c50 View commit details
    Browse the repository at this point in the history
  8. pants-plugins/pack_metadata: Add python_path_rules to generate PEX_EX…

    …TRA_SYS_PATH for tests
    
    This won't work until pants gets support for injecting path entries.
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    f5d62ed View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d310899 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f4aba36 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3146291 View commit details
    Browse the repository at this point in the history
  12. pants-plugins/pack_metadata: add python_rules.conftest.rule_runner fi…

    …xture
    
    Writes various test scenarios in the test sandbox.
    This should avoid repeating the setup in every test.
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    a9cf6c0 View commit details
    Browse the repository at this point in the history
  13. pants-plugins/pack_metadata: add test for pack content type detection

    And fix the identified issues.
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    55e9b8d View commit details
    Browse the repository at this point in the history
  14. pants-plugins/pack_metadata: add tests for entry_point and pack_lib r…

    …ules
    
    And fix the identified mistake in conftest.
    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    6fa9b98 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    f43f2d1 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    6d78136 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    3601300 View commit details
    Browse the repository at this point in the history
  18. pants: ignore pylint error

    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    5cd5a26 View commit details
    Browse the repository at this point in the history
  19. update changelog entry

    cognifloyd committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    b3d8c4c View commit details
    Browse the repository at this point in the history