Browse Source

Add uwsgi invoke

Getty Ritter 2 years ago
parent
commit
2fcc9717c2
3 changed files with 19 additions and 1 deletions
  1. 12 1
      poetry.lock
  2. 1 0
      pyproject.toml
  3. 6 0
      tasks.py

+ 12 - 1
poetry.lock

@@ -411,6 +411,14 @@ brotli = ["brotlipy (>=0.6.0)"]
 secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"]
 socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"]
 
+[[package]]
+category = "dev"
+description = "The uWSGI server"
+name = "uwsgi"
+optional = false
+python-versions = "*"
+version = "2.0.18"
+
 [[package]]
 category = "dev"
 description = "Measures number of Terminal column cells of wide-character codes"
@@ -432,7 +440,7 @@ dev = ["pytest", "pytest-timeout", "coverage", "tox", "sphinx", "pallets-sphinx-
 watchdog = ["watchdog"]
 
 [metadata]
-content-hash = "ad6bfc0a1ba5e7235af3805fba4e6abf8aad3713fb963f4ef5d6387c85d121a0"
+content-hash = "199d426c3947fdf20a0945d853d9eaad79d800e6053dc4fd10228c28b21a9457"
 python-versions = "^3.8"
 
 [metadata.files]
@@ -670,6 +678,9 @@ urllib3 = [
     {file = "urllib3-1.25.8-py2.py3-none-any.whl", hash = "sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc"},
     {file = "urllib3-1.25.8.tar.gz", hash = "sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc"},
 ]
+uwsgi = [
+    {file = "uwsgi-2.0.18.tar.gz", hash = "sha256:4972ac538800fb2d421027f49b4a1869b66048839507ccf0aa2fda792d99f583"},
+]
 wcwidth = [
     {file = "wcwidth-0.1.9-py2.py3-none-any.whl", hash = "sha256:cafe2186b3c009a04067022ce1dcd79cb38d8d65ee4f4791b8888d6599d1bbe1"},
     {file = "wcwidth-0.1.9.tar.gz", hash = "sha256:ee73862862a156bf77ff92b09034fc4825dd3af9cf81bc5b360668d425f3c5f1"},

+ 1 - 0
pyproject.toml

@@ -19,6 +19,7 @@ invoke = "^1.4.1"
 black = "^19.10b0"
 requests = "^2.23.0"
 mypy = "^0.770"
+uwsgi = "^2.0.18"
 
 [build-system]
 requires = ["poetry>=0.12"]

+ 6 - 0
tasks.py

@@ -47,3 +47,9 @@ def populate(c):
 def tc(c):
     """Populate the test database with fake-ish data"""
     c.run("MYPYPATH=$(pwd)/stubs poetry run mypy lc/*.py tests/*.py scripts/*.py")
+
+
+@task
+def uwsgi(c, port=9898):
+    """Run a uwsgi server"""
+    c.run(f"poetry run uwsgi --socket {port} --wsgi-file lament-configuration.py --processes 4 --threads 2")