From ee327e2cdaad872a6e305028082348f753ac3c42 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 3 Jan 2019 19:37:10 -0800 Subject: Remove setuptools as it changes the contents of the .tar.gz and skips including CHANGES.txt and other .txt files --- src/setup.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) mode change 100644 => 100755 src/setup.py diff --git a/src/setup.py b/src/setup.py old mode 100644 new mode 100755 index c68d566..d189dfc --- a/src/setup.py +++ b/src/setup.py @@ -20,6 +20,17 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +from __future__ import print_function + + +import distutils.command.build_scripts +import distutils.command.install_scripts +import distutils.command.install_lib +import distutils.command.install_data +import distutils.command.install +import distutils.core +import distutils +# import setuptools """ NOTE: Installed SCons is not importable like usual Python packages. It is executed explicitly with command line scripts. This allows multiple @@ -32,7 +43,6 @@ NOTE: Installed SCons is not importable like usual Python packages. It is below is dedicated to make it happen on various platforms. """ -from __future__ import print_function __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" @@ -66,16 +76,6 @@ if not sys.platform == 'win32': else: is_win32 = 1 -import setuptools -import distutils -import distutils.core -import distutils.command.install -import distutils.command.install_data -import distutils.command.install_lib -import distutils.command.install_scripts -import distutils.command.build_scripts -import distutils.msvccompiler - _install = distutils.command.install.install _install_data = distutils.command.install_data.install_data @@ -166,7 +166,7 @@ class install(_install): self.no_scons_script = 0 self.no_version_script = 0 self.install_bat = 0 - self.no_install_bat = not is_win32 + self.no_install_bat = False # not is_win32 self.install_man = 0 self.no_install_man = is_win32 self.standard_lib = 0 @@ -325,9 +325,9 @@ class install_scripts(_install_scripts): base = os.path.basename(src) scons = os.path.join(self.install_dir, base) scons_ver = scons + '-' + Version - if is_win32: - scons += '.py' - scons_ver += '.py' + if sys.platform == "win32": + scons = scons + '.py' + scons_ver = scons_ver + '.py' create_version_script(src, scons_ver) create_basename_script(src, scons, scons_ver) @@ -355,7 +355,8 @@ class install_scripts(_install_scripts): # Use symbolic versions of permissions so this script doesn't fail to parse under python3.x exec_and_read_permission = stat.S_IXOTH | stat.S_IXUSR | stat.S_IXGRP | stat.S_IROTH | stat.S_IRUSR | stat.S_IRGRP mode_mask = 4095 # Octal 07777 used because python3 has different octal syntax than python 2 - mode = ((os.stat(file)[stat.ST_MODE]) | exec_and_read_permission) & mode_mask + mode = ((os.stat(file)[stat.ST_MODE]) | + exec_and_read_permission) & mode_mask # log.info("changing mode of %s to %o", file, mode) os.chmod(file, mode) # --- /distutils copy/paste --- @@ -504,7 +505,7 @@ arguments = { 'install_lib': install_lib, 'install_data': install_data, 'install_scripts': install_scripts, - 'build_scripts': build_scripts} + 'build_scripts': build_scripts}, } distutils.core.setup(**arguments) -- cgit v0.12 From d7949f9c4e7d70de3b5e060cb402b2d5f9f69a8d Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 4 Jan 2019 11:26:04 -0700 Subject: Update some doc examples map() now returns an interable instead of a list, update examples which assumed they could just print() the result of a map(). Signed-off-by: Mats Wichmann --- doc/man/scons.xml | 14 +++++++------- doc/user/command-line.xml | 13 ++++++------- src/CHANGES.txt | 4 ++++ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/doc/man/scons.xml b/doc/man/scons.xml index f61c491..805164c 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -3014,7 +3014,7 @@ function to get at the path name for each Node. print(str(DEFAULT_TARGETS[0])) -if 'foo' in map(str, DEFAULT_TARGETS): +if 'foo' in [str(t) for t in DEFAULT_TARGETS]: print("Don't forget to test the `foo' program!") @@ -3028,13 +3028,13 @@ list change on on each successive call to the function: -print(map(str, DEFAULT_TARGETS)) # originally [] +print([str(t) for t in DEFAULT_TARGETS]) # originally [] Default('foo') -print(map(str, DEFAULT_TARGETS)) # now a node ['foo'] +print([str(t) for t in DEFAULT_TARGETS]) # now a node ['foo'] Default('bar') -print(map(str, DEFAULT_TARGETS)) # now a node ['foo', 'bar'] +print([str(t) for t in DEFAULT_TARGETS]) # now a node ['foo', 'bar'] Default(None) -print(map(str, DEFAULT_TARGETS)) # back to [] +print([str(t) for t in DEFAULT_TARGETS]) # back to [] Consequently, be sure to use @@ -5279,11 +5279,11 @@ arguments may be lists of Node objects if there is more than one target file or source file. The actual target and source file name(s) may be retrieved from their Node objects -via the built-in Python str() function: +via the built-in Python str function: target_file_name = str(target) -source_file_names = map(lambda x: str(x), source) +source_file_names = [str(x) for x in source] The function should return diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml index f26c179..1b329e7 100644 --- a/doc/user/command-line.xml +++ b/doc/user/command-line.xml @@ -2200,9 +2200,8 @@ prog2.c internal &SCons; nodes, so you need to convert the list elements to strings if you want to print them or look for a specific target name. - Fortunately, you can do this easily - by using the Python map function - to run the list through str: + You can do this easily by calling the str + on the elements in a list comprehension: @@ -2210,7 +2209,7 @@ prog2.c prog1 = Program('prog1.c') Default(prog1) -print("DEFAULT_TARGETS is %s"%map(str, DEFAULT_TARGETS)) +print("DEFAULT_TARGETS is %s" % [str(t) for t in DEFAULT_TARGETS]) prog1.c @@ -2244,10 +2243,10 @@ prog1.c prog1 = Program('prog1.c') Default(prog1) -print("DEFAULT_TARGETS is now %s"%map(str, DEFAULT_TARGETS)) +print("DEFAULT_TARGETS is now %s" % [str(t) for t in DEFAULT_TARGETS]) prog2 = Program('prog2.c') Default(prog2) -print("DEFAULT_TARGETS is now %s"%map(str, DEFAULT_TARGETS)) +print("DEFAULT_TARGETS is now %s" % [str(t) for t in DEFAULT_TARGETS]) prog1.c @@ -2338,7 +2337,7 @@ else: prog1 = Program('prog1.c') Program('prog2.c') Default(prog1) -print ("BUILD_TARGETS is %s"%map(str, BUILD_TARGETS)) +print ("BUILD_TARGETS is %s" % [str(t) for t in BUILD_TARGETS]) prog1.c diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ccab749..6732d38 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -11,6 +11,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Whatever John Doe did. + From Mats Wichmann: + - Update some doc examples for Py3: map() now returns an interable + instead of a list. + RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 -- cgit v0.12