Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

'pip install pyleus' installs pyleus-base.jar under /usr/local on some systems #24

Closed
patricklucas opened this issue Oct 17, 2014 · 0 comments · Fixed by #27
Closed
Milestone

Comments

@patricklucas
Copy link
Contributor

I believe we ran into this at some point in the past and solved it, or so we thought.

I can reproduce this under docker:

$ docker run --rm -t -i ubuntu:trusty /bin/bash
root@6bd01ed07d4a:/# apt-get update
...
root@6bd01ed07d4a:/# apt-get install -y python-pip
...
root@6bd01ed07d4a:/# pip install pyleus
...
root@6bd01ed07d4a:/# ls /usr/share/pyl^C
root@6bd01ed07d4a:/# ls /usr/local/share/pyleus/
pyleus-base.jar

Everything works fine if you install and run Pyleus in a virtualenv, though:

root@6bd01ed07d4a:/root# virtualenv venv
New python executable in venv/bin/python
Installing setuptools, pip...done.
root@6bd01ed07d4a:/root# venv/bin/pip install pyleus
...
root@6bd01ed07d4a:/root# venv/bin/python -c 'import pyleus; print pyleus.BASE_JAR_PATH'
/root/venv/share/pyleus/pyleus-base.jar
root@6bd01ed07d4a:/root# ls -lh /root/venv/share/pyleus/pyleus-base.jar
-rw-r--r-- 1 root root 19M Oct 17 20:58 /root/venv/share/pyleus/pyleus-base.jar
@patricklucas patricklucas self-assigned this Oct 17, 2014
patricklucas pushed a commit to patricklucas/pyleus that referenced this issue Oct 18, 2014
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 was 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 Yelp#24
patricklucas pushed a commit to patricklucas/pyleus that referenced this issue Oct 18, 2014
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 was 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 Yelp#24
patricklucas pushed a commit to patricklucas/pyleus that referenced this issue Oct 18, 2014
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 Yelp#24
@patricklucas patricklucas modified the milestones: v0.2.2, v0.2.1 Oct 24, 2014
@patricklucas patricklucas removed their assignment May 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant