[Scons-users] Invoking SCons as a function?

Bill Deegan bill at baddogconsulting.com
Sat Jul 1 01:20:09 EDT 2017


Are there limited values for wheel_directory?
What's the purpose of calling multiple times per invocation?

On Fri, Jun 30, 2017 at 6:04 PM, Daniel Holth <dholth at gmail.com> wrote:

> Wrote some code to invoke SCons from a function and return a certain target name [which may or may not have been built]. Needed for https://www.python.org/dev/peps/pep-0517/ which defines a Python API for installers to call against build backends.
>
>
> One important drawback to this technique is that you can't call it a second time in the same process to redefine wheel_directory or build a second target, even if you were wrapping SCons interactive mode instead of calling main() as in the example. For pip and PEP 517 it might ask for an sdist and a wheel, but the API expects to build one before telling us the target directory for the other.
>
>
> Is there a way for SCons e.g. in interactive mode to accept arguments changing the target directory for builds? Maybe something with variant directories?
>
>
> Thanks,
>
>
> Daniel
>
>
> def build_wheel(wheel_directory, settings, metadata_directory=None):    sys.argv[1:] = ['--wheel-dir=' + wheel_directory, 'bdist_wheel']    print sys.argv    try:        SCons.Script.Main.main()    except SystemExit as e:        pass    for target in SCons.Script.DEFAULT_TARGETS:        target_name = str(target)        if target_name.endswith('.whl'):            return os.path.basename(target_name)
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170630/3404c11d/attachment-0001.html>


More information about the Scons-users mailing list