1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
# matrix-python-common
Common utilities for Synapse, Sydent and Sygnal.
## Installation
```shell
pip install matrix-common
```
## Usage
```py
import matrix_common
```
## Development
In a virtual environment with pip ≥ 21.1, run
```shell
pip install -e .[dev]
```
To run the unit tests, you can either use:
```shell
tox -e py
```
or
```shell
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):
```shell
version=X.Y.Z
```
2. Update `setup.cfg` so that the `version` is correct.
3. Stage the changed files and commit.
```shell
git add -u
git commit -m v$version -n
```
4. Push your changes.
```shell
git push
```
5. When ready, create a signed tag for the release:
```shell
git tag -s v$version
```
Base the tag message on the changelog.
6. Push the tag.
```shell
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:
```shell
python -m build
twine upload dist/matrix_common-$version*
```
|