From 7ae1bcb72dfb1609385c8c237a76aa1512902961 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Mon, 20 Nov 2017 15:10:07 -0500 Subject: updated some magic number references, no functional changes. --- src/CHANGES.txt | 3 +++ src/engine/SCons/Tool/jar.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index da4e6ae..3716b39 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,6 +8,9 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Daniel Moody: + - Removed some magic numbers from jar.py on behalf of Mats Wichmann (mats@linux.com) + + From Daniel Moody: - Jar can take multiple targets, and will make a duplicate jar from the sources for each target - Added some warnings in case the Jar builder makes an implicit target - Added Jar method and changed jar build to be more specific. Jar method will take in diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py index 49600e0..6c7a8c9 100644 --- a/src/engine/SCons/Tool/jar.py +++ b/src/engine/SCons/Tool/jar.py @@ -52,7 +52,7 @@ def jarSources(target, source, env, for_signature): result = [] for src in source: contents = src.get_text_contents() - if contents[:16] != "Manifest-Version": + if contents.startswith("Manifest-Version"): if jarchdir_set: _chdir = jarchdir else: @@ -73,7 +73,7 @@ def jarManifest(target, source, env, for_signature): """Look in sources for a manifest file, if any.""" for src in source: contents = src.get_text_contents() - if contents[:16] == "Manifest-Version": + if contents.startswith("Manifest-Version"): return src return '' @@ -83,7 +83,7 @@ def jarFlags(target, source, env, for_signature): jarflags = env.subst('$JARFLAGS', target=target, source=source) for src in source: contents = src.get_text_contents() - if contents[:16] == "Manifest-Version": + if contents.startswith("Manifest-Version"): if not 'm' in jarflags: return jarflags + 'm' break -- cgit v0.12 From cac2eee4f3a903bbf0cc8a8b64313acaa237593c Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Tue, 21 Nov 2017 10:31:19 -0500 Subject: fixed mistake in converting from magic numbers where it should have been the not case --- src/engine/SCons/Tool/jar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Tool/jar.py b/src/engine/SCons/Tool/jar.py index 6c7a8c9..f833ba2 100644 --- a/src/engine/SCons/Tool/jar.py +++ b/src/engine/SCons/Tool/jar.py @@ -52,7 +52,7 @@ def jarSources(target, source, env, for_signature): result = [] for src in source: contents = src.get_text_contents() - if contents.startswith("Manifest-Version"): + if not contents.startswith("Manifest-Version"): if jarchdir_set: _chdir = jarchdir else: -- cgit v0.12 From a3ffab8de1af5d4190600093a33d62b974f2507a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 21 Nov 2017 18:43:37 -0500 Subject: Remove obsolete __coerce__ methods on CLVar. Not used by new style objects --- src/engine/SCons/EnvironmentTests.py | 4 ---- src/engine/SCons/Util.py | 2 -- 2 files changed, 6 deletions(-) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 229858f..7cd6015 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -139,10 +139,6 @@ class CLVar(UL): return UL.__add__(self, CLVar(other)) def __radd__(self, other): return UL.__radd__(self, CLVar(other)) - def __coerce__(self, other): - return (self, CLVar(other)) - - class DummyNode(object): def __init__(self, name): diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index 7ed9706..558441d 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -1029,8 +1029,6 @@ class CLVar(UserList): return UserList.__add__(self, CLVar(other)) def __radd__(self, other): return UserList.__radd__(self, CLVar(other)) - def __coerce__(self, other): - return (self, CLVar(other)) def __str__(self): return ' '.join(self.data) -- cgit v0.12 From 73451a291d57019a52b0a3f211c2e199d5ac7dfe Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Thu, 23 Nov 2017 00:30:22 -0500 Subject: num_jobs will be based on the number of CPUs detected to make sure parallel jobs can fill the queue. --- src/engine/SCons/JobTests.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/JobTests.py b/src/engine/SCons/JobTests.py index dd2c7aa..6ae8e92 100644 --- a/src/engine/SCons/JobTests.py +++ b/src/engine/SCons/JobTests.py @@ -27,17 +27,40 @@ import random import math import sys import time +import os import TestUnit import SCons.Job +def get_cpu_nums(): + # Linux, Unix and MacOS: + if hasattr( os, "sysconf" ): + if "SC_NPROCESSORS_ONLN" in os.sysconf_names: + # Linux & Unix: + ncpus = os.sysconf( "SC_NPROCESSORS_ONLN" ) + if isinstance(ncpus, int) and ncpus > 0: + return ncpus + else: # OSX: + return int( os.popen2( "sysctl -n hw.ncpu")[1].read() ) + # Windows: + if "NUMBER_OF_PROCESSORS" in os.environ: + ncpus = int( os.environ[ "NUMBER_OF_PROCESSORS" ] ); + if ncpus > 0: + return ncpus + return 1 # Default + # a large number num_sines = 10000 # how many parallel jobs to perform for the test -num_jobs = 11 +num_jobs = get_cpu_nums()*2 + +# in case we werent able to detect num cpus for this test +# just make a hardcoded suffcient large number, though not future proof +if(num_jobs == 2): + num_jobs = 33 # how many tasks to perform for the test num_tasks = num_jobs*5 -- cgit v0.12 From 8d0b5313c385ae7adfb56631d9082d4b57db1836 Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Sat, 2 Dec 2017 01:29:53 +0000 Subject: Remove testing for hashlib and corresponding support for command line options. hashlib is part of the standard library since Python 2.5, and SCons supports Python 2.7 and later. --- doc/man/scons.xml | 9 --------- src/engine/SCons/CacheDir.py | 7 +------ src/engine/SCons/Warnings.py | 3 --- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/doc/man/scons.xml b/doc/man/scons.xml index bc3793f..fe1803b 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -1871,15 +1871,6 @@ These warnings are enabled by default. - --warn=no-md5-module, --warn=no-no-md5-module - -Enables or disables warnings about the version of Python -not having an MD5 checksum module available. -These warnings are enabled by default. - - - - --warn=no-metaclass-support, --warn=no-no-metaclass-support Enables or disables warnings about the version of Python diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index 1690674..ac91c85 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -27,6 +27,7 @@ __doc__ = """ CacheDir support """ +import hashlib import json import os import stat @@ -134,12 +135,6 @@ warned = dict() class CacheDir(object): def __init__(self, path): - try: - import hashlib - except ImportError: - msg = "No hashlib or MD5 module available, CacheDir() not supported" - SCons.Warnings.warn(SCons.Warnings.NoMD5ModuleWarning, msg) - path = None self.path = path self.current_cache_debug = None self.debugFP = None diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py index 2495b89..833a9a0 100644 --- a/src/engine/SCons/Warnings.py +++ b/src/engine/SCons/Warnings.py @@ -74,9 +74,6 @@ class MisleadingKeywordsWarning(WarningOnByDefault): class MissingSConscriptWarning(WarningOnByDefault): pass -class NoMD5ModuleWarning(WarningOnByDefault): - pass - class NoMetaclassSupportWarning(WarningOnByDefault): pass -- cgit v0.12 From 47e3f3862fdf3ca386c5006edfd0239db209112a Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Sun, 3 Dec 2017 09:37:24 +0000 Subject: Remove unused warnings from the man page and Warnings.py This warning was never used in the code. --- doc/man/scons.xml | 11 ----------- src/engine/SCons/Warnings.py | 3 --- 2 files changed, 14 deletions(-) diff --git a/doc/man/scons.xml b/doc/man/scons.xml index fe1803b..c198957 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -1871,17 +1871,6 @@ These warnings are enabled by default. - --warn=no-metaclass-support, --warn=no-no-metaclass-support - -Enables or disables warnings about the version of Python -not supporting metaclasses when the - -option is used. -These warnings are enabled by default. - - - - --warn=no-object-count, --warn=no-no-object-count Enables or disables warnings about the diff --git a/src/engine/SCons/Warnings.py b/src/engine/SCons/Warnings.py index 833a9a0..e8158a4 100644 --- a/src/engine/SCons/Warnings.py +++ b/src/engine/SCons/Warnings.py @@ -74,9 +74,6 @@ class MisleadingKeywordsWarning(WarningOnByDefault): class MissingSConscriptWarning(WarningOnByDefault): pass -class NoMetaclassSupportWarning(WarningOnByDefault): - pass - class NoObjectCountWarning(WarningOnByDefault): pass -- cgit v0.12 From b0c97773c93beeadfeea95ecd1a83c2817dc3b56 Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Sun, 3 Dec 2017 09:40:54 +0000 Subject: Update CHANGES.txt to describe this fix. --- src/CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index da4e6ae..6f1f2d0 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -47,6 +47,9 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Zachary Tessler: - Fix incorrect warning for repeated identical builder calls that use overrides + From Andrew Featherstone + - Removed unused --warn options from the man page and source code. + RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700 NOTE: This is a major release. You should expect that some targets may rebuild when upgrading. -- cgit v0.12 From 45a657607b8ce3f306c549664ecf708136bbfe1d Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 5 Dec 2017 21:07:20 -0800 Subject: Adding to support automatic coverage via github/coveralls --- .coveralls.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..7a1d4a3 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,3 @@ +service_name: travis-pro +repo_token: 1mUyRvK28QaLiKElPYgQGVlrUHxFhS037 + -- cgit v0.12