Matridge 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. matridge-0.2.0/.gitignore +10 -0
  2. matridge-0.2.0/.pre-commit-config.yaml +45 -0
  3. matridge-0.2.0/.woodpecker/container-cache.yaml +26 -0
  4. matridge-0.2.0/.woodpecker/container-ci.yaml +19 -0
  5. matridge-0.2.0/.woodpecker/container.yaml +40 -0
  6. matridge-0.2.0/.woodpecker/docs.yaml +24 -0
  7. matridge-0.2.0/.woodpecker/package.yaml +53 -0
  8. matridge-0.2.0/.woodpecker/test.yaml +32 -0
  9. matridge-0.2.0/Dockerfile +24 -0
  10. matridge-0.2.0/LICENSE +661 -0
  11. matridge-0.2.0/PKG-INFO +736 -0
  12. matridge-0.2.0/README.md +54 -0
  13. matridge-0.2.0/commitlint.config.js +2 -0
  14. matridge-0.2.0/doap.xml +146 -0
  15. matridge-0.2.0/docker-compose.yml +23 -0
  16. matridge-0.2.0/docs/Makefile +20 -0
  17. matridge-0.2.0/docs/source/codeberg.svg +17 -0
  18. matridge-0.2.0/docs/source/conf.py +48 -0
  19. matridge-0.2.0/docs/source/config.rst +14 -0
  20. matridge-0.2.0/docs/source/features.rst +8 -0
  21. matridge-0.2.0/docs/source/index.rst +27 -0
  22. matridge-0.2.0/docs/source/readme.rst +1 -0
  23. matridge-0.2.0/docs/source/user.rst +25 -0
  24. matridge-0.2.0/matridge/__init__.py +14 -0
  25. matridge-0.2.0/matridge/__main__.py +3 -0
  26. matridge-0.2.0/matridge/command.py +176 -0
  27. matridge-0.2.0/matridge/config.py +35 -0
  28. matridge-0.2.0/matridge/contact.py +64 -0
  29. matridge-0.2.0/matridge/gateway.py +76 -0
  30. matridge-0.2.0/matridge/group.py +154 -0
  31. matridge-0.2.0/matridge/matrix.py +490 -0
  32. matridge-0.2.0/matridge/reactions.py +125 -0
  33. matridge-0.2.0/matridge/session.py +301 -0
  34. matridge-0.2.0/matridge/util.py +235 -0
  35. matridge-0.2.0/matridge.egg-info/PKG-INFO +736 -0
  36. matridge-0.2.0/matridge.egg-info/SOURCES.txt +44 -0
  37. matridge-0.2.0/matridge.egg-info/dependency_links.txt +1 -0
  38. matridge-0.2.0/matridge.egg-info/entry_points.txt +2 -0
  39. matridge-0.2.0/matridge.egg-info/requires.txt +5 -0
  40. matridge-0.2.0/matridge.egg-info/top_level.txt +1 -0
  41. matridge-0.2.0/pyproject.toml +134 -0
  42. matridge-0.2.0/setup.cfg +4 -0
  43. matridge-0.2.0/tests/test_base.py +10 -0
  44. matridge-0.2.0/tests/test_conversion.py +119 -0
  45. matridge-0.2.0/tests/test_reactions.py +123 -0
  46. matridge-0.2.0/uv.lock +1737 -0
