This repository has been archived by the owner on Apr 18, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Patrick Lucas
committed
Oct 18, 2014
1 parent
2d62d6a
commit dee3a36
Showing
6 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include topology_builder/dist/pyleus-base.jar | ||
include pyleus/pyleus-base.jar | ||
include LICENSE | ||
include README.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
from __future__ import absolute_import | ||
|
||
import os | ||
import sys | ||
import pkg_resources | ||
|
||
__version__ = '0.2' | ||
|
||
BASE_JAR = "pyleus-base.jar" | ||
BASE_JAR_INSTALL_DIR = "share/pyleus" | ||
BASE_JAR_PATH = os.path.join(sys.prefix, BASE_JAR_INSTALL_DIR, BASE_JAR) | ||
BASE_JAR_PATH = pkg_resources.resource_filename('pyleus', BASE_JAR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"""This module is used only by pyleus.cli.build._remove_pyleus_base_jar to | ||
determine the value of BASE_JAR_PATH inside _another_ virtualenv, so it can be | ||
removed to save space. | ||
""" | ||
from __future__ import absolute_import | ||
|
||
import pyleus | ||
|
||
if __name__ == '__main__': | ||
print pyleus.BASE_JAR_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters