我是一个超级块头,在上下文中,在这里,所以请友好!我想为之编写一个公式的项目是在认知心理学研究的背景下使用的;它可能不会,仅仅因为用户群非常狭窄而出现一个非常广泛的分布;到目前为止,我只是在每个人的电脑上手动安装这个程序。但它最终得到充分利用,这不再可行。在
我唯一知道的“Ruby”是从编写scs/Sass开始的,所以我基本上只是复制和粘贴我的方法来获得成功。在
简而言之,我正试图通过自制程序发布一个我已经工作了一段时间的项目。它包括:
我明白:
我不明白:
值得注意的是,我的实验室使用的是Python系统。我不反对在安装了brew的Python版本中运行(实际上我更喜欢它),但是,安装不会导致系统Python不再是命令行中使用的默认版本,主要是因为预期的用户群(即,低水平的程序员)会惊慌失措,如果他们执行程序的记忆例程失败,我不能保证他们没有在系统站点包目录中安装东西(抱歉)。在
如果有任何不清楚的地方,一定会向我提出问题,我很乐意澄清。在
Here's指向Git存储库的链接,以引用项目的目录结构。在
到目前为止,我的剧本不是很大,以下是我所得到的:
class Klibs < Formula
desc ""
homepage ""
url "https://github.com/jmwmulle/klibs/archive/0.9.1.4.tar.gz"
version "0.9.1.4"
# sha256 is wrong; just been editing the local cache while I learn how to do this properly :S
# (in case anyone tries to brew create the repository and notices)
sha256 "d854b85fc6fae58a9f6d046c206a73ac8c5948e89740cd55c02450e1ba9af0e0"
depends_on :python if MacOS.version <= :snow_leopard
depends_on "sdl2" => :required
# bunch of other brewable dependencies
resource "PySDL2" do
url "https://pypi.python.org/packages/source/P/PySDL2/PySDL2-0.9.3.zip"
sha1 "030f2351d1da387f878e14c8a86e08571d7baf5b"
end
# ...bunch of other python modules
resource "AggDraw" do # note that this one's not hosted by PyPi
url "https://github.com/preo/aggdraw.git"
sha1 "92e5e75aaaf5c535735d974764472e7e4d8e5cb0"
end
def install
resource("PySDL2").stage { system "python", *Language::Python.setup_install_args(libexec/"vendor") }
# and, again, more python modules
cd "klibs" do
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
cd "lib/pylink" do
cd "frameworks/eyelink" do
frameworks.install("eyelink_core_graphics.framework")
frameworks.install("eyelink_core.framework")
end
# this next part I *know* must be wrong, I'm just not sure how to achieve
# this the homebrew way and thought I'd at least demonstrate what
# I need to do; this is a pre-compiled, third-party python module
# that is not distributed by any other means
system "cp", "-r", "pylink", "#{libexec}/lib/python2.7/site-packages"
system "ln", "-s", "#{libexec}/lib/python2.7/site-packages/pylink"
end
system "python", "setup.py", "install", "--prefix=#{prefix}"
end
bin.install("bin/klibs")
lib.install("lib/klibs")
end
test do
system "false"
end
end
嗯,} 放入而不是将它们放入自制配方中。在
homebrew
不是打包和分发代码的最佳媒介(仅限OSX)。 你可能想看看:http://python-packaging-user-guide.readthedocs.org/en/latest/distributing/。根据您编写代码的方式,您可能可以将requirements directly in your ^{对于您正在使用的不在PyPI上的包,请自问以下问题:
使机器符合特定配置
如果您管理的是机器农场:
chef
,puppet
,salt
,ansible
。。。在如果你只关心分布:
setuptools
+virtualenv
+pip
组合得很好。在pip
能够从PyPI、github、文件服务器等安装需求。。。在相关问题 更多 >
编程相关推荐