Yelp / pyleus

Pyleus is a Python framework for developing and launching Storm topologies.
Apache License 2.0
403 stars 107 forks source link

Fix base jar installation #27

Closed patricklucas closed 10 years ago

patricklucas commented 10 years ago

Previously, pyleus-base.jar was installed to sys.prefix + '/share/pyleus/ pyleus-base.jar', and this worked fine when Pyleus was installed in a virtualenv or via an fpm-created deb. In the former case, the jar was installed to $VIRTUAL_ENV/share/pyleus/pyleus-base.jar, and in the latter, it made its way to /usr/share/pyleus/pyleus-base.jar.

However, if a user just ran 'pip install pyleus' on their system, the jar would actually be installed to /usr/local/share/pyleus/pyleus-base.jar, even though sys.prefix was just '/usr' when pyleus was executed.

Pyleus would thus look in /usr/share/pyleus and fail when it couldn't find the base jar.

This change uses the seemingly preferred method of including the jar within the package itself, and using the pkg_resources module to construct its filesystem path.

The build step of removing the base jar from a topology jar (since it is unneeded and takes up space) required modification as well.

Closes #24

patricklucas commented 10 years ago

The rebase was to correct a typo in the commit message.

baris commented 10 years ago

lgtm. ship it!