You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by kl...@apache.org on 2017/03/15 22:57:22 UTC
[1/6] mesos git commit: Updated pylint to rebuild 'virtualenv' when
necessary.
Repository: mesos
Updated Branches:
refs/heads/master 9393c2321 -> a9bd7078e
Updated pylint to rebuild 'virtualenv' when necessary.
Review: https://reviews.apache.org/r/53074/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a97b658f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a97b658f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a97b658f
Branch: refs/heads/master
Commit: a97b658fddb2cf32ec60808ea56249ef73f98da2
Parents: 9393c23
Author: Kevin Klues <kl...@gmail.com>
Authored: Wed Mar 15 15:47:27 2017 -0700
Committer: Kevin Klues <kl...@gmail.com>
Committed: Wed Mar 15 15:47:27 2017 -0700
----------------------------------------------------------------------
support/mesos-style.py | 74 +++++++++++++++++++++++++++++++--------------
1 file changed, 52 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a97b658f/support/mesos-style.py
----------------------------------------------------------------------
diff --git a/support/mesos-style.py b/support/mesos-style.py
index 3a5bec8..6489c2d 100755
--- a/support/mesos-style.py
+++ b/support/mesos-style.py
@@ -254,26 +254,6 @@ class PyLinter(LinterBase):
comment_prefix = '#'
- def __check_virtualenv(self):
- cli_dir = os.path.abspath(self.source_dirs[0])
-
- if not os.path.isdir(os.path.join(cli_dir, '.virtualenv')):
- print 'Virtualenv not detected... Building'
-
- p = subprocess.Popen(
- [os.path.join(cli_dir, 'bootstrap')],
- stdout=subprocess.PIPE)
-
- output = ''
- for line in p.stdout:
- output += line
-
- p.wait()
-
- if p.returncode != 0:
- sys.stderr.write(output)
- sys.exit(1);
-
def run_lint(self, source_paths):
'''
Runs pylint over given files.
@@ -284,8 +264,6 @@ class PyLinter(LinterBase):
cli_dir = os.path.abspath(self.source_dirs[0])
source_files = ' '.join(source_paths)
- self.__check_virtualenv()
-
p = subprocess.Popen(
['. {virtualenv_dir}/bin/activate; \
PYTHONPATH={lib_dir}:{bin_dir} pylint --rcfile={config} --ignore={ignore} {files}'.\
@@ -305,6 +283,58 @@ class PyLinter(LinterBase):
return num_errors
+ def __should_build_virtualenv(self, file_list):
+ cli_dir = os.path.abspath(self.source_dirs[0])
+
+ if not os.path.isdir(os.path.join(cli_dir, '.virtualenv')):
+ print 'Virtualenv for python linter not detected ... building'
+ return True
+
+ basenames = []
+ if file_list:
+ basenames = [os.path.basename(file) for file in file_list]
+
+ if 'pip-requirements.txt' in basenames:
+ print 'The "pip-requirements.txt" file has changed.'
+ print 'Rebuilding virtualenv ...'
+ return True
+
+ if 'mesos.bash_completion' in basenames:
+ print 'The "mesos.bash_completion" file has changed.'
+ print 'Rebuilding virtualenv ...'
+ return True
+
+ return False
+
+ def __build_virtualenv(self):
+ '''
+ Rebuild the virtualenv.
+ '''
+ cli_dir = os.path.abspath(self.source_dirs[0])
+
+ p = subprocess.Popen(
+ [os.path.join(cli_dir, 'bootstrap')],
+ stdout=subprocess.PIPE)
+
+ output = ''
+ for line in p.stdout:
+ output += line
+
+ p.wait()
+
+ if p.returncode != 0:
+ sys.stderr.write(output)
+ sys.exit(1);
+
+ def main(self, file_list):
+ '''
+ Override main to rebuild our virtualenv if necessary.
+ '''
+ if self.__should_build_virtualenv(file_list):
+ self.__build_virtualenv()
+
+ return super(PyLinter, self).main(file_list)
+
if __name__ == '__main__':
cpp_linter = CppLinter()
[3/6] mesos git commit: Updated CLI pylint configuration to allow 0
public methods.
Posted by kl...@apache.org.
Updated CLI pylint configuration to allow 0 public methods.
Review: https://reviews.apache.org/r/52941/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/03a6c9c9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/03a6c9c9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/03a6c9c9
Branch: refs/heads/master
Commit: 03a6c9c9a0d9733eb7964e9833df3328c48a14a4
Parents: 9f337b2
Author: Kevin Klues <kl...@gmail.com>
Authored: Wed Mar 15 15:47:37 2017 -0700
Committer: Kevin Klues <kl...@gmail.com>
Committed: Wed Mar 15 15:47:37 2017 -0700
----------------------------------------------------------------------
src/cli_new/pylint.config | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/03a6c9c9/src/cli_new/pylint.config
----------------------------------------------------------------------
diff --git a/src/cli_new/pylint.config b/src/cli_new/pylint.config
index fbd51ab..fc5819d 100644
--- a/src/cli_new/pylint.config
+++ b/src/cli_new/pylint.config
@@ -10,6 +10,7 @@ reports=no
[BASIC]
bad-functions=input,file
good-names=i,j,k,f,ip,_
+min-public-methods=0
[FORMAT]
max-line-length=80
[4/6] mesos git commit: Updated CLI pylint configuration to ignore
the 'netifaces' module.
Posted by kl...@apache.org.
Updated CLI pylint configuration to ignore the 'netifaces' module.
Review: https://reviews.apache.org/r/52942/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/b3db4ad6
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/b3db4ad6
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/b3db4ad6
Branch: refs/heads/master
Commit: b3db4ad63e0123e27195e0e499ee965277773d3f
Parents: 03a6c9c
Author: Kevin Klues <kl...@gmail.com>
Authored: Wed Mar 15 15:47:41 2017 -0700
Committer: Kevin Klues <kl...@gmail.com>
Committed: Wed Mar 15 15:47:41 2017 -0700
----------------------------------------------------------------------
src/cli_new/pylint.config | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/b3db4ad6/src/cli_new/pylint.config
----------------------------------------------------------------------
diff --git a/src/cli_new/pylint.config b/src/cli_new/pylint.config
index fc5819d..4303825 100644
--- a/src/cli_new/pylint.config
+++ b/src/cli_new/pylint.config
@@ -21,3 +21,6 @@ max-returns=100
[EXCEPTIONS]
overgeneral-exceptions=
+
+[TYPECHECK]
+ignored-modules = netifaces
[5/6] mesos git commit: Updated CLI pylint configuration to disable
no-self-use warnings.
Posted by kl...@apache.org.
Updated CLI pylint configuration to disable no-self-use warnings.
Review: https://reviews.apache.org/r/52943/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/90a7d1c8
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/90a7d1c8
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/90a7d1c8
Branch: refs/heads/master
Commit: 90a7d1c8a4ada3c3cfee32a6951bf7a9664149dd
Parents: b3db4ad
Author: Kevin Klues <kl...@gmail.com>
Authored: Wed Mar 15 15:47:44 2017 -0700
Committer: Kevin Klues <kl...@gmail.com>
Committed: Wed Mar 15 15:47:44 2017 -0700
----------------------------------------------------------------------
src/cli_new/pylint.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/90a7d1c8/src/cli_new/pylint.config
----------------------------------------------------------------------
diff --git a/src/cli_new/pylint.config b/src/cli_new/pylint.config
index 4303825..3da4ebd 100644
--- a/src/cli_new/pylint.config
+++ b/src/cli_new/pylint.config
@@ -2,7 +2,7 @@
ignore=.git
[MESSAGES CONTROL]
-disable=I0011
+disable=I0011,no-self-use
[REPORTS]
reports=no
[2/6] mesos git commit: Updated CLI pylint configuration to add 'ip'
to the list of good-names.
Posted by kl...@apache.org.
Updated CLI pylint configuration to add 'ip' to the list of good-names.
Review: https://reviews.apache.org/r/52939/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9f337b2f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9f337b2f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9f337b2f
Branch: refs/heads/master
Commit: 9f337b2f3e358b33bd1dc84083a8838277e6a8ab
Parents: a97b658
Author: Kevin Klues <kl...@gmail.com>
Authored: Wed Mar 15 15:47:34 2017 -0700
Committer: Kevin Klues <kl...@gmail.com>
Committed: Wed Mar 15 15:47:34 2017 -0700
----------------------------------------------------------------------
src/cli_new/pylint.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9f337b2f/src/cli_new/pylint.config
----------------------------------------------------------------------
diff --git a/src/cli_new/pylint.config b/src/cli_new/pylint.config
index c398220..fbd51ab 100644
--- a/src/cli_new/pylint.config
+++ b/src/cli_new/pylint.config
@@ -9,7 +9,7 @@ reports=no
[BASIC]
bad-functions=input,file
-good-names=i,j,k,f,_
+good-names=i,j,k,f,ip,_
[FORMAT]
max-line-length=80
[6/6] mesos git commit: Updated CLI pylint configuration to disable
'fixme' warnings.
Posted by kl...@apache.org.
Updated CLI pylint configuration to disable 'fixme' warnings.
Review: https://reviews.apache.org/r/52944/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a9bd7078
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a9bd7078
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a9bd7078
Branch: refs/heads/master
Commit: a9bd7078e155d67a1c4777396d44f04e5e05b81c
Parents: 90a7d1c
Author: Kevin Klues <kl...@gmail.com>
Authored: Wed Mar 15 15:47:48 2017 -0700
Committer: Kevin Klues <kl...@gmail.com>
Committed: Wed Mar 15 15:47:48 2017 -0700
----------------------------------------------------------------------
src/cli_new/pylint.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/a9bd7078/src/cli_new/pylint.config
----------------------------------------------------------------------
diff --git a/src/cli_new/pylint.config b/src/cli_new/pylint.config
index 3da4ebd..63fbb94 100644
--- a/src/cli_new/pylint.config
+++ b/src/cli_new/pylint.config
@@ -2,7 +2,7 @@
ignore=.git
[MESSAGES CONTROL]
-disable=I0011,no-self-use
+disable=I0011,no-self-use,fixme
[REPORTS]
reports=no