@@ -0,0 +1,10 @@
1
+ __pycache__
2
+ .mypy_cache
3
+ .pytest_cache
4
+ .ruff_cache
5
+ .idea
6
+ dist
7
+ docs/build
8
+ persistent
9
+ .venv
10
+ *.egg-info
@@ -0,0 +1,45 @@
1
+ default_stages: [pre-commit]
2
+ repos:
3
+ - repo: https://github.com/pre-commit/pre-commit-hooks
4
+ rev: v5.0.0
5
+ hooks:
6
+ - id: trailing-whitespace
7
+ - id: end-of-file-fixer
8
+ - id: check-yaml
9
+ - id: check-added-large-files
10
+ - id: check-merge-conflict
11
+ args: [--assume-in-merge]
12
+
13
+ - repo: https://github.com/astral-sh/uv-pre-commit
14
+ rev: 0.5.21
15
+ hooks:
16
+ - id: uv-lock
17
+
18
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
19
+ rev: v0.9.2
20
+ hooks:
21
+ - id: ruff
22
+ args: [ --fix ]
23
+ - id: ruff-format
24
+
25
+ - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
26
+ rev: v9.20.0
27
+ hooks:
28
+ - id: commitlint
29
+ stages: [commit-msg]
30
+ additional_dependencies: ['@commitlint/config-conventional']
31
+
32
+ - repo: local
33
+ hooks:
34
+ - id: mypy
35
+ name: Static type check with mypy
36
+ entry: .venv/bin/mypy
37
+ language: system
38
+ pass_filenames: false
39
+ files: .*\.py
40
+ - id: pytest-check
41
+ name: pytest-check
42
+ entry: .venv/bin/pytest tests
43
+ language: system
44
+ pass_filenames: false
45
+ always_run: true
@@ -0,0 +1,26 @@
1
+ # Generate build caches for containers used by the legacy modules and the CI images
2
+
3
+ # We cannot do it directly in the container workflow, because buildx does not "magically"
4
+ # merge multi-arch build caches, cf https://github.com/docker/buildx/discussions/1382#discussioncomment-4159926
5
+
6
+ when:
7
+ event: [ manual, cron ]
8
+
9
+ matrix:
10
+ PLATFORM:
11
+ - arm64
12
+ - amd64
13
+
14
+ steps:
15
+ build-cache:
16
+ image: woodpeckerci/plugin-docker-buildx
17
+ settings:
18
+ platforms: linux/${PLATFORM}
19
+ target: ${CI_REPO_NAME}
20
+ cache_images:
21
+ - codeberg.org/${CI_REPO_OWNER}/${CI_REPO_NAME}:buildcache-${PLATFORM}
22
+ registry: codeberg.org
23
+ username: slidge
24
+ password:
25
+ from_secret: CODEBERG_TOKEN
26
+ dry_run: true # we don't want to push the actual image, just the build cache
@@ -0,0 +1,19 @@
1
+ # Build a container with a virtualenv that can be used for tests and to build docs.
2
+
3
+ when:
4
+ event: [ manual, cron ]
5
+
6
+ steps:
7
+ build-and-push:
8
+ image: woodpeckerci/plugin-docker-buildx
9
+ settings:
10
+ platforms: linux/amd64
11
+ repo: codeberg.org/${CI_REPO_OWNER}/woodpecker-${CI_REPO_NAME}
12
+ registry: codeberg.org
13
+ auto_tag: true
14
+ target: woodpecker-${CI_REPO_NAME}
15
+ username: ${CI_REPO_OWNER}
16
+ password:
17
+ from_secret: CODEBERG_TOKEN
18
+ cache_images:
19
+ - codeberg.org/${CI_REPO_OWNER}/woodpecker-${CI_REPO_NAME}:buildcache
@@ -0,0 +1,40 @@
1
+ # Build the production container
2
+
3
+ variables:
4
+ - &settings
5
+ registry: codeberg.org
6
+ tags_file: .tags
7
+ target: ${CI_REPO_NAME}
8
+ platforms: linux/amd64,linux/arm64
9
+ # Unfortunately we can only a single build cache image,
10
+ # cf https://codeberg.org/woodpecker-plugins/docker-buildx/pulls/186
11
+ # since codeberg CI is amd64-only let's use the cache for the arm64 platform…
12
+ cache_from: type=registry,ref=codeberg.org/${CI_REPO_OWNER}/${CI_REPO_NAME}:buildcache-arm64
13
+
14
+ when:
15
+ event: [ push, pull_request, tag ]
16
+ path: [ "${CI_REPO_NAME}/**/*", pyproject.toml, uv.lock, Dockerfile ]
17
+
18
+ steps:
19
+ version:
20
+ image: codeberg.org/slidge/woodpecker-version
21
+ pull: true
22
+
23
+ build:
24
+ image: woodpeckerci/plugin-docker-buildx
25
+ settings:
26
+ dry_run: true
27
+ <<: *settings
28
+ when:
29
+ event: pull_request
30
+
31
+ build-and-push:
32
+ image: woodpeckerci/plugin-docker-buildx
33
+ settings:
34
+ repo: codeberg.org/${CI_REPO_OWNER}/${CI_REPO_NAME}
35
+ username: ${CI_REPO_OWNER}
36
+ password:
37
+ from_secret: CODEBERG_TOKEN
38
+ <<: *settings
39
+ when:
40
+ event: [push, tag]
@@ -0,0 +1,24 @@
1
+ when:
2
+ event: [ push, tag, pull_request ]
3
+ path: [ "${CI_REPO_NAME}/**/*.py", "superduper/**/*.py", "docs/**/*" ]
4
+
5
+ steps:
6
+ build:
7
+ image: codeberg.org/slidge/woodpecker-${CI_REPO_NAME}
8
+ pull: true
9
+ commands:
10
+ # the first 2 commands update the virtualenv, which is a no-op unless uv.lock has been modified
11
+ - uv export > req.txt
12
+ - uv pip install --requirements req.txt
13
+ - uv pip install .
14
+ - cd docs
15
+ - make html
16
+
17
+ publish:
18
+ image: codeberg.org/slidge/woodpecker-publish-pages
19
+ pull: true
20
+ when:
21
+ event: [ push, tag ]
22
+ settings:
23
+ token:
24
+ from_secret: CODEBERG_TOKEN
@@ -0,0 +1,53 @@
1
+ when:
2
+ event: [ push, tag, pull_request ]
3
+ path: [ "${CI_REPO_NAME}/**/*", "pyproject.toml", "uv.lock", "README.md" ]
4
+
5
+ variables:
6
+ - &image codeberg.org/slidge/woodpecker-${CI_REPO_NAME}
7
+ - &only-main-tag
8
+ when:
9
+ branch: main
10
+ event: tag
11
+
12
+ steps:
13
+ version:
14
+ image: codeberg.org/slidge/woodpecker-version
15
+ pull: true
16
+
17
+ changelog:
18
+ image: codeberg.org/slidge/woodpecker-generate-changelog
19
+ pull: true
20
+
21
+ build:
22
+ image: *image
23
+ commands:
24
+ - uv build
25
+
26
+ codeberg-pypi:
27
+ when:
28
+ event: [ push, tag ]
29
+ image: *image
30
+ environment:
31
+ CODEBERG_TOKEN:
32
+ from_secret: CODEBERG_TOKEN
33
+ commands:
34
+ - uv publish --index codeberg --token $CODEBERG_TOKEN
35
+
36
+ pypi:
37
+ image: *image
38
+ <<: *only-main-tag
39
+ environment:
40
+ PYPI_TOKEN:
41
+ from_secret: PYPI_TOKEN
42
+ commands:
43
+ - uv publish --token $PYPI_TOKEN
44
+
45
+ codeberg-release:
46
+ image: woodpeckerci/plugin-release
47
+ <<: *only-main-tag
48
+ settings:
49
+ files:
50
+ - dist/${CI_REPO_NAME}*
51
+ api_key:
52
+ from_secret: CODEBERG_TOKEN
53
+ note: CHANGELOG
@@ -0,0 +1,32 @@
1
+ when:
2
+ event: [ push, pull_request ]
3
+ path: [ pyproject.toml, uv.lock, "**/*.py" ]
4
+
5
+ variables:
6
+ - &image codeberg.org/slidge/woodpecker-${CI_REPO_NAME}
7
+
8
+ steps:
9
+ update-venv:
10
+ image: *image
11
+ pull: true
12
+ commands:
13
+ - cp -r /venv .venv
14
+ - uv venv --allow-existing .venv
15
+ - uv export > req.txt
16
+ - uv pip install --requirements req.txt --link-mode=copy
17
+
18
+ ruff:
19
+ image: *image
20
+ commands:
21
+ - ruff check
22
+ - ruff format
23
+
24
+ mypy:
25
+ image: *image
26
+ commands:
27
+ - mypy
28
+
29
+ test:
30
+ image: *image
31
+ commands:
32
+ - python -m pytest tests
@@ -0,0 +1,24 @@
1
+ # install dependencies
2
+ FROM codeberg.org/slidge/slidge-builder AS builder
3
+
4
+ COPY uv.lock pyproject.toml /build/
5
+ RUN uv export --no-dev > requirements.txt
6
+ RUN uv venv /venv/
7
+ RUN uv pip install --requirement requirements.txt
8
+
9
+ # ci container
10
+ FROM builder AS woodpecker-matridge
11
+ # In CI we copy /venv to .venv, then update it for the whole workflow.
12
+ ENV PATH=".venv/bin:$PATH"
13
+ RUN uv export > requirements.txt
14
+ RUN uv pip install --requirement requirements.txt
15
+
16
+ # main container
17
+ FROM codeberg.org/slidge/slidge-base AS matridge
18
+ COPY --from=builder /venv /venv
19
+ COPY ./matridge /venv/lib/python/site-packages/legacy_module
20
+
21
+ # dev container
22
+ FROM codeberg.org/slidge/slidge-dev AS dev
23
+
24
+ COPY --from=builder /venv /venv