Skip to content

Commit

Permalink
Merge pull request #25 from depop/python-3-11
Browse files Browse the repository at this point in the history
Python 3.11 upgrade
  • Loading branch information
rob-parker-what authored Mar 29, 2023
2 parents 4152417 + 623b35a commit 0eb60f9
Show file tree
Hide file tree
Showing 27 changed files with 278 additions and 472 deletions.
123 changes: 0 additions & 123 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ tag:
git push --tags

test:
PYTHONPATH=. py.test -v -s --pdb tests/
PYTHONPATH=. py.test -v -s tests/
94 changes: 4 additions & 90 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
celery-message-consumer
=======================

|PyPI Version| |Build Status|
|PyPI Version|

.. |PyPI Version| image:: http://img.shields.io/pypi/v/celery-message-consumer.svg?style=flat
:target: https://pypi.python.org/pypi/celery-message-consumer/
:alt: Latest PyPI version

.. |Build Status| image:: https://circleci.com/gh/depop/celery-message-consumer.svg?style=shield&circle-token=a9ea2909c5cbc4cb32a87f50444ca79b99e3b09c
:alt: Build Status

Tool for using the ``bin/celery`` worker to consume vanilla AMQP
messages (i.e. not Celery tasks)

Expand Down Expand Up @@ -186,8 +183,6 @@ Briefly: for each routing key it listens to, the consumer sets up
Compatibility
-------------

Python 2.7 and 3.6-3.8 are both supported.

**Only** RabbitMQ transport is supported.

We depend on Celery and Kombu. Their versioning seems to be loosely in
Expand All @@ -198,38 +193,10 @@ Django is not required, but when used we have some extra integration
which is needed if your event handlers use the Django db connection.
This must be enabled if required via the ``settings.USE_DJANGO`` flag.

This project is tested against:

=========== ============ ============= ================== ==================
x Django 1.11 Django 2.2 Celery/Kombu 3.x Celery/Kombu 4.x
=========== ============ ============= ================== ==================
Python 2.7 * * *
Python 3.6 * * * *
Python 3.7 * * *
Python 3.8 * * *
=========== ============ ============= ================== ==================

Running the tests
-----------------

CircleCI
~~~~~~~~

| The easiest way to test the full version matrix is to install the
CircleCI command line app:
| https://circleci.com/docs/2.0/local-jobs/
| (requires Docker)
The cli does not support 'workflows' at the moment so you have to run
the two Python version jobs separately:

.. code:: bash
circleci build --job python-2.7
.. code:: bash
circleci build --job python-3.6

py.test (single combination of dependency versions)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -244,7 +211,7 @@ provided.
.. code:: bash
docker-compose up -d
export BROKER_HOST=$(docker-machine ip default)
export BROKER_HOST=0.0.0.0
(adjust the last line to suit your local Docker installation)

Expand All @@ -254,19 +221,12 @@ The ``rabbitmqadmin`` web UI is available to aid in debugging queue issues:
http://{BROKER_HOST}:15672/
Now decide which version combination from the matrix you're going to
test and set up your virtualenv accordingly:

.. code:: bash
pyenv virtualenv 3.6.2 celery-message-consumer
You will need to edit ``requirements.txt`` and ``requirements-test.txt``
for the specific versions of dependencies you want to test against. Then
You will need to create a virtualenv then
you can install everything via:

.. code:: bash
pyenv virtualenv 3.11.1 celery-message-consumer
pip install -r requirements-test.txt
Set an env to point to the target Django version's settings in the test
Expand All @@ -282,49 +242,3 @@ Now we can run the tests:
.. code:: bash
PYTHONPATH=. py.test -v -s --pdb tests/
tox (all version combinations for current Python)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You'll notice in the CircleCI config we run tests against the matrix
dependency versions using ``tox``.

There are `some warts <https://github.com/pyenv/pyenv-virtualenv/issues/202#issuecomment-339624649>`__
around using ``tox`` with ``pyenv-virtualenv`` so if you created a Python 3.6
virtualenv using the instructions above the best thing to do is delete it and
recreate it like this:

.. code:: bash
pyenv virtualenv -p python3.6 myenv
pip install tox
(it's actually easier not to use a virtualenv at all - tox creates its
own virtualenvs anyway, but that does mean you'd have to install tox
globally)

You need the Docker container running:

.. code:: bash
docker-compose up -d
export BROKER_HOST=$(docker-machine ip default)
You can now run tests for any versions compatible with your virtualenv
python version, e.g.

.. code:: bash
tox -e py36-dj111-cel4
To run the full version matrix you need to have both Python 2.7 and 3.6. The
easiest way is via ``pyenv``. You will also need to make both Python versions
'global' (or 'local') via pyenv, and then install and run ``tox`` outside of
any virtualenv.

.. code:: bash
source deactivate
pyenv global 2.7.14 3.6.2
pip install tox
tox
2 changes: 1 addition & 1 deletion event_consumer/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.2.1'
__version__ = '2.0.0'


if __name__ == '__main__':
Expand Down
4 changes: 0 additions & 4 deletions event_consumer/conf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
from flexisettings import Settings


settings = Settings('EVENT_CONSUMER', 'event_consumer.conf.defaults')
54 changes: 0 additions & 54 deletions event_consumer/conf/defaults.py

This file was deleted.

Loading

0 comments on commit 0eb60f9

Please sign in to comment.