Skip to content

Commit

Permalink
Add entrypoint
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Fankhauser <[email protected]>
  • Loading branch information
sephii committed Aug 17, 2023
1 parent 3163b07 commit e385616
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/341.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add entrypoint to allow running Sygnal by running the `sygnal` script.
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,7 @@ dev = [
homepage = "https://github.com/matrix-org/sygnal"
documentation = "https://github.com/matrix-org/sygnal/tree/main/docs"
repository = "https://github.com/matrix-org/sygnal.git"
changelog = "https://github.com/matrix-org/sygnal/blob/main/CHANGELOG.md"
changelog = "https://github.com/matrix-org/sygnal/blob/main/CHANGELOG.md"

[project.scripts]
sygnal = "sygnal.sygnal:main"
6 changes: 5 additions & 1 deletion sygnal/sygnal.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def merge_left_with_defaults(
return result


if __name__ == "__main__":
def main():
# TODO we don't want to have to install the reactor, when we can get away with
# it
asyncioreactor.install()
Expand All @@ -356,3 +356,7 @@ def merge_left_with_defaults(
custom_reactor = cast(SygnalReactor, asyncioreactor.AsyncioSelectorReactor())
sygnal = Sygnal(config, custom_reactor)
sygnal.run()


if __name__ == "__main__":
main()

0 comments on commit e385616

Please sign in to comment.