From c5ef2e90e751cc4735329b1fa9274edf1990e749 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: May 05 2020 07:53:53 +0000 Subject: Remove use of werkzeug. 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. --- diff --git a/Dockerfile b/Dockerfile index 83c8d2a..39bcc8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ LABEL maintainer "Clément Verna " 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 diff --git a/mdapi.spec b/mdapi.spec index f7e6ace..6554614 100644 --- a/mdapi.spec +++ b/mdapi.spec @@ -13,7 +13,6 @@ BuildRequires: python3-aiohttp BuildRequires: python3-aiosqlite BuildRequires: python3-requests BuildRequires: python3-setuptools -BuildRequires: python3-werkzeug BuildRequires: python3-devel BuildRequires: systemd @@ -22,7 +21,6 @@ Requires: python3-aiosqlite Requires: python3-multidict Requires: python3-requests Requires: python3-setuptools -Requires: python3-werkzeug Requires(post): systemd Requires(preun): systemd diff --git a/mdapi/__init__.py b/mdapi/__init__.py index 4dfc286..04df2bd 100644 --- a/mdapi/__init__.py +++ b/mdapi/__init__.py @@ -27,7 +27,6 @@ import os import re import aiosqlite -import werkzeug.utils from aiohttp import web @@ -44,13 +43,13 @@ from mdapi.db import ( 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']): diff --git a/requirements.txt b/requirements.txt index 9549806..ab77745 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,5 @@ aiosqlite fedora_messaging # this is a requirement of aiohttp but better safe than sorry requests -werkzeug uvloop gunicorn