Red Hat Bugzilla – Bug 971582
setup.py installs alembic binary in wrong Python environment
Last modified: 2015-05-14 19:21:04 EDT
Description of problem:
My app's setup.py installs Alembic as a requirement, but the binary script is installed in wrong Python env during build phase (2.6 instead of 2.7):
(virtenv)[brewlog-zgoda.rhcloud.com 515a90de500446a7d6000007]\> cd $OPENSHIFT_REPO_DIR
(virtenv)[brewlog-zgoda.rhcloud.com repo]\> alembic
Traceback (most recent call last):
File "/var/lib/openshift/515a90de500446a7d6000007/python/virtenv/bin/alembic", line 8, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
Package is installed properly, I can import it from Python shell. Now if i uninstall Alembic package by hand and then install it again using pip everything works fine and I can run alembic migrations.
Am I doing something wrong or just spotted a bug?
Notes from Sumana: I am able to reproduce using user's instructions.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
It's fixed, verified on devenv_3360,please refer to the following results:
1. Create a python-2.7 or python-3.3 app
rhc app create cpy70 python-2.7
2. Install "alembic" package
add "alembic" to "install_requires" in setup.py
git add .; git commit -amp; git push
3. SSH into this app
\> cd $OPENSHIFT_REPO_DIR
\> alembic -h
usage: alembic [-h] [-c CONFIG] [-n NAME]
branches Show current un-spliced branch points
current Display the current revision for each database.
downgrade Revert to a previous version.
history List changeset scripts in chronological order.
init Initialize a new scripts directory.
list_templates List available templates
revision Create a new revision file.
splice 'splice' two branches, creating a new revision file.
this command isn't implemented right now.
stamp 'stamp' the revision table with the given revision;
don't run any migrations.
upgrade Upgrade to a later version.
-h, --help show this help message and exit
-c CONFIG, --config CONFIG
Alternate config file
-n NAME, --name NAME Name of section in .ini file to use for Alembic config