Skip to content

Instantly share code, notes, and snippets.

@Paradoxis
Created August 9, 2021 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Paradoxis/1be5124ddfa01afb0b1b91754ef4b5b7 to your computer and use it in GitHub Desktop.
Save Paradoxis/1be5124ddfa01afb0b1b91754ef4b5b7 to your computer and use it in GitHub Desktop.
Checks if a package is installed using an installable flag '-e' without use of pip's internal API
def is_development_install(package: str) -> bool:
"""Check if we're running a development installation"""
import pkg_resources
file = Path(dirname(pkg_resources.__file__)).parent
file = file.joinpath(package.replace('_', '-') + '.egg-link')
return file.exists()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment