diff options
author | Florian Bruhin <git@the-compiler.org> | 2014-05-15 07:13:49 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2014-05-15 07:13:49 +0200 |
commit | 765e20f881ea27203d7be8cc150e62a4d6c7c3c7 (patch) | |
tree | 397081e47cd5c3822522b0a43543c7d2e834327a /setup.py | |
parent | 1922f51e21fa42ad06934585003b028e2ad1ed1a (diff) | |
download | qutebrowser-765e20f881ea27203d7be8cc150e62a4d6c7c3c7.tar.gz qutebrowser-765e20f881ea27203d7be8cc150e62a4d6c7c3c7.zip |
Try to preserve git commit id with setup.py/freeze.py
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 36 |
1 files changed, 26 insertions, 10 deletions
@@ -18,20 +18,36 @@ """setuptools installer script for qutebrowser""" +import os +import os.path -from scripts.setupcommon import setupdata +from scripts.setupcommon import setupdata, write_git_file from scripts.ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages -setup( - packages=find_packages(exclude=['qutebrowser.test']), - include_package_data=True, - package_data={'qutebrowser': ['html/*']}, - entry_points={'gui_scripts': ['qutebrowser = qutebrowser.__main__:main']}, - test_suite='qutebrowser.test', - zip_safe=True, - **setupdata -) +try: + BASEDIR = os.path.dirname(os.path.realpath(__file__)) +except NameError: + BASEDIR = None + + +try: + write_git_file() + setup( + packages=find_packages(exclude=['qutebrowser.test']), + include_package_data=True, + package_data={'qutebrowser': ['html/*', 'git-commit-id']}, + entry_points={'gui_scripts': + ['qutebrowser = qutebrowser.__main__:main']}, + test_suite='qutebrowser.test', + zip_safe=True, + **setupdata + ) +finally: + if BASEDIR is not None: + path = os.path.join(BASEDIR, 'qutebrowser', 'git-commit-id') + if os.path.exists(path): + os.remove(path) |