Skip to content

Commit cf2148e

Browse files
westurnerAsk Solem
authored andcommitted
Use console_scripts entry_points in the setup.py file
1 parent 3e57f99 commit cf2148e

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

celery/bin/celerybeat.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ def parse_options(arguments):
176176
options, values = parser.parse_args(arguments)
177177
return options
178178

179-
180-
if __name__ == "__main__":
179+
def main():
181180
options = parse_options(sys.argv[1:])
182181
run_clockservice(**vars(options))
182+
183+
if __name__ == "__main__":
184+
main()

celery/bin/celeryd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ def set_process_status(info):
275275
info = "%s (%s)" % (info, " ".join(sys.argv[arg_start:]))
276276
platform.set_mp_process_title("celeryd", info=info)
277277

278-
279-
if __name__ == "__main__":
278+
def main():
280279
options = parse_options(sys.argv[1:])
281280
run_worker(**vars(options))
281+
282+
if __name__ == "__main__":
283+
main()

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,12 @@ def run(self):
130130
"Topic :: System :: Distributed Computing",
131131
"Topic :: Software Development :: Libraries :: Python Modules",
132132
],
133+
entry_points={
134+
'console_scripts': [
135+
'celeryd = celery.bin.celeryd:main',
136+
'celeryinit = celery.bin.celeryinit:main',
137+
'celerybeat = celery.bin.celerybeat:main'
138+
]
139+
},
133140
long_description=long_description,
134141
)

0 commit comments

Comments
 (0)