Metadata-Version: 2.1
Name: Oldmemo
Version: 1.0.0
Summary: Backend implementation of the namespace `eu.siacs.conversations.axolotl` for python-omemo.
Home-page: https://github.com/Syndace/python-oldmemo
Author: Tim Henkes (Syndace)
Author-email: me@syndace.dev
License: AGPLv3
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Security :: Cryptography
Classifier: Development Status :: 5 - Production/Stable
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: xml
License-File: LICENSE

[![PyPI](https://img.shields.io/pypi/v/Oldmemo.svg)](https://pypi.org/project/Oldmemo/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/Oldmemo.svg)](https://pypi.org/project/Oldmemo/)
[![Build Status](https://travis-ci.org/Syndace/python-oldmemo.svg?branch=main)](https://travis-ci.org/Syndace/python-oldmemo)
[![Documentation Status](https://readthedocs.org/projects/python-oldmemo/badge/?version=latest)](https://python-oldmemo.readthedocs.io/en/latest/?badge=latest)

# python-oldmemo #

Backend implementation for [python-omemo](https://github.com/Syndace/python-omemo), equipping python-omemo with support for OMEMO under the namespace `eu.siacs.conversations.axolotl` (casually/jokingly referred to as "oldmemo").

This repository is based on [python-twomemo](https://github.com/Syndace/python-twomemo) and will be rebased on top of new commits to that repository regularly, so expect commit hashes to be unstable.

## Installation ##

python-oldmemo depends on two system libraries, [libxeddsa](https://github.com/Syndace/libxeddsa)>=2,<3 and [libsodium](https://download.libsodium.org/doc/).

Install the latest release using pip (`pip install oldmemo`) or manually from source by running `pip install .` (recommended) or `python setup.py install` in the cloned repository. The installation requires libsodium and the Python development headers to be installed. If a locally installed version of libxeddsa is available, [python-xeddsa](https://github.com/Syndace/python-xeddsa) (a dependency of [python-x3dh](https://github.com/Syndace/python-x3dh)) tries to use that. Otherwise it uses prebuilt binaries of the library, which are available for Linux, MacOS and Windows for the amd64 architecture, and potentially for MacOS arm64 too. Set the `LIBXEDDSA_FORCE_LOCAL` environment variable to forbid the usage of prebuilt binaries.

## Protobuf ##

Install `protoc`. Then, in the root directory of this repository, run:

```sh
$ pip install protobuf mypy mypy-protobuf types-protobuf
$ protoc --python_out=oldmemo/ --mypy_out=oldmemo/ oldmemo.proto
```

This will generate `oldmemo/oldmemo_pb2.py` and `oldmemo/oldmemo_pb2.pyi`.

## Testing, Type Checks and Linting ##

python-oldmemo uses [pytest](https://docs.pytest.org/en/latest/) as its testing framework, [mypy](http://mypy-lang.org/) for static type checks and both [pylint](https://pylint.pycqa.org/en/latest/) and [Flake8](https://flake8.pycqa.org/en/latest/) for linting. All tests/checks can be run locally with the following commands:

```sh
$ pip install --upgrade pytest pytest-asyncio mypy pylint flake8 mypy-protobuf types-protobuf
$ mypy --strict oldmemo/ setup.py tests/
$ pylint oldmemo/ setup.py tests/
$ flake8 oldmemo/ setup.py tests/
$ pytest
```

## Getting Started ##

Refer to the documentation on [readthedocs.io](https://python-oldmemo.readthedocs.io/en/latest/), or build/view it locally in the `docs/` directory. To build the docs locally, install the requirements listed in `docs/requirements.txt`, e.g. using `pip install -r docs/requirements.txt`, and then run `make html` from within the `docs/` directory. The documentation can then be found in `docs/_build/html/`.
