#############################
Migrate to PixStor Search 1.0
#############################

PixStor Search 1.0 marks the move from Python 2 to Python 3.

This move between python versions has introduced some necessary breaking changes.
This page outlines steps to migrate to PixStor Search 1.0+ from a 0.X release.

Plugins
=======

From an end-user perspective, the major breaking change is to any custom plugins you may have written.

As of PixStor Search 1.0, the code base is compatible with Python 3.6+
This means that plugins which were written to be compatible with the Python 2.7 code base *may* no longer be compatible.

In the first instance, you should try updating your plugins with an automated tool,
such as `2to3 <https://docs.python.org/2/library/2to3.html>`_ or `modernize <https://python-modernize.readthedocs.io/en/latest/>`_

.. code-block:: bash

    2to3 -wn myplugin.py

In most cases, this will be sufficient. If not, you can find plenty of guides online,
or you can open a support ticket with ArcaPix, and we will perform the migration for you.

Async
-----

As of Python 3.7, ``async`` will be a reserved keyword. This means it can no longer be used for the method name on plugins.

To avoid this issue in future releases, we have renamed the ``async`` method to ``is_async``.

Any user plugins which specify the ``async`` method should similarly rename it to ``is_async``

.. code-block:: python

    class MyPlugin(Plugin):

        def is_async(self):
            return True

        # etc.