Skip to content
  • Glenn Jocher's avatar
    Create `is_pip()` function (#3391) · d833ab3d
    Glenn Jocher authored
    Returns `True` if file is part of pip package. Useful for contextual behavior modification.
    
    ```python
    def is_pip():
        # Is file in a pip package?
        return 'site-packages' in Path(__file__).absolute().parts
    ```
    d833ab3d