• 
      

    Fix installing static media for extensions.

    Review Request #13198 — Created Aug. 9, 2023 and submitted

    Information

    Djblets
    release-4.x

    Reviewers

    The recent work to move Djblets over to the modern Python
    importlib.resources and importlib.metadata modules regressed the
    installation of extension static media. When checking if a resource
    exists, we were using .is_file(), which only returns True if it's af
    file and not a directory. This failed on the static directory.

    This change switches this to a call to .exists(), fixing static media
    installation.

    Unit tests were added to ensure this doesn't break in the future.

    Unit test pass.

    Deployed this fix to reviews.reviewboard.org and fixed static media
    installation for Power Pack.

    Summary ID
    Fix installing static media for extensions.
    The recent work to move Djblets over to the modern Python `importlib.resources` and `importlib.metadata` modules regressed the installation of extension static media. When checking if a resource exists, we were using `.is_file()`, which only returns `True` if it's af file and not a directory. This failed on the `static` directory. This change switches this to a call to `.exists()`, fixing static media installation.
    9745c7e337e83efee68b13c50e612684275f3a8d
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (22e6551)