Skip to content

Commit

Permalink
Remove shebang from Python modules
Browse files Browse the repository at this point in the history
This patch removes the shebang line from all Python modules.

For executable scripts, the shebang is best provided by distro
packaging and/or by console_scripts.

Closes #351

Change-Id: I0024b785b018dc362b148dee3006e5d1bae15587
  • Loading branch information
thiell committed Aug 26, 2017
1 parent b8bb118 commit bad76b9
Show file tree
Hide file tree
Showing 52 changed files with 43 additions and 110 deletions.
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/Clubak.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2012 CEA/DAM
# Copyright (C) 2017 Stephane Thiell <sthiell@stanford.edu>
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/Clush.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2007-2016 CEA/DAM
# Copyright (C) 2015-2017 Stephane Thiell <sthiell@stanford.edu>
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/Config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2016 CEA/DAM
# Copyright (C) 2017 Stephane Thiell <sthiell@stanford.edu>
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/Display.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2015 CEA/DAM
#
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/Error.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2012 CEA/DAM
#
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/Nodeset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2008-2016 CEA/DAM
# Copyright (C) 2015-2017 Stephane Thiell <sthiell@stanford.edu>
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/OptionParser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2015 CEA/DAM
#
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/CLI/Utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2015 CEA/DAM
#
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/Communication.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2016 CEA/DAM
# Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr>
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/Gateway.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2016 CEA/DAM
# Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr>
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/Propagation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2016 CEA/DAM
# Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr>
Expand Down
1 change: 0 additions & 1 deletion lib/ClusterShell/Topology.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2010-2016 CEA/DAM
# Copyright (C) 2010-2011 Henri Doreau <henri.doreau@cea.fr>
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
#
# Copyright (C) 2008-2016 CEA/DAM
# Copyright (C) 2016-2017 Stephane Thiell <sthiell@stanford.edu>
Expand Down
4 changes: 1 addition & 3 deletions tests/CLIClubakTest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python
# ClusterShell.CLI.Clubak test suite
# Written by S. Thiell


"""Unit test for CLI/Clubak.py"""
"""Unit test for CLI.Clubak"""

import re
from textwrap import dedent
Expand Down
8 changes: 4 additions & 4 deletions tests/CLIClushTest.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env python
# ClusterShell.CLI.Clush test suite
# Written by S. Thiell


"""Unit test for CLI/Clush.py"""
"""Unit test for CLI.Clush"""

import codecs
import errno
import os
from os.path import basename
import pwd
import re
import signal
Expand Down Expand Up @@ -367,7 +366,8 @@ def run(self):
kth = KillerThread()
args = ["-w", HOSTNAME, "--worker=exec", "-q", "--nostdin", "-b",
"echo start; sleep 10"]
process = Popen(["../lib/ClusterShell/CLI/Clush.py"] + args,
python_exec = basename(sys.executable or 'python')
process = Popen([python_exec, '-m', 'ClusterShell.CLI.Clush'] + args,
stderr=PIPE, stdout=PIPE, bufsize=0)
kth.pidkill = process.pid
kth.start()
Expand Down
2 changes: 0 additions & 2 deletions tests/CLIConfigTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell.CLI.Config test suite
# Written by S. Thiell


"""Unit test for CLI.Config"""

import resource
Expand Down
2 changes: 0 additions & 2 deletions tests/CLIDisplayTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell.CLI.Display test suite
# Written by S. Thiell


"""Unit test for CLI.Display"""

import os
Expand Down
4 changes: 1 addition & 3 deletions tests/CLINodesetTest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python
# ClusterShell.CLI.Nodeset test suite
# Written by S. Thiell


"""Unit test for CLI/Nodeset.py"""
"""Unit test for CLI.Nodeset"""

import random
from textwrap import dedent
Expand Down
2 changes: 0 additions & 2 deletions tests/CLIOptionParserTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell.CLI.OptionParser test suite
# Written by S. Thiell


"""Unit test for CLI.OptionParser"""

from optparse import OptionConflictError
Expand Down
4 changes: 1 addition & 3 deletions tests/DefaultsTest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python
# ClusterShell.Defaults test suite
# Written by S. Thiell


"""Unit test for ClusterShell Defaults module"""
"""Unit test for ClusterShell.Defaults"""

from textwrap import dedent
import sys
Expand Down
2 changes: 0 additions & 2 deletions tests/MisusageTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell test suite
# Written by S. Thiell


"""Unit test for ClusterShell common library misusages"""

import sys
Expand Down
2 changes: 0 additions & 2 deletions tests/MsgTreeTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell test suite
# Written by S. Thiell


"""Unit test for ClusterShell MsgTree Class"""

from operator import itemgetter
Expand Down
2 changes: 0 additions & 2 deletions tests/NodeSetErrorTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell.NodeSet.NodeSet error handling test suite
# Written by S. Thiell


"""Unit test for RangeSet errors"""

import sys
Expand Down
8 changes: 3 additions & 5 deletions tests/NodeSetGroupTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell.Node* test suite


"""Unit test for NodeSet with Group support"""
"""
Unit test for NodeSet with Group support
"""

import copy
import shutil
Expand Down
2 changes: 0 additions & 2 deletions tests/NodeSetTest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ClusterShell.NodeSet test suite
# Written by S. Thiell (first version in 2007)


"""Unit test for NodeSet"""

import binascii
Expand Down
9 changes: 3 additions & 6 deletions tests/RangeSetErrorTest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/usr/bin/env python
# ClusterShell.NodeSet.RangeSet error handling test suite
# Written by S. Thiell


"""Unit test for RangeSet errors"""
"""
Unit test for RangeSet errors
"""

import copy
import sys
Expand Down
2 changes: 0 additions & 2 deletions tests/RangeSetNDTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell.RangeSet.RangeSetND test suite
# Written by S. Thiell


"""Unit test for RangeSetND"""

import sys
Expand Down
2 changes: 0 additions & 2 deletions tests/RangeSetTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell.NodeSet.RangeSet test suite
# Written by S. Thiell


"""Unit test for RangeSet"""

import binascii
Expand Down
5 changes: 3 additions & 2 deletions tests/StreamWorkerTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# StreamWorker test suite
"""
Unit test for StreamWorker
"""

import os
import unittest
Expand Down
5 changes: 3 additions & 2 deletions tests/TLib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

"""Unit test small library"""
"""
Unit test library
"""

import os
import socket
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskDistantMixin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell (distant) test suite
# Written by S. Thiell


"""Unit test for ClusterShell Task (distant)"""

import copy
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskDistantPdshMixin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell (distant, pdsh worker) test suite
# Written by S. Thiell


"""Unit test for ClusterShell Task (distant, pdsh worker)"""

import shutil
Expand Down
7 changes: 3 additions & 4 deletions tests/TaskDistantPdshTest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python


"""Unit test for ClusterShell Task with all engines (pdsh distant worker)"""
"""
Unit test for ClusterShell Task with all engines (pdsh distant worker)
"""

import sys
import unittest
Expand Down
7 changes: 3 additions & 4 deletions tests/TaskDistantTest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python


"""Unit test for ClusterShell Task with all engines (distant worker)"""
"""
Unit test for ClusterShell Task with all engines (distant worker)
"""

import sys
import unittest
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskEventTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell (local) test suite
# Written by S. Thiell


"""Unit test for ClusterShell Task (event-based mode)"""

import copy
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskLocalMixin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell (local) test suite
# Written by S. Thiell


"""Unit test for ClusterShell Task (local)"""

import copy
Expand Down
7 changes: 3 additions & 4 deletions tests/TaskLocalTest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python


"""Unit test for ClusterShell Task with all engines (local worker)"""
"""
Unit test for ClusterShell Task with all engines (local worker)
"""

import sys
import unittest
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskMsgTreeTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell test suite
# Written by S. Thiell


"""Unit test for ClusterShell TaskMsgTree variants"""

import sys
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskPortTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell test suite
# Written by S. Thiell


"""Unit test for ClusterShell inter-Task msg"""

import pickle
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskRLimitsTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell task resource consumption/limits test suite
# Written by S. Thiell


"""Unit test for ClusterShell Task (resource limits)"""

import resource
Expand Down
8 changes: 4 additions & 4 deletions tests/TaskThreadJoinTest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env python
# ClusterShell test suite
# Written by S. Thiell 2010-01-16


"""Unit test for ClusterShell task's join feature in multithreaded
environments"""
"""
Unit test for ClusterShell task's join feature in multithreaded
environments
"""

import sys
import time
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskThreadSuspendTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell test suite
# Written by S. Thiell


"""Unit test for ClusterShell in multithreaded environments"""

import random
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskTimeoutTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell (local) test suite
# Written by S. Thiell


"""Unit test for ClusterShell Task/Worker timeout support"""

import copy
Expand Down
2 changes: 0 additions & 2 deletions tests/TaskTimerTest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env python
# ClusterShell timer test suite
# Written by S. Thiell


"""Unit test for ClusterShell Task's timer"""

import copy
Expand Down
5 changes: 3 additions & 2 deletions tests/TreeCopyTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# ClusterShell.Worker.WorkerTree copy test
"""
Unit test for ClusterShell.Worker.WorkerTree
"""

import logging
import unittest
Expand Down

0 comments on commit bad76b9

Please sign in to comment.