summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug@doughellmann.com>2018-09-28 14:22:24 -0400
committerMatthew Thode <mthode@mthode.org>2019-04-05 21:24:36 -0500
commit1240c5cedac70c06f449a83ccb00bbf23c6884b2 (patch)
tree3cd13473fbe6a8a757f810ab1bb68cf53b00cc86
parent32510405788c57eb0ffeededd927239dcce3cd81 (diff)
downloadheat-1240c5cedac70c06f449a83ccb00bbf23c6884b2.tar.gz
change the dist name to 'openstack-heat'
We are updating all Python projects to publish artifacts to PyPI. The name "heat" is already taken there by another project, and they have rejected our request to claim the name. We therefore need to change the dist name used to package heat. We have some other projects publishing using an "openstack-" prefix, so I propose using the name "openstack-heat". This will not change the imports or anything else about how the code works, just how it is packaged. Add a grenade plugin for upgrading between the packages with different names so that we can clean up the old version of the code and avoid discovering the heat plugins multiple times in different locations. Change-Id: I59b55cffd9e648f842eb286b936f09c5b55a76db Signed-off-by: Doug Hellmann <doug@doughellmann.com> (cherry picked from commit 8ae5f8657b2bdf841bdf114b49839700c2ee924f)
-rwxr-xr-xdevstack/upgrade/from-queens/upgrade-heat55
-rw-r--r--heat/version.py2
-rw-r--r--releasenotes/notes/change-dist-name-288024b5d6668c01.yaml7
-rw-r--r--setup.cfg2
-rw-r--r--tox.ini2
5 files changed, 65 insertions, 3 deletions
diff --git a/devstack/upgrade/from-queens/upgrade-heat b/devstack/upgrade/from-queens/upgrade-heat
new file mode 100755
index 000000000..e7ebce4b0
--- /dev/null
+++ b/devstack/upgrade/from-queens/upgrade-heat
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+
+# ``upgrade-heat``
+
+function configure_heat_upgrade {
+ local xtrace
+ xtrace=$(set +o | grep xtrace)
+ set -o xtrace
+
+ # The dist name for heat changed in rocky from "heat" to
+ # "openstack-heat". Having the metadata for both packages
+ # installed causes our plugins to be listed twice, so we need to
+ # remove the old one before devstack installs the new one.
+ # Using pip to uninstall the old code doesn't seem to work,
+ # so this script works a bit more aggressively. These steps
+ # should not be necessary for deployments using standard
+ # system packages from distributions.
+
+ local python_interpreter="python"
+ if python3_enabled; then
+ python_interpreter="python3"
+ fi
+
+ local sys_path=$($python_interpreter -c 'import sys; print(" ".join(sys.path))')
+ local sys_path_dir
+ local egg_link
+ local easy_file
+ for sys_path_dir in $sys_path; do
+ # Installing something in editable mode creates an "egg link"
+ # file that points to the location of the source files and
+ # metadata. When we do the upgrades for projects that preserve
+ # their name, the existing file is modified to point to the
+ # new location. In this case, heat's name is changing so we
+ # end up with a new file using the new name and the old one is
+ # untouched. We need to remove it ourselves.
+ egg_link="$sys_path_dir/heat.egg-link"
+ if [ -e "$egg_link" ]; then
+ sudo rm -f "$egg_link"
+ fi
+ # Installing a directory in editable mode adds the directory
+ # to the .pth file that setuptools manages. When we do the
+ # upgrades for projects that preserve their name, the old
+ # entry is automatically replaced with the new one. In this
+ # case, heat's name is changing, so setuptools doesn't figure
+ # out that it should remove the old entry, and we have to do
+ # it ourselves.
+ easy_file=$sys_path_dir/easy-install.pth
+ if [ -f $easy_file ]; then
+ sudo sed --in-place '/old\/heat/d' $easy_file
+ fi
+ done
+
+ ## reset to previous state
+ $xtrace
+}
diff --git a/heat/version.py b/heat/version.py
index a8cd2d7dc..13078b440 100644
--- a/heat/version.py
+++ b/heat/version.py
@@ -14,4 +14,4 @@
import pbr.version
-version_info = pbr.version.VersionInfo('heat')
+version_info = pbr.version.VersionInfo('openstack-heat')
diff --git a/releasenotes/notes/change-dist-name-288024b5d6668c01.yaml b/releasenotes/notes/change-dist-name-288024b5d6668c01.yaml
new file mode 100644
index 000000000..8925ce369
--- /dev/null
+++ b/releasenotes/notes/change-dist-name-288024b5d6668c01.yaml
@@ -0,0 +1,7 @@
+---
+upgrade:
+ - |
+ The distribution name has been changed from "heat" to
+ "openstack-heat" so that we can publish packages to pypi.org. This
+ may have an effect on downstream package builds if they rely on
+ asking setuptools to determine the package name.
diff --git a/setup.cfg b/setup.cfg
index 21078c38f..8a9935cfb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
[metadata]
-name = heat
+name = openstack-heat
summary = OpenStack Orchestration
description-file =
README.rst
diff --git a/tox.ini b/tox.ini
index 32f67e81e..1fa292e6b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -118,7 +118,7 @@ max-complexity=20
[doc8]
ignore = D001
-ignore-path = .venv,.git,.tox,.tmp,*heat/locale*,*lib/python*,heat.egg*,doc/build,releasenotes/*
+ignore-path = .venv,.git,.tox,.tmp,*heat/locale*,*lib/python*,openstack_heat.egg*,doc/build,releasenotes/*
[hacking]
import_exceptions = heat.common.i18n