-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CI, packaging, add checks for code style and types (#6)
- Loading branch information
Showing
12 changed files
with
211 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
|
||
|
||
jobs: | ||
check-code-style: | ||
name: Check code style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.11" | ||
- run: python -m pip install tox | ||
- run: tox -e check_codestyle | ||
|
||
# check-types: | ||
# name: Check types with Mypy | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - uses: actions/setup-python@v2 | ||
# with: | ||
# python-version: "3.11" | ||
# - run: python -m pip install tox | ||
# - run: tox -e check_types | ||
|
||
unit-tests: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.11" | ||
- run: python -m pip install tox | ||
- run: tox -e py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ _trial_temp/ | |
/build/ | ||
/dist/ | ||
/*.egg-info/ | ||
/.venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[mypy] | ||
strict = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.isort] | ||
profile = "black" | ||
known_first_party = [ | ||
"manage_last_admin", | ||
"tests" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[metadata] | ||
name = manage_last_admin | ||
description = A third-party rules module for Synapse to automatically make default level as admin or set moderators as admin when the last admin leaves it. | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
url = https://github.com/tchapgouv/synapse-manage-last-admin | ||
version = 0.2.0 | ||
|
||
classifiers = | ||
License :: OSI Approved :: Apache Software License | ||
|
||
|
||
[options] | ||
packages = | ||
manage_last_admin | ||
python_requires = >= 3.7 | ||
install_requires = | ||
attrs | ||
|
||
|
||
[options.package_data] | ||
manage_last_admin = py.typed | ||
|
||
|
||
[options.extras_require] | ||
dev = | ||
# for tests | ||
pydantic>=1.7.4, <2.0 | ||
matrix-synapse==1.84.0 | ||
tox | ||
twisted | ||
aiounittest | ||
# for type checking | ||
mypy == 1.6.1 | ||
# for linting | ||
black == 23.10.0 | ||
flake8 == 6.1.0 | ||
isort == 5.12.0 | ||
|
||
|
||
[flake8] | ||
# see https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes | ||
# for error codes. The ones we ignore are: | ||
# W503: line break before binary operator | ||
# W504: line break after binary operator | ||
# E203: whitespace before ':' (which is contrary to pep8?) | ||
# E501: Line too long (black enforces this for us) | ||
# (this is a subset of those ignored in Synapse) | ||
ignore=W503,W504,E203,E501 |
Oops, something went wrong.