#113 Remove use of werkzeug.
Merged 4 years ago by pingou. Opened 4 years ago by qulogic.
qulogic/mdapi no-werkzeug  into  master

file modified
+1 -1
@@ -6,7 +6,7 @@ 

  

  EXPOSE 8080

  

- RUN dnf -y install python3-aiohttp python3-werkzeug python3-requests python3-fedora-messaging python3-uvloop python3-pip python3-gunicorn\

+ RUN dnf -y install python3-aiohttp python3-requests python3-fedora-messaging python3-uvloop python3-pip python3-gunicorn\

      && dnf clean all \

      && pip3 install aiosqlite

  

file modified
-2
@@ -13,7 +13,6 @@ 

  BuildRequires:  python3-aiosqlite

  BuildRequires:  python3-requests

  BuildRequires:  python3-setuptools

- BuildRequires:  python3-werkzeug

  BuildRequires:  python3-devel

  BuildRequires:  systemd

  
@@ -22,7 +21,6 @@ 

  Requires:  python3-multidict

  Requires:  python3-requests

  Requires:  python3-setuptools

- Requires:  python3-werkzeug

  

  Requires(post):     systemd

  Requires(preun):    systemd

file modified
+3 -4
@@ -27,7 +27,6 @@ 

  import re

  

  import aiosqlite

- import werkzeug.utils

  

  from aiohttp import web

  
@@ -44,13 +43,13 @@ 

          FileList,

          ChangeLog

  )

+ from . import default_config

  

  

  CONFIG = dict()

- obj = werkzeug.utils.import_string('mdapi.default_config')

- for key in dir(obj):

+ for key in dir(default_config):

      if key.isupper():

-         CONFIG[key] = getattr(obj, key)

+         CONFIG[key] = getattr(default_config, key)

  

  

  if 'MDAPI_CONFIG' in os.environ and os.path.exists(os.environ['MDAPI_CONFIG']):

file modified
-1
@@ -3,6 +3,5 @@ 

  fedora_messaging

  # this is a requirement of aiohttp but better safe than sorry

  requests

- werkzeug

  uvloop

  gunicorn

There's no need to pull this in to do an import via a string name, when it's hardcoded and can just be a regular import statement.

Pull-Request has been merged by pingou

4 years ago