From ebc79cbe9c17d79dcca7f666f2135b241ade3d3d Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Wed, 1 Aug 2018 11:09:55 -0400 Subject: [PATCH] 3.7.2 - Fix pypy support and add pypy documentation https://github.com/elastic/elasticsearch-dsl-py/blob/master/Changelog.rst#620-2018-07-03 https://github.com/elastic/elasticsearch-dsl-py/issues/953 --- CHANGELOG.md | 8 +++++- README.rst | 56 +++++++++++++++++++++++++++++++++++-- docs/index.rst | 63 ++++++++++++++++++++++++++++++++++++++++++ parsedmarc/__init__.py | 2 +- setup.py | 2 +- 5 files changed, 125 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5702b4..0aa4fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ +3.7.2 +----- + +- Change uses uses of the `DocType` class to `Document`, to properly support `elasticsearch-dsl` `6.2.0` (this also fixes use in pypy) +- Add documentation for installation under pypy + 3.7.1 ----- -- Require `elasticsearch>=6.3.0,<7.0.0` and `elasticsearch-dsl>=6.2.1,<7.0.0` +- Require `elasticsearch>=6.2.1,<7.0.0` and `elasticsearch-dsl>=6.2.1,<7.0.0` - Update for class changes in `elasticsearch-dsl` `6.2.0` 3.7.0 diff --git a/README.rst b/README.rst index 6e3612f..15a9267 100644 --- a/README.rst +++ b/README.rst @@ -234,6 +234,56 @@ Or, install the latest development release directly from GitHub: substitute ``pip`` as an administrator in place of ``sudo pip3``, in the above commands. +Installation using pypy3 +------------------------ + +For the best possible processing speed, consider using `parsedmarc` inside a ``pypy3`` +virtualenv. First, `download the latest version of pypy3`_. Extract it to +``/opt/pypy3`` (``sudo mkdir /opt`` if ``/opt`` does not exist), then create a +symlink: + +.. code-block:: bash + + $ sudo ln -s /opt/pypy3/bin/pypy3 /usr/local/bin/pypy3 + +Install ``virtualenv`` on your system: + +.. code-block:: bash + + $ sudo apt-get install python3-pip + $ sudo -H pip3 install -U virtualenv + +Uninstall any instance of ``parsedmarc`` that you may have installed globally + +.. code-block:: bash + + $ sudo -H pip3 uninstall -y parsedmarc + +Next, create a ``pypy3`` virtualenv for parsedmarc + + +.. code-block:: bash + + $ sudo mkdir /opt/venvs + $ cd /opt/venvs + $ sudo -H pip3 install -U virtualenv + $ sudo virtualenv --download -p /usr/local/bin/pypy3 parsedmarc + $ sudo -H /opt/venvs/parsedmarc/bin/pip3 install -U parsedmarc + $ sudo ln -s /opt/venvs/parsedmarc/bin/parsedmarc /usr/local/bin/parsedmarc + +To upgrade ``parsedmarc`` inside the virtualenv, run: + + +.. code-block:: bash + + $ sudo -H /opt/venvs/parsedmarc/bin/pip3 install -U parsedmarc + +Or, install the latest development release directly from GitHub: + +.. code-block:: bash + + $ sudo -H /opt/venvs/parsedmarc/bin/pip3 install -U git+https://github.com/domainaware/parsedmarc.git + Optional dependencies --------------------- @@ -246,8 +296,6 @@ On Debian or Ubuntu systems, run: $ sudo apt-get install libemail-outlook-message-perl - - Documentation ============= @@ -263,4 +311,6 @@ https://github.com/domainaware/parsedmarc/issues .. |Build Status| image:: https://travis-ci.org/domainaware/parsedmarc.svg?branch=master :target: https://travis-ci.org/domainaware/parsedmarc -.. _Demystifying DMARC: https://seanthegeek.net/459/demystifying-dmarc/ \ No newline at end of file +.. _Demystifying DMARC: https://seanthegeek.net/459/demystifying-dmarc/ + +.. _download the latest version of pypy3: https://pypy.org/download.html#default-with-a-jit-compiler diff --git a/docs/index.rst b/docs/index.rst index 1cc2a9e..21cc9fb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -249,6 +249,57 @@ Or, install the latest development release directly from GitHub: substitute ``pip`` as an administrator in place of ``sudo pip3``, in the above commands. + +Installation using pypy3 +------------------------ + +For the best possible processing speed, consider using `parsedmarc` inside a ``pypy3`` +virtualenv. First, `download the latest version of pypy3`_. Extract it to +``/opt/pypy3`` (``sudo mkdir /opt`` if ``/opt`` does not exist), then create a +symlink: + +.. code-block:: bash + + $ sudo ln -s /opt/pypy3/bin/pypy3 /usr/local/bin/pypy3 + +Install ``virtualenv`` on your system: + +.. code-block:: bash + + $ sudo apt-get install python3-pip + $ sudo -H pip3 install -U virtualenv + +Uninstall any instance of ``parsedmarc`` that you may have installed globally + +.. code-block:: bash + + $ sudo -H pip3 uninstall -y parsedmarc + +Next, create a ``pypy3`` virtualenv for parsedmarc + + +.. code-block:: bash + + $ sudo mkdir /opt/venvs + $ cd /opt/venvs + $ sudo -H pip3 install -U virtualenv + $ sudo virtualenv --download -p /usr/local/bin/pypy3 parsedmarc + $ sudo -H /opt/venvs/parsedmarc/bin/pip3 install -U parsedmarc + $ sudo ln -s /opt/venvs/parsedmarc/bin/parsedmarc /usr/local/bin/parsedmarc + +To upgrade ``parsedmarc`` inside the virtualenv, run: + + +.. code-block:: bash + + $ sudo -H /opt/venvs/parsedmarc/bin/pip3 install -U parsedmarc + +Or, install the latest development release directly from GitHub: + +.. code-block:: bash + + $ sudo -H /opt/venvs/parsedmarc/bin/pip3 install -U git+https://github.com/domainaware/parsedmarc.git + Optional dependencies --------------------- @@ -549,6 +600,16 @@ Use this command to check the status of the service: sudo service parsedmarc status +.. warning:: + + Always restart the service every time you upgrade to a new version of + ``parsedmarc``: + + .. code-block:: bash + + sudo service parsedmarc restart + + Using the Kibana dashboards =========================== @@ -720,6 +781,8 @@ Indices and tables .. _Demystifying DMARC: https://seanthegeek.net/459/demystifying-dmarc/ +.. _download the latest version of pypy3: https://pypy.org/download.html#default-with-a-jit-compiler + .. _X-Pack: https://www.elastic.co/products/x-pack .. _kibana_saved_objects.json: https://raw.githubusercontent.com/domainaware/parsedmarc/master/kibana/kibana_saved_objects.json diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 6dcd87a..4e721a7 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -43,7 +43,7 @@ import imapclient.exceptions import dateparser import mailparser -__version__ = "3.7.1" +__version__ = "3.7.2" logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) diff --git a/setup.py b/setup.py index 13dd807..d478433 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup from codecs import open from os import path -__version__ = "3.7.1" +__version__ = "3.7.2" description = "A Python package and CLI for parsing aggregate and " \ "forensic DMARC reports"