From 5fec367b970d0ff2f6b547d999c49faf7422f970 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Mon, 13 Jun 2016 18:52:02 -0700 Subject: [PATCH] OS X -> macOS --- CONTRIBUTING.rst | 25 +++++++++++-------- MANIFEST.in | 2 +- celery/app/base.py | 2 +- celery/apps/worker.py | 10 ++++---- celery/concurrency/asynpool.py | 2 +- celery/platforms.py | 4 +-- celery/tests/bin/test_worker.py | 12 ++++----- docs/contributing.rst | 7 +++--- docs/getting-started/brokers/rabbitmq.rst | 18 ++++++------- docs/history/changelog-1.0.rst | 4 +-- docs/history/changelog-2.0.rst | 8 +++--- docs/history/changelog-3.1.rst | 2 +- docs/history/whatsnew-2.5.rst | 2 +- docs/sec/CELERYSA-0001.txt | 2 +- docs/tutorials/daemonizing.rst | 10 ++++---- docs/userguide/workers.rst | 4 +-- docs/whatsnew-3.1.rst | 2 +- extra/{osx => macOS}/org.celeryq.beat.plist | 0 extra/{osx => macOS}/org.celeryq.worker.plist | 0 19 files changed, 60 insertions(+), 56 deletions(-) rename extra/{osx => macOS}/org.celeryq.beat.plist (100%) rename extra/{osx => macOS}/org.celeryq.worker.plist (100%) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f4b977db557..a6f08c95d0a 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -198,7 +198,7 @@ spelling or other errors on the website/docs/code. A) If the error is from a Python traceback, include it in the bug report. - B) We also need to know what platform you're running (Windows, OS X, Linux, + B) We also need to know what platform you're running (Windows, macOS, Linux, etc.), the version of your Python interpreter, and the version of Celery, and related packages that you were running when the bug occurred. @@ -209,8 +209,9 @@ spelling or other errors on the website/docs/code. * Enable celery's ``breakpoint_signal`` and use it to inspect the process's state. This will allow you to open a ``pdb`` session. - * Collect tracing data using `strace`_(Linux), ``dtruss`` (OSX), - and ``ktrace`` (BSD), `ltrace`_ and `lsof`_. + * Collect tracing data using `strace`_(Linux), + ``dtruss`` (macOS), and ``ktrace`` (BSD), + `ltrace`_ and `lsof`_. D) Include the output from the ``celery report`` command: :: @@ -349,17 +350,17 @@ An archived version is named ``X.Y-archived``. Our currently archived branches are: -* 2.5-archived +* ``2.5-archived`` -* 2.4-archived +* ``2.4-archived`` -* 2.3-archived +* ``2.3-archived`` -* 2.1-archived +* ``2.1-archived`` -* 2.0-archived +* ``2.0-archived`` -* 1.0-archived +* ``1.0-archived`` Feature branches ---------------- @@ -737,7 +738,7 @@ is following the conventions. from .five import zip_longest, items, range from .utils import timeutils -* Wildcard imports must not be used (`from xxx import *`). +* Wild-card imports must not be used (`from xxx import *`). * For distributions where Python 2.5 is the oldest support version additional rules apply: @@ -789,13 +790,15 @@ that require third-party libraries must be added. 1) Add a new requirements file in `requirements/extras` E.g. for the Cassandra backend this is - ``requirements/extras/cassandra.txt``, and the file looks like this:: + ``requirements/extras/cassandra.txt``, and the file looks like this: + :: pycassa These are pip requirement files so you can have version specifiers and multiple packages are separated by newline. A more complex example could be: + :: # pycassa 2.0 breaks Foo pycassa>=1.0,<2.0 diff --git a/MANIFEST.in b/MANIFEST.in index a22ec5d8fff..e9d7824b9c8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,7 +11,7 @@ recursive-include docs * recursive-include extra/bash-completion * recursive-include extra/centos * recursive-include extra/generic-init.d * -recursive-include extra/osx * +recursive-include extra/macOS * recursive-include extra/supervisord * recursive-include extra/systemd * recursive-include extra/zsh-completion * diff --git a/celery/app/base.py b/celery/app/base.py index 050c320b022..609808f8506 100644 --- a/celery/app/base.py +++ b/celery/app/base.py @@ -141,7 +141,7 @@ class Celery(object): Pickler = AppPickler SYSTEM = platforms.SYSTEM - IS_OSX, IS_WINDOWS = platforms.IS_OSX, platforms.IS_WINDOWS + IS_macOS, IS_WINDOWS = platforms.IS_macOS, platforms.IS_WINDOWS #: Name of the `__main__` module. Required for standalone scripts. #: diff --git a/celery/apps/worker.py b/celery/apps/worker.py index e68e3ee5ae6..5cb99b42e59 100644 --- a/celery/apps/worker.py +++ b/celery/apps/worker.py @@ -223,16 +223,16 @@ def startup_info(self): def install_platform_tweaks(self, worker): """Install platform specific tweaks and workarounds.""" - if self.app.IS_OSX: - self.osx_proxy_detection_workaround() + if self.app.IS_macOS: + self.macOS_proxy_detection_workaround() # Install signal handler so SIGHUP restarts the worker. if not self._isatty: # only install HUP handler if detached from terminal, # so closing the terminal window doesn't restart the worker # into the background. - if self.app.IS_OSX: - # OS X can't exec from a process using threads. + if self.app.IS_macOS: + # macOS can't exec from a process using threads. # See https://github.com/celery/celery/issues#issue/152 install_HUP_not_supported_handler(worker) else: @@ -243,7 +243,7 @@ def install_platform_tweaks(self, worker): install_cry_handler() install_rdb_handler() - def osx_proxy_detection_workaround(self): + def macOS_proxy_detection_workaround(self): """See https://github.com/celery/celery/issues#issue/161""" os.environ.setdefault('celery_dummy_proxy', 'set_by_celeryd') diff --git a/celery/concurrency/asynpool.py b/celery/concurrency/asynpool.py index a09f6305242..208c7c5e8d7 100644 --- a/celery/concurrency/asynpool.py +++ b/celery/concurrency/asynpool.py @@ -745,7 +745,7 @@ def schedule_writes(ready_fds, total_write_count=[0]): # using `total_writes % ready_fds` is about 30% faster # with many processes, and also leans more towards fairness # in write stats when used with many processes - # [XXX On OS X, this may vary depending + # [XXX On macOS, this may vary depending # on event loop implementation (i.e select vs epoll), so # have to test further] num_ready = len(ready_fds) diff --git a/celery/platforms.py b/celery/platforms.py index 7c1dc4e4095..b08647c2941 100644 --- a/celery/platforms.py +++ b/celery/platforms.py @@ -42,7 +42,7 @@ mputil = try_import('multiprocessing.util') __all__ = ['EX_OK', 'EX_FAILURE', 'EX_UNAVAILABLE', 'EX_USAGE', 'SYSTEM', - 'IS_OSX', 'IS_WINDOWS', 'pyimplementation', 'LockFailed', + 'IS_macOS', 'IS_WINDOWS', 'pyimplementation', 'LockFailed', 'get_fdmax', 'Pidfile', 'create_pidlock', 'close_open_fds', 'DaemonContext', 'detached', 'parse_uid', 'parse_gid', 'setgroups', 'initgroups', 'setgid', 'setuid', @@ -58,7 +58,7 @@ EX_CANTCREAT = getattr(os, 'EX_CANTCREAT', 73) SYSTEM = _platform.system() -IS_OSX = SYSTEM == 'Darwin' +IS_macOS = SYSTEM == 'Darwin' IS_WINDOWS = SYSTEM == 'Windows' DAEMON_WORKDIR = '/' diff --git a/celery/tests/bin/test_worker.py b/celery/tests/bin/test_worker.py index 0fafc03754d..0e744955b9b 100644 --- a/celery/tests/bin/test_worker.py +++ b/celery/tests/bin/test_worker.py @@ -320,15 +320,15 @@ def on_logging_setup(**kwargs): signals.setup_logging.disconnect(on_logging_setup) @mock.stdouts - def test_platform_tweaks_osx(self, stdout, stderr): + def test_platform_tweaks_macOS(self, stdout, stderr): - class OSXWorker(Worker): + class macOSWorker(Worker): proxy_workaround_installed = False - def osx_proxy_detection_workaround(self): + def macOS_proxy_detection_workaround(self): self.proxy_workaround_installed = True - worker = OSXWorker(app=self.app, redirect_stdouts=False) + worker = macOSWorker(app=self.app, redirect_stdouts=False) def install_HUP_nosupport(controller): controller.hup_not_supported_installed = True @@ -339,7 +339,7 @@ class Controller(object): prev = cd.install_HUP_not_supported_handler cd.install_HUP_not_supported_handler = install_HUP_nosupport try: - worker.app.IS_OSX = True + worker.app.IS_macOS = True controller = Controller() worker.install_platform_tweaks(controller) self.assertTrue(controller.hup_not_supported_installed) @@ -362,7 +362,7 @@ class Controller(object): cd.install_worker_restart_handler = install_worker_restart_handler try: worker = self.Worker(app=self.app) - worker.app.IS_OSX = False + worker.app.IS_macOS = False worker.install_platform_tweaks(Controller()) self.assertTrue(restart_worker_handler_installed[0]) finally: diff --git a/docs/contributing.rst b/docs/contributing.rst index e3e83daa05b..8f4edbcd689 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -198,7 +198,7 @@ spelling or other errors on the website/docs/code. A) If the error is from a Python traceback, include it in the bug report. - B) We also need to know what platform you're running (Windows, OS X, Linux, + B) We also need to know what platform you're running (Windows, macOS, Linux, etc.), the version of your Python interpreter, and the version of Celery, and related packages that you were running when the bug occurred. @@ -209,8 +209,9 @@ spelling or other errors on the website/docs/code. * Enable celery's :ref:`breakpoint signal ` and use it to inspect the process's state. This will allow you to open a :mod:`pdb` session. - * Collect tracing data using `strace`_(Linux), :command:`dtruss` (OSX), - and :command:`ktrace` (BSD), `ltrace`_ and `lsof`_. + * Collect tracing data using `strace`_(Linux), + :command:`dtruss` (macOS), and :command:`ktrace` (BSD), + `ltrace`_ and `lsof`_. D) Include the output from the :command:`celery report` command: diff --git a/docs/getting-started/brokers/rabbitmq.rst b/docs/getting-started/brokers/rabbitmq.rst index 3a919346bde..b18f71e8daf 100644 --- a/docs/getting-started/brokers/rabbitmq.rst +++ b/docs/getting-started/brokers/rabbitmq.rst @@ -27,8 +27,8 @@ see :ref:`conf-broker-settings`. Installing the RabbitMQ Server ============================== -See `Installing RabbitMQ`_ over at RabbitMQ's website. For Mac OS X -see `Installing RabbitMQ on OS X`_. +See `Installing RabbitMQ`_ over at RabbitMQ's website. For macOS +see `Installing RabbitMQ on macOS`_. .. _`Installing RabbitMQ`: http://www.rabbitmq.com/install.html @@ -70,13 +70,13 @@ See the RabbitMQ `Admin Guide`_ for more information about `access control`_. .. _`access control`: http://www.rabbitmq.com/admin-guide.html#access-control -.. _rabbitmq-osx-installation: +.. _rabbitmq-macOS-installation: -Installing RabbitMQ on OS X ---------------------------- +Installing RabbitMQ on macOS +---------------------------- -The easiest way to install RabbitMQ on OS X is using `Homebrew`_ the new and -shiny package management system for OS X. +The easiest way to install RabbitMQ on macOS is using `Homebrew`_ the new and +shiny package management system for macOS. First, install Homebrew using the one-line command provided by the `Homebrew documentation`_: @@ -94,7 +94,7 @@ Finally, we can install RabbitMQ using :command:`brew`: .. _`Homebrew`: https://github.com/mxcl/homebrew/ .. _`Homebrew documentation`: https://github.com/Homebrew/homebrew/wiki/Installation -.. _rabbitmq-osx-system-hostname: +.. _rabbitmq-macOS-system-hostname: After you've installed RabbitMQ with :command:`brew` you need to add the following to your path to be able to start and stop the broker: add it to the start-up file for your @@ -143,7 +143,7 @@ This is especially important if your DHCP server gives you a host name starting with an IP address, (e.g. `23.10.112.31.comcast.net`), because then RabbitMQ will try to use `rabbit@23`, which is an illegal host name. -.. _rabbitmq-osx-start-stop: +.. _rabbitmq-macOS-start-stop: Starting/Stopping the RabbitMQ server ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/history/changelog-1.0.rst b/docs/history/changelog-1.0.rst index 556bd30d81c..dae467b347b 100644 --- a/docs/history/changelog-1.0.rst +++ b/docs/history/changelog-1.0.rst @@ -646,7 +646,7 @@ Backward incompatible changes `extra/debian/init.d/celeryd` `extra/debian/init.d/celerybeat` - * Mac OS X :command:`launchd` + * macOS :command:`launchd` `extra/mac/org.celeryq.celeryd.plist` `extra/mac/org.celeryq.celerybeat.plist` @@ -967,7 +967,7 @@ Documentation * Now emits a warning if the --detach argument is used. --detach should not be used anymore, as it has several not easily fixed bugs related to it. Instead, use something like start-stop-daemon, - :pypi:`supervisor` or :command:`launchd` (os x). + :pypi:`supervisor` or :command:`launchd` (macOS). * Make sure logger class is process aware, even if running Python >= 2.6. diff --git a/docs/history/changelog-2.0.rst b/docs/history/changelog-2.0.rst index c89c37ce23d..1fd6e887bd8 100644 --- a/docs/history/changelog-2.0.rst +++ b/docs/history/changelog-2.0.rst @@ -86,11 +86,11 @@ Fixes See issue #160. -* Worker: On OS X it is not possible to run `os.exec*` in a process +* Worker: On macOS it is not possible to run `os.exec*` in a process that is threaded. This breaks the SIGHUP restart handler, - and is now disabled on OS X, emitting a warning instead. + and is now disabled on macOS, emitting a warning instead. See issue #152. @@ -99,8 +99,8 @@ Fixes See issue #175. -* Using urllib2 in a periodic task on OS X crashed because - of the proxy auto detection used in OS X. +* Using urllib2 in a periodic task on macOS crashed because + of the proxy auto detection used in macOS. This is now fixed by using a workaround. See issue #143. diff --git a/docs/history/changelog-3.1.rst b/docs/history/changelog-3.1.rst index ba354f40a31..0e6a2fb7545 100644 --- a/docs/history/changelog-3.1.rst +++ b/docs/history/changelog-3.1.rst @@ -1095,7 +1095,7 @@ News - **Commands:** The output of the event dump utility (:program:`celery events -d`) can now be piped into other commands. -- **Documentation:** The RabbitMQ installation instructions for OS X was +- **Documentation:** The RabbitMQ installation instructions for macOS was updated to use modern Homebrew practices. Contributed by Jon Chen. diff --git a/docs/history/whatsnew-2.5.rst b/docs/history/whatsnew-2.5.rst index a72f2fe720d..cd2c74eee37 100644 --- a/docs/history/whatsnew-2.5.rst +++ b/docs/history/whatsnew-2.5.rst @@ -246,7 +246,7 @@ implementations: $ pip install pyinotify -* ``kqueue`` (OS X/BSD) +* ``kqueue`` (macOS/BSD) * ``stat`` diff --git a/docs/sec/CELERYSA-0001.txt b/docs/sec/CELERYSA-0001.txt index 760b4f833ca..b3a1dcdcc53 100644 --- a/docs/sec/CELERYSA-0001.txt +++ b/docs/sec/CELERYSA-0001.txt @@ -51,7 +51,7 @@ as the root user, using either: CELERYD_USER or CELERYD_GROUP defined, are affected. -Users using the Debian init-scripts, CentOS init-scripts, OS X launchctl +Users using the Debian init-scripts, CentOS init-scripts, macOS launchctl scripts, Supervisor, or users not starting the programs as the root user are *not* affected. diff --git a/docs/tutorials/daemonizing.rst b/docs/tutorials/daemonizing.rst index 12da53c41ac..e53f346c2fa 100644 --- a/docs/tutorials/daemonizing.rst +++ b/docs/tutorials/daemonizing.rst @@ -504,17 +504,17 @@ or production environment (inadvertently) as root. * `extra/supervisord/`_ .. _`extra/supervisord/`: - https://github.com/celery/celery/tree/3.1/extra/supervisord/ + https://github.com/celery/celery/tree/master/extra/supervisord/ .. _daemon-launchd: -``launchd`` (OS X) +``launchd`` (macOS) ====================================================================== -* `extra/osx`_ +* `extra/macOS`_ -.. _`extra/osx`: - https://github.com/celery/celery/tree/3.1/extra/osx/ +.. _`extra/macOS`: + https://github.com/celery/celery/tree/master/extra/macOS/ .. _daemon-windows: diff --git a/docs/userguide/workers.rst b/docs/userguide/workers.rst index e984a1fdd90..0752e5092bf 100644 --- a/docs/userguide/workers.rst +++ b/docs/userguide/workers.rst @@ -117,7 +117,7 @@ is not recommended in production: in the background as a daemon (it does not have a controlling terminal). - :sig:`HUP` is disabled on OS X because of a limitation on + :sig:`HUP` is disabled on macOS because of a limitation on that platform. @@ -772,7 +772,7 @@ implementations: $ pip install pyinotify -* ``kqueue`` (OS X/BSD) +* ``kqueue`` (macOS/BSD) * ``stat`` diff --git a/docs/whatsnew-3.1.rst b/docs/whatsnew-3.1.rst index 4a0d62bdb02..8020ce6b5a7 100644 --- a/docs/whatsnew-3.1.rst +++ b/docs/whatsnew-3.1.rst @@ -758,7 +758,7 @@ In Other News A monotonic clock is now used for timeouts and scheduling. The monotonic clock function is built-in starting from Python 3.4, - but we also have fallback implementations for Linux and OS X. + but we also have fallback implementations for Linux and macOS. - :program:`celery worker` now supports a new :option:`--detach ` argument to start diff --git a/extra/osx/org.celeryq.beat.plist b/extra/macOS/org.celeryq.beat.plist similarity index 100% rename from extra/osx/org.celeryq.beat.plist rename to extra/macOS/org.celeryq.beat.plist diff --git a/extra/osx/org.celeryq.worker.plist b/extra/macOS/org.celeryq.worker.plist similarity index 100% rename from extra/osx/org.celeryq.worker.plist rename to extra/macOS/org.celeryq.worker.plist