如何使用buildout安装django-haystack

时间:2022-03-23 23:47:44

I'm trying to convert a current Django project in development to use zc.buildout So far, I've got all the bits figured except for Haystack figured out.

我正在尝试将开发中的当前Django项目转换为使用zc.buildout到目前为止,除了Haystack想出来之外,我已经得到了所有的数据。

The Haystack source is available on GitHub, but I don't want to force users to install git. A suitable alternative seems to be to fetch a tarball from here

Haystack源代码可以在GitHub上找到,但我不想强迫用户安装git。一个合适的替代方案似乎是从这里获取tarball

That tarball contains a setuptools setup.py, and it seems like it should be so easy to get buildout to install it. Halp!

该tarball包含一个setuptools setup.py,似乎应该很容易得到buildout来安装它。 HALP!

4 个解决方案

#1


It seems they've fixed the package to work from the tarball. James' fork is not working right now, but you can use the same recipe passing it the standard url:

看来他们已经修复了这个包来从tarball中解决问题。詹姆斯的叉子现在不能正常工作,但你可以使用相同的食谱传递标准网址:

[haystack]
recipe = collective.recipe.distutils
url = http://github.com/toastdriven/django-haystack/tarball/master

This worked for me and is 100% hack free.

这对我有用,并且100%无黑客。

#2


I figured this one out, without posting it to PyPI. (There is no actually tagged release version of django-haystack, so posting to to PyPI seems unclean. It's something the maintainer should and probably will handle better themselves.)

我想出了这个,没有发布到PyPI。 (django-haystack没有实际标记的发布版本,因此发布到PyPI似乎是不洁净的。这是维护者应该并且可能会更好地自己处理的东西。)

The relevant section is as follows:

相关部分如下:

[haystack]
recipe = collective.recipe.distutils
url = http://github.com/ephelon/django-haystack/tarball/master

I had to create a fork of the project to remove zip_safe=False from setup.py. Once I'd done that the above works flawlessly, even the redirect sent by the above url.

我必须创建一个项目的fork来从setup.py中删除zip_safe = False。一旦我完成了上述工作,上面的工作完美无瑕,甚至上面的网址发送的重定向。

#3


This currently works for me without forking.

这目前适用于我而不用分叉。

[django-haystack]
recipe = zerokspot.recipe.git
repository = git://github.com/toastdriven/django-haystack.git
as_egg = true

[whoosh]
recipe = zerokspot.recipe.git
repository = git://github.com/toastdriven/whoosh.git
branch = haystacked
as_egg = true

Make sure you add the locations to your extra-paths.

确保将位置添加到额外路径。

#4


Well, if you don't want to install GIT, you can't check it out. So then you have to download a release. But there aren't any. In theory, find-links directly to the distribution should work. In this case it wont, probably because you don't link to the file, but to a page that generates the file from the trunk. So that option was out.

好吧,如果你不想安装GIT,你就无法检查出来。那么你必须下载一个版本。但是没有。从理论上讲,直接查找分布链接应该有效。在这种情况下,它不会,可能是因为您没有链接到文件,而是链接到从主干生成文件的页面。所以那个选项已经出来了。

So, you need to bribe somebody to make a release, or make one yourself. You can make a release and stick it in a file server somewhere, and then use find-links in the buildout to point to the right place.

所以,你需要贿赂某人来发布,或者自己制作一个。您可以发布一个版本并将其粘贴到某个文件服务器中,然后使用buildout中的find-links指向正确的位置。

Or, since nobody else seems to have released Haystack to PyPI, you can do it! (But be nice and tell the developers and give them manager rights to the package as well).

或者,由于似乎没有其他人将Haystack发布给PyPI,你可以做到! (但要好好告诉开发人员并给他们经理权利)。

#1


It seems they've fixed the package to work from the tarball. James' fork is not working right now, but you can use the same recipe passing it the standard url:

看来他们已经修复了这个包来从tarball中解决问题。詹姆斯的叉子现在不能正常工作,但你可以使用相同的食谱传递标准网址:

[haystack]
recipe = collective.recipe.distutils
url = http://github.com/toastdriven/django-haystack/tarball/master

This worked for me and is 100% hack free.

这对我有用,并且100%无黑客。

#2


I figured this one out, without posting it to PyPI. (There is no actually tagged release version of django-haystack, so posting to to PyPI seems unclean. It's something the maintainer should and probably will handle better themselves.)

我想出了这个,没有发布到PyPI。 (django-haystack没有实际标记的发布版本,因此发布到PyPI似乎是不洁净的。这是维护者应该并且可能会更好地自己处理的东西。)

The relevant section is as follows:

相关部分如下:

[haystack]
recipe = collective.recipe.distutils
url = http://github.com/ephelon/django-haystack/tarball/master

I had to create a fork of the project to remove zip_safe=False from setup.py. Once I'd done that the above works flawlessly, even the redirect sent by the above url.

我必须创建一个项目的fork来从setup.py中删除zip_safe = False。一旦我完成了上述工作,上面的工作完美无瑕,甚至上面的网址发送的重定向。

#3


This currently works for me without forking.

这目前适用于我而不用分叉。

[django-haystack]
recipe = zerokspot.recipe.git
repository = git://github.com/toastdriven/django-haystack.git
as_egg = true

[whoosh]
recipe = zerokspot.recipe.git
repository = git://github.com/toastdriven/whoosh.git
branch = haystacked
as_egg = true

Make sure you add the locations to your extra-paths.

确保将位置添加到额外路径。

#4


Well, if you don't want to install GIT, you can't check it out. So then you have to download a release. But there aren't any. In theory, find-links directly to the distribution should work. In this case it wont, probably because you don't link to the file, but to a page that generates the file from the trunk. So that option was out.

好吧,如果你不想安装GIT,你就无法检查出来。那么你必须下载一个版本。但是没有。从理论上讲,直接查找分布链接应该有效。在这种情况下,它不会,可能是因为您没有链接到文件,而是链接到从主干生成文件的页面。所以那个选项已经出来了。

So, you need to bribe somebody to make a release, or make one yourself. You can make a release and stick it in a file server somewhere, and then use find-links in the buildout to point to the right place.

所以,你需要贿赂某人来发布,或者自己制作一个。您可以发布一个版本并将其粘贴到某个文件服务器中,然后使用buildout中的find-links指向正确的位置。

Or, since nobody else seems to have released Haystack to PyPI, you can do it! (But be nice and tell the developers and give them manager rights to the package as well).

或者,由于似乎没有其他人将Haystack发布给PyPI,你可以做到! (但要好好告诉开发人员并给他们经理权利)。