From 89091bfadcb56defc897acfa9753470e1eead6a2 Mon Sep 17 00:00:00 2001 From: grbd Date: Thu, 3 Aug 2017 12:33:51 -0700 Subject: Added docs for use of the PyPackageDir function --- doc/generated/functions.gen | 25 +++++++++++++++++++++++++ doc/generated/functions.mod | 4 ++++ doc/generated/tools.gen | 16 ++++++++++++++++ doc/generated/tools.mod | 4 ++++ doc/generated/variables.gen | 29 +++++++++++++++++++++++++++-- doc/generated/variables.mod | 2 ++ doc/scons.mod | 1 + doc/user/environments.xml | 32 ++++++++++++++++++++++++++++++++ src/CHANGES.txt | 1 + src/engine/SCons/Environment.xml | 23 +++++++++++++++++++++++ 10 files changed, 135 insertions(+), 2 deletions(-) diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index 8181d56..e72740a 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -3320,6 +3320,31 @@ Multiple targets can be passed in to a single call to + + + PyPackageDir(modulename) + + + env.PyPackageDir(modulename) + + + +This returns a Directory Node similar to Dir. +The python module / package is looked up and if located +the directory is returned for the location. +modulename +Is a named python package / module to +lookup the directory for it's location. + + +If +modulename +is a list, SCons returns a list of Dir nodes. +Construction variables are expanded in +modulename. + + + env.Replace(key=val, [...]) diff --git a/doc/generated/functions.mod b/doc/generated/functions.mod index 6183293..e460aaf 100644 --- a/doc/generated/functions.mod +++ b/doc/generated/functions.mod @@ -69,6 +69,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. PrependUnique"> Progress"> Pseudo"> +PyPackageDir"> Replace"> Repository"> Requires"> @@ -152,6 +153,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.PrependUnique"> env.Progress"> env.Pseudo"> +env.PyPackageDir"> env.Replace"> env.Repository"> env.Requires"> @@ -245,6 +247,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. PrependUnique"> Progress"> Pseudo"> +PyPackageDir"> Replace"> Repository"> Requires"> @@ -328,6 +331,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.PrependUnique"> env.Progress"> env.Pseudo"> +env.PyPackageDir"> env.Replace"> env.Repository"> env.Requires"> diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index d4b346d..0de9e03 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -95,6 +95,22 @@ Sets construction variables for generic POSIX C copmilers. Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-PLATFORM;. + + clang + + +Set construction variables for the Clang C compiler. + +Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. + + + clangxx + + +Set construction variables for the Clang C++ compiler. + +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME;. + cvf diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod index ee387ad..f9bc1d7 100644 --- a/doc/generated/tools.mod +++ b/doc/generated/tools.mod @@ -18,6 +18,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. as"> bcc32"> cc"> +clang"> +clangxx"> cvf"> cXX"> cyglink"> @@ -124,6 +126,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. as"> bcc32"> cc"> +clang"> +clangxx"> cvf"> cXX"> cyglink"> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index e31fde1..0ad4c96 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -3046,7 +3046,7 @@ The command line used to call the Java archive tool. The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -3056,7 +3056,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -4179,6 +4179,29 @@ window and importing the shell's environment variables. + + MSVC_UWP_APP + + +Build libraries for a Universal Windows Platform (UWP) Application. + + + +If $MSVC_UWP_APP is set, the Visual Studio environment will be set up to point +to the Windows Store compatible libraries and Visual Studio runtimes. In doing so, +any libraries that are built will be able to be used in a UWP App and published +to the Windows Store. +This flag will only have an effect with Visual Studio 2015+. +This variable must be passed as an argument to the Environment() +constructor; setting it later has no effect. + + + +Valid values are '1' or '0' + + + + MSVC_VERSION @@ -4196,6 +4219,8 @@ constructor; setting it later has no effect. Valid values for Windows are +14.0, +14.0Exp, 12.0, 12.0Exp, 11.0, diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 9d834de..8710f95 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -304,6 +304,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $MSSDK_VERSION"> $MSVC_BATCH"> $MSVC_USE_SCRIPT"> +$MSVC_UWP_APP"> $MSVC_VERSION"> $MSVS"> $MSVS_ARCH"> @@ -927,6 +928,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $MSSDK_VERSION"> $MSVC_BATCH"> $MSVC_USE_SCRIPT"> +$MSVC_UWP_APP"> $MSVC_VERSION"> $MSVS"> $MSVS_ARCH"> diff --git a/doc/scons.mod b/doc/scons.mod index 8d64054..448a212 100644 --- a/doc/scons.mod +++ b/doc/scons.mod @@ -243,6 +243,7 @@ PrependENVPath"> PrependUnique"> Progress"> +PyPackageDir"> Replace"> Repository"> Requires"> diff --git a/doc/user/environments.xml b/doc/user/environments.xml index d591dff..4657c05 100644 --- a/doc/user/environments.xml +++ b/doc/user/environments.xml @@ -1887,6 +1887,38 @@ C:\Python35\Lib\site-packages\someinstalledpackage\SomeTool\__init__.py +
+ Using the &PyPackageDir; function to add to the toolpath + + + In some cases you may want to use a tool + located within a installed external pip package. + This is possible by the use of sys.path within the toolpath. + However in that situaion you need to provide a prefix to the toolname + to indicate where it is located within sys.path + + + +# namespaced target using sys.path +env = Environment(tools = ['tools_example.subdir1.subdir2.SomeTool'], toolpath = sys.path) +env.SomeTool(targets, sources) + + + + To avoid the use of a prefix within the name of the tool, + we can use the PyPackageDir(modulename) function to locate the directory of the python package. + PyPackageDir returns a Dir object which represents the path of the directory + for the python package / module specified as a parameter. + + + +# namespaced target using sys.path +env = Environment(tools = ['SomeTool'], toolpath = [PyPackageDir('tools_example.subdir1.subdir2')]) +env.SomeTool(targets, sources) + + +
+ diff --git a/src/CHANGES.txt b/src/CHANGES.txt index d032949..e875a01 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -20,6 +20,7 @@ may cause rebuilds. In no case should rebuilds not happen. - Added a small fix to the python3 tool loader when loading a tool as a package - Added additional documentation to the user manual on using toolpaths with the environment This includes the use of sys.path to search for tools installed via pip or package managers + - Added support for a PyPackageDir function for use with the toolpath From William Blevins: - Updated D language scanner support to latest: 2.071.1. (PR #1924) diff --git a/src/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml index 92bc21a..ccee68d 100644 --- a/src/engine/SCons/Environment.xml +++ b/src/engine/SCons/Environment.xml @@ -2504,6 +2504,29 @@ env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) + + +(modulename) + + + +This returns a Directory Node similar to Dir. +The python module / package is looked up and if located +the directory is returned for the location. +modulename +Is a named python package / module to +lookup the directory for it's location. + + +If +modulename +is a list, SCons returns a list of Dir nodes. +Construction variables are expanded in +modulename. + + + + (key=val, [...]) -- cgit v0.12