Common code for Synapse, Sydent and Sygnal.
  • Python 98.2%
  • Shell 1.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-10-12 10:30:34 +01:00
.github Drop support for Python 3.6 (#28) 2022-07-15 11:55:23 +01:00
scripts-dev Move to src layout (#23) 2022-02-16 11:33:06 +00:00
src/matrix_common Allow importing MXCUri from matrix_common.types (#30) 2022-09-13 16:21:06 +01:00
tests Add an MXCUri class for representing media uri's in matrix (#29) 2022-09-12 17:53:25 +01:00
.gitignore Regenerate from synapse-module-cookiecutter-template (#7) 2021-12-01 18:15:46 +00:00
CONTRIBUTING.md Add CONTRIBUTING.md (#24) 2022-02-17 17:46:54 +00:00
LICENSE Regenerate from synapse-module-cookiecutter-template (#7) 2021-12-01 18:15:46 +00:00
MANIFEST.in Include tests in the source distribution 2022-01-20 09:22:20 +00:00
mypy.ini Move versionstring from sydent/snapse to common (#22) 2022-02-11 21:00:32 +00:00
pyproject.toml Require at least setuptools version 61 (#31) 2022-10-12 10:30:34 +01:00
README.md Regenerate from synapse-module-cookiecutter-template (#7) 2021-12-01 18:15:46 +00:00
setup.cfg v1.3.0 2022-09-13 10:08:17 +01:00
tox.ini Move to src layout (#23) 2022-02-16 11:33:06 +00:00

matrix-python-common

Common utilities for Synapse, Sydent and Sygnal.

Installation

pip install matrix-common

Usage

import matrix_common

Development

In a virtual environment with pip ≥ 21.1, run

pip install -e .[dev]

To run the unit tests, you can either use:

tox -e py

or

trial tests

To run the linters and mypy type checker, use ./scripts-dev/lint.sh.

Releasing

The exact steps for releasing will vary; but this is an approach taken by the Synapse developers (assuming a Unix-like shell):

  1. Set a shell variable to the version you are releasing (this just makes subsequent steps easier):

    version=X.Y.Z
    
  2. Update setup.cfg so that the version is correct.

  3. Stage the changed files and commit.

    git add -u
    git commit -m v$version -n
    
  4. Push your changes.

    git push
    
  5. When ready, create a signed tag for the release:

    git tag -s v$version
    

    Base the tag message on the changelog.

  6. Push the tag.

    git push origin tag v$version
    
  7. If applicable: Create a release, based on the tag you just pushed, on GitHub or GitLab.

  8. If applicable: Create a source distribution and upload it to PyPI:

    python -m build
    twine upload dist/matrix_common-$version*