From f69cabfa52f020ddccf6a4afe579064e993b81a8 Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Mon, 4 Sep 2017 11:12:40 +0200 Subject: [PATCH] Remove runtime dependency on setuptools We were only depending on setuptools for runtime to use pkg_resources, so we could fetch the path to the rst documentation in certain cases (mainly during development). We can figure out that path using other means, so we do not depend on setuptools anymore. Closes-Bug: #1713950 Change-Id: I9c0f676ac2219001118f7191a6e5c8faee3312c4 (cherry picked from commit 1948987952a2cedc055d03a7a6ba5affd701bd4d) --- packstack/installer/basedefs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packstack/installer/basedefs.py b/packstack/installer/basedefs.py index aa6334fe5..5a6673747 100644 --- a/packstack/installer/basedefs.py +++ b/packstack/installer/basedefs.py @@ -18,10 +18,10 @@ This module provides all the predefined variables. import datetime import os -import pkg_resources import sys import tempfile +import packstack from .utils import get_current_user @@ -29,8 +29,10 @@ APP_NAME = "Packstack" FILE_YUM_VERSION_LOCK = "/etc/yum/pluginconf.d/versionlock.list" -PACKSTACK_SRC_DOC = pkg_resources.resource_filename( - pkg_resources.Requirement.parse('packstack'), 'docs/packstack.rst' +PACKSTACK_SRC_DOC = os.path.realpath( + os.path.join(os.path.abspath( + packstack.__path__[0]), '..', 'docs/packstack.rst' + ) ) if os.path.exists(PACKSTACK_SRC_DOC): PACKSTACK_DOC = PACKSTACK_SRC_DOC