Skip to content

Commit

Permalink
remove scripts from the dist
Browse files Browse the repository at this point in the history
scripts are not portable and deprecated.
We rather use the console_scripts entrypoint which is nice a portable
  • Loading branch information
tardyp committed Sep 28, 2016
1 parent 45b3d5a commit b86f7c9
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 83 deletions.
4 changes: 0 additions & 4 deletions master/bin/buildbot

This file was deleted.

Expand Up @@ -9,23 +9,23 @@
# is working as expected.
#
# * Install the buildbot service. Execute the command:
# % python buildbot_service.py
# % buildbot_windows_service
# To see installation options. You probably want to specify:
# + --username and --password options to specify the user to run the
# + --startup auto to have the service start at boot time.
#
# For example:
# % python buildbot_service.py --user mark --password secret \
# % buildbot_windows_service --user mark --password secret \
# --startup auto install
# Alternatively, you could execute:
# % python buildbot_service.py install
# % buildbot_windows_service install
# to install the service with default options, then use Control Panel
# to configure it.
#
# * Start the service specifying the name of all buildbot directories as
# service args. This can be done one of 2 ways:
# - Execute the command:
# % python buildbot_service.py start "dir_name1" "dir_name2"
# % buildbot_windows_service start "dir_name1" "dir_name2"
# or:
# - Start Control Panel->Administrative Tools->Services
# - Locate the previously installed buildbot service.
Expand All @@ -46,7 +46,7 @@
# * If you change the buildbot configuration, you must restart the service.
# There is currently no way to ask a running buildbot to reload the
# config. You can restart by executing:
# % python buildbot_service.py restart
# % buildbot_windows_service restart
#
# Troubleshooting:
# * Check the Windows event log for any errors.
Expand Down
22 changes: 0 additions & 22 deletions master/contrib/windows/buildbot.bat

This file was deleted.

25 changes: 15 additions & 10 deletions master/setup.py
Expand Up @@ -103,6 +103,13 @@ def define_plugin_entry(name, module_name):
return '%s = %s:%s' % (entry, module_name, name)


def concat_dicts(*dicts):
result = dict()
for d in dicts:
result.update(d)
return result


def define_plugin_entries(groups):
"""
helper to all groups for plugins
Expand All @@ -122,13 +129,6 @@ def define_plugin_entries(groups):
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as long_d_f:
long_description = long_d_f.read()

scripts = ["bin/buildbot"]
# sdist is usually run on a non-Windows platform, but the buildslave.bat file
# still needs to get packaged.
if 'sdist' in sys.argv or sys.platform == 'win32':
scripts.append("contrib/windows/buildbot.bat")
scripts.append("contrib/windows/buildbot_service.py")

setup_args = {
'name': "buildbot",
'version': version,
Expand Down Expand Up @@ -207,10 +207,9 @@ def define_plugin_entries(groups):
include("buildbot/spec", "*.raml"),
include("buildbot/spec/types", "*.raml"),
] + include_statics("buildbot/www/static"),
'scripts': scripts,
'cmdclass': {'install_data': install_data_twisted,
'sdist': our_sdist},
'entry_points': define_plugin_entries([
'entry_points': concat_dicts(define_plugin_entries([
('buildbot.changes', [
('buildbot.changes.mail', [
'MaildirSource', 'CVSMaildirSource',
Expand Down Expand Up @@ -373,7 +372,13 @@ def define_plugin_entries(groups):
'AnyEndpointMatcher', 'StopBuildEndpointMatcher', 'ForceBuildEndpointMatcher',
'RebuildBuildEndpointMatcher']),
])
])
]), {
'console_scripts': [
'buildbot=buildbot.scripts.runner:run',
# this will also be shipped on non windows :-(
'buildbot_windows_service=buildbot.scripts.windows_service:HandleCommandLine',
]}
)
}

# set zip_safe to false to force Windows installs to always unpack eggs
Expand Down
4 changes: 0 additions & 4 deletions worker/bin/buildbot-worker

This file was deleted.

Expand Up @@ -9,23 +9,23 @@
# is working as expected.
#
# * Install the buildbot service. Execute the command:
# % python buildbot_service.py
# % buildbot_worker_windows_service
# To see installation options. You probably want to specify:
# + --username and --password options to specify the user to run the
# + --startup auto to have the service start at boot time.
#
# For example:
# % python buildbot_service.py --user mark --password secret \
# % buildbot_worker_windows_service --user mark --password secret \
# --startup auto install
# Alternatively, you could execute:
# % python buildbot_service.py install
# % buildbot_worker_windows_service install
# to install the service with default options, then use Control Panel
# to configure it.
#
# * Start the service specifying the name of all buildbot directories as
# service args. This can be done one of 2 ways:
# - Execute the command:
# % python buildbot_service.py start "dir_name1" "dir_name2"
# % buildbot_worker_windows_service start "dir_name1" "dir_name2"
# or:
# - Start Control Panel->Administrative Tools->Services
# - Locate the previously installed buildbot service.
Expand All @@ -46,14 +46,14 @@
# * If you change the buildbot configuration, you must restart the service.
# There is currently no way to ask a running buildbot to reload the
# config. You can restart by executing:
# % python buildbot_service.py restart
# % buildbot_worker_windows_service restart
#
# Troubleshooting:
# * Check the Windows event log for any errors.
# * Check the "twistd.log" file in your buildbot directories - once each
# bot has been started it just writes to this log as normal.
# * Try executing:
# % python buildbot_service.py debug
# % buildbot_windows_service debug
# This will execute the buildbot service in "debug" mode, and allow you to
# see all messages etc generated. If the service works in debug mode but
# not as a real service, the error probably relates to the environment or
Expand Down Expand Up @@ -522,7 +522,7 @@ def _WaitForShutdown(h):


def DetermineRunner(bbdir):
'''Checks if the given directory is a buildbot worker or a master and
'''Checks if the given directory is a buildbot worker or a master and
returns the appropriate run function.'''
try:
import buildbot_worker.scripts.runner
Expand Down
22 changes: 0 additions & 22 deletions worker/contrib/windows/buildbot-worker.bat

This file was deleted.

16 changes: 7 additions & 9 deletions worker/setup.py
Expand Up @@ -27,13 +27,6 @@

from buildbot_worker import version

scripts = ["bin/buildbot-worker"]
# sdist is usually run on a non-Windows platform, but the buildbot-worker.bat
# file still needs to get packaged.
if 'sdist' in sys.argv or sys.platform == 'win32':
scripts.append("contrib/windows/buildbot-worker.bat")
scripts.append("contrib/windows/buildbot_service.py")


class our_install_data(install_data):

Expand Down Expand Up @@ -97,14 +90,19 @@ def make_release_tree(self, base_dir, files):
"buildbot_worker.test.util",
"buildbot_worker.test.unit",
],
'scripts': scripts,
# mention data_files, even if empty, so install_data is called and
# VERSION gets copied
'data_files': [("buildbot_worker", [])],
'cmdclass': {
'install_data': our_install_data,
'sdist': our_sdist
}
},
'entry_points': {
'console_scripts': [
'buildbot_worker=buildbot_worker.scripts.runner:run',
# this will also be shipped on non windows :-(
'buildbot_worker_windows_service=buildbot_worker.scripts.windows_service:HandleCommandLine',
]}
}

# set zip_safe to false to force Windows installs to always unpack eggs
Expand Down

0 comments on commit b86f7c9

Please sign in to comment.