在Heroku中获得正确的依赖

时间:2013-06-22 22:34:05

标签: python django heroku pip

我正在努力让Heroku取得editable dependency(即-e git://github.com/merlinares/django-registration.git#egg=django-registration)点数要求。

但是,即使它似乎在部署时使用了该分支,但它实际上并没有使用它。我已使用heroku run cat .heroku/python/lib/python2.7/site-packages/registration/forms.py检查了site-packages中的代码,但它不包含新代码,只是使用之前安装的默认django-registration软件包。

但是,分叉版本似乎存在于django-registration.egg-link指定的目录中,该目录名为:

/app/.heroku/src/django-registration

在部署(即git push heroku master)时,我看到:

-----> Installing dependencies using Pip (1.3.1)

   Obtaining django-registration from git+git://github.com/mattlinares/django-registration.git#egg=django-registration (from -r requirements.txt (line 12))
     Updating ./.heroku/src/django-registration clone
     Running setup.py egg_info for package django-registration

   Installing collected packages: django-registration

     Running setup.py develop for django-registration

       Creating /app/.heroku/python/lib/python2.7/site-packages/django-registration.egg-link (link to .)
       django-registration 0.8-alpha-1 is already the active version in easy-install.pth

       Installed /app/.heroku/src/django-registration
   Successfully installed django-insensitive django-registration
   Cleaning up...

我还手动尝试卸载并安装该特定的fork,具有以下效果:

(ssc)~/code/django/ssc: heroku run pip install --upgrade git+git://github.com/mattlinares/django-registration.git
Running `pip install --upgrade git+git://github.com/mattlinares/django-registration.git` attached to terminal... up, run.5704
Downloading/unpacking git+git://github.com/mattlinares/django-registration.git
  Cloning git://github.com/mattlinares/django-registration.git to /tmp/pip-qpTF2t-build
  Running setup.py egg_info for package from git+git://github.com/mattlinares/django-registration.git

Installing collected packages: django-registration
  Found existing installation: django-registration 0.8-alpha-1
    Uninstalling django-registration:
      Successfully uninstalled django-registration
  Running setup.py install for django-registration

Successfully installed django-registration
Cleaning up...

然而我的应用程序没有使用registration的版本我试图提供它。我怀疑用heroku run ls .heroku/python/lib/python2.7/site-packages列出的鸡蛋:

django_registration-0.8-py2.7.egg-info        registration

的django-registration.egg链路

我也试图按照how to pip uninstall with virtualenv on heroku cedar stack?清除整个virtualenv而没有运气

我该怎么办?

1 个答案:

答案 0 :(得分:0)

使用可编辑的依赖项时,必须定义标签或提交哈希。

按照您的示例:

-e git+https://github.com/merlinares/django-registration.git@3.1#egg=django-registration

-e git+https://github.com/merlinares/django-registration.git@40fee813ca444236da6d66f516b869fd8ebbe9cd#egg=django-registration