From d70c55831a80ce6350f8b5b3f25bfc5c2bde4179 Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Thu, 17 Nov 2016 14:07:33 +0300 Subject: [PATCH] Add pbr version hook to fuel_bootstrap Change-Id: I5f3778c86314c59d90a8f1b74a4aa1bc8e90241e Closes-Bug: #1642549 (cherry picked from commit 0fd70bb71295d8edaa895c6618c1fe4deea65ac6) --- .gitignore | 1 + .../fuel_bootstrap/hooks.py | 21 +++++++++++++++++++ .../fuel_bootstrap_cli/setup.cfg | 5 +++++ 3 files changed, 27 insertions(+) create mode 100644 contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/hooks.py diff --git a/.gitignore b/.gitignore index b254f2e5..a433d9f2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ build dist *.egg +*.eggs .testrepository .cache .tox diff --git a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/hooks.py b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/hooks.py new file mode 100644 index 00000000..1db2aa45 --- /dev/null +++ b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/hooks.py @@ -0,0 +1,21 @@ +# Copyright 2016 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/contrib/fuel_bootstrap/fuel_bootstrap_cli/setup.cfg b/contrib/fuel_bootstrap/fuel_bootstrap_cli/setup.cfg index 2dd1b6f8..f2e4ca6a 100644 --- a/contrib/fuel_bootstrap/fuel_bootstrap_cli/setup.cfg +++ b/contrib/fuel_bootstrap/fuel_bootstrap_cli/setup.cfg @@ -22,6 +22,11 @@ classifier = packages = fuel_bootstrap +[global] +setup-hooks = + pbr.hooks.setup_hook + fuel_bootstrap.hooks.setup_hook + [entry_points] console_scripts = fuel-bootstrap=fuel_bootstrap.main:main