Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gnocchi build with latest setuptools #1305

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ classifier =
[options]
packages =
gnocchi
gnocchi.cli
gnocchi.common
gnocchi.incoming
gnocchi.indexer
gnocchi.rest
gnocchi.storage
gnocchi.tests

include_package_data = true

Expand Down
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

# Can't use six in this file it's too early in the bootstrap process
PY3 = sys.version_info >= (3,)
SETUPTOOLS_VER = setuptools.__version__


class local_install_scripts(install_scripts.install_scripts):
Expand All @@ -63,7 +64,10 @@ def run(self):
# replaced by the correct interpreter. We do the same here.
bs_cmd = self.get_finalized_command('build_scripts')
executable = getattr(bs_cmd, 'executable', easy_install.sys_executable)
script = easy_install.get_script_header("", executable) + SCRIPT_TMPL
if not SETUPTOOLS_VER.startswith('68'):
script = easy_install.get_script_header("", executable) + SCRIPT_TMPL
else:
script = easy_install.ScriptWriter.get_header("", executable) + SCRIPT_TMPL
if PY3:
script = script.encode('ascii')
self.write_script("gnocchi-api", script, 'b')
Expand All @@ -74,7 +78,10 @@ def install_wrapper_scripts(self, dist):
develop.develop.install_wrapper_scripts(self, dist)
if self.exclude_scripts:
return
script = easy_install.get_script_header("") + SCRIPT_TMPL
if not SETUPTOOLS_VER.startswith('68'):
script = easy_install.get_script_header("") + SCRIPT_TMPL
else:
script = easy_install.ScriptWriter.get_header("") + SCRIPT_TMPL
if PY3:
script = script.encode('ascii')
self.write_script("gnocchi-api", script, 'b')
Expand Down