Skip to content

Instantly share code, notes, and snippets.

@odedniv
Created December 26, 2017 20:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odedniv/f1633874e31a891c36da296d4df0729c to your computer and use it in GitHub Desktop.
Save odedniv/f1633874e31a891c36da296d4df0729c to your computer and use it in GitHub Desktop.
Execute custom command inside setup.py's sandbox
class TestMappingsCommand(distutils.cmd.Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
# installs everything in install_requires (in setup.py) in a sandbox
self.distribution.fetch_build_eggs(self.distribution.install_requires)
# runs another command within the sandbox
self.run_command('compile_confugration_resources')
# executes a script within the sandbox
imp.load_source('compare_mappings', "scripts/compare-mappings.py").main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment