Skip to content

Instantly share code, notes, and snippets.

@blink1073
Created November 16, 2017 11:58
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 blink1073/7d2c34444f7b371e82ee32e5ed1bcda1 to your computer and use it in GitHub Desktop.
Save blink1073/7d2c34444f7b371e82ee32e5ed1bcda1 to your computer and use it in GitHub Desktop.
setup.py hooks
from setuptools.command.develop import develop
from setuptools.command.install import install
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
fetch_yarn()
develop.run(self)
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
fetch_yarn()
install.run(self)
cmdclass = dict(
develop = PostDevelopCommand,
install = PostInstallCommand,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment