Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entrypoint #341

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()