Browse Source

Start daemon from Poetry

master
Forest Belton 3 years ago
parent
commit
ca1111e3cc
3 changed files with 12 additions and 4 deletions
  1. +2
    -2
      README.md
  2. +7
    -2
      paircd/main.py
  3. +3
    -0
      pyproject.toml

+ 2
- 2
README.md View File

@ -10,5 +10,5 @@ $ poetry install
## run
```
$ poetry run python
```
$ poetry run server
```

+ 7
- 2
paircd/main.py View File

@ -22,7 +22,7 @@ async def read_forever(server: Server, client: Client) -> None:
await handle_cmd(server, client, msg)
async def main() -> None:
async def serve() -> None:
bind_addr = os.getenv("BIND_ADDR") or "0.0.0.0"
port = os.getenv("PORT") or 6667
@ -50,5 +50,10 @@ async def main() -> None:
await server.serve_forever()
def main():
asyncio.run(serve())
if __name__ == "__main__":
asyncio.run(main())
main()

+ 3
- 0
pyproject.toml View File

@ -12,6 +12,9 @@ pytest = "^5.2"
mypy = "^0.902"
pre-commit = "^2.13.0"
[tool.poetry.scripts]
server = "paircd.main:main"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Loading…
Cancel
Save