Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix broken installation of package dependencies. #1

Merged
merged 2 commits into from

2 participants

@todddeluca

A common way to break project installation is to import the package in
setup.py in order to get access to mypackage.version. However if
mypackage depends on a different uninstalled package, the import will
fail, causing setup.py to fail before it has a chance to install the
dependency.

The fix is to find some other DRY way to get at version.

For more details see:

Todd DeLuca added some commits
Todd DeLuca Remove package import for version to fix install.
A common way to break project installation is to import the package in
setup.py in order to get access to mypackage.__version__.  However if
mypackage depends on a different uninstalled package, the import will
fail, causing setup.py to fail before it has a chance to install the
dependency.

The fix is to find some other DRY way to get at __version__.

For more details see:

- http://stackoverflow.com/questions/458550/
- http://stackoverflow.com/questions/2058802/
63573cd
Todd DeLuca Use happybase.version in __init__ to stay DRY. 5366974
@wbolster wbolster merged commit 5366974 into from
@wbolster
Owner

Thanks, I've merged your fix and also updated the installation guide in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2012
  1. Remove package import for version to fix install.

    Todd DeLuca authored
    A common way to break project installation is to import the package in
    setup.py in order to get access to mypackage.__version__.  However if
    mypackage depends on a different uninstalled package, the import will
    fail, causing setup.py to fail before it has a chance to install the
    dependency.
    
    The fix is to find some other DRY way to get at __version__.
    
    For more details see:
    
    - http://stackoverflow.com/questions/458550/
    - http://stackoverflow.com/questions/2058802/
  2. Use happybase.version in __init__ to stay DRY.

    Todd DeLuca authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 3 deletions.
  1. +1 −1  happybase/__init__.py
  2. +4 −0 happybase/version.py
  3. +2 −2 setup.py
View
2  happybase/__init__.py
@@ -2,6 +2,6 @@
HappyBase, a pythonic interface for HBase using Thrift
"""
-__version__ = '0.1'
+from .version import __version__
from .api import *
View
4 happybase/version.py
@@ -0,0 +1,4 @@
+
+# package version for user in __init__.py and setup.py
+__version__ = '0.1'
+
View
4 setup.py
@@ -1,10 +1,10 @@
from os.path import join, dirname
from setuptools import find_packages, setup
-import happybase
+execfile('happybase/version.py')
setup(name='happybase',
- version=happybase.__version__,
+ version=__version__,
description="A developer-friendly Python library to interact "
"with Apache HBase",
long_description=open(join(dirname(__file__), 'README.rst')).read(),
Something went wrong with that request. Please try again.