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 1948987952)
This commit is contained in:
Javier Pena 2017-09-04 11:12:40 +02:00 committed by Alan Pevec
parent 6176c6e6b4
commit f69cabfa52
1 changed files with 5 additions and 3 deletions

View File

@ -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