https://github.com/samb8s/PsrPopPy
Raw File
Tip revision: d3d2f5ac6eb9149736624c1c0cc65023e482ef3c authored by Sam Bates on 09 June 2022, 11:16:26 UTC
Merge pull request #13 from mattpitkin/fix_enscons_build
Tip revision: d3d2f5a
setup.py
#!/usr/bin/env python

# Call enscons to emulate setup.py, installing if necessary.
# copied from https://github.com/dholth/hello-pyrust/blob/master/setup.py

import sys, subprocess, os.path

sys.path[0:0] = ['setup-requires']

try:
    import enscons.setup
except ImportError:
    requires = ["enscons"] 
    subprocess.check_call([sys.executable, "-m", "pip", "install", 
        "-t", "setup-requires"] + requires)
    del sys.path_importer_cache['setup-requires'] # needed if setup-requires was absent
    import enscons.setup

enscons.setup.setup()
back to top