From 5e552e4b0a905fe2865170f1b1f843c42fa800bb Mon Sep 17 00:00:00 2001 From: Sebastian Kalinowski Date: Tue, 7 Jul 2015 14:48:59 +0200 Subject: [PATCH] Remove pbr import from fuel_agent's setup.py Importing pbr in setup.py prevents installing fuel_agent into clean environment (without pbr). Change-Id: I2734b3cd97ddde7d243b71c3a7112e2519b7b7e2 Closes-Bug: #1472082 --- fuel_agent/hooks.py | 21 +++++++++++++++++++++ setup.cfg | 5 +++++ setup.py | 7 ------- 3 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 fuel_agent/hooks.py diff --git a/fuel_agent/hooks.py b/fuel_agent/hooks.py new file mode 100644 index 0000000..5b16a78 --- /dev/null +++ b/fuel_agent/hooks.py @@ -0,0 +1,21 @@ +# Copyright 2015 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +def setup_hook(config): + import pbr + import pbr.packaging + + # this monkey patch is to avoid appending git version to version + pbr.packaging._get_version_from_git = lambda pre_version: pre_version diff --git a/setup.cfg b/setup.cfg index 48a8597..e05bba6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,6 +32,11 @@ autodoc_index_modules = True # from other subprojects in this repository skip_git_sdist = True +[global] +setup-hooks = + pbr.hooks.setup_hook + fuel_agent.hooks.setup_hook + [build_sphinx] all_files = 1 build-dir = doc/build diff --git a/setup.py b/setup.py index 64c4ce5..cd38a49 100644 --- a/setup.py +++ b/setup.py @@ -14,13 +14,6 @@ import setuptools -import pbr -import pbr.packaging - - -# this monkey patch is to avoid appending git version to version -pbr.packaging._get_version_from_git = lambda pre_version: pre_version - setuptools.setup( setup_requires=['pbr'],