Skip to content
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
3 changes: 3 additions & 0 deletions oonidata/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ path = ".venv/"
[tool.hatch.version]
path = "src/oonidata/__about__.py"

[project.scripts]
oonidata = "oonidata.main:main"

[tool.hatch.envs.default.scripts]
oonidata = "python -m oonidata.main {args}"
test = "pytest {args:tests}"
Expand Down
5 changes: 4 additions & 1 deletion oonidata/src/oonidata/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import multiprocessing as mp
from oonidata.cli import cli

if __name__ == "__main__":
def main():
# Use spawn to avoid race condition that leads to deadlocks on unix
# See: https://bugs.python.org/issue6721
mp.set_start_method("spawn")

cli()

if __name__ == "__main__":
main()