我是一个超级小组,在这里,在这里,所以请你好!我想写一个公式的项目用于认知心理学研究的背景下; 它可能不会仅仅因为用户群非常狭窄而看到非常广泛的分布; 到目前为止,我刚刚在每个人的计算机上手动安装这个.但它终于得到充分利用,这已不再可行.
我所知道的唯一"Ruby"来自于编写SCSS/Sass,所以我大多只是复制并粘贴成功之类的东西.
在坚果壳中,我试图通过Homebrew分发我已经工作了一段时间的项目.这包括:
我明白:
我不明白:
值得注意的是,我的实验室使用的是Python系统.我并不反对在brew安装的Python版本中运行(实际上我更喜欢它),但是,安装不能导致系统Python停止在命令行使用的默认版本,主要是因为如果用于执行程序的记忆例程失败并且我不能保证他们没有在系统site-packages目录中安装东西(抱歉),那么预期的用户群(即熟练程度非常低的编码器)将会惊慌失措并逃离.
如果其中任何一个不清楚,无论如何向我提出问题,我将很乐意澄清.
这是一个指向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
Run Code Online (Sandbox Code Playgroud)
嗯,homebrew这不是打包和分发代码的最佳媒介(仅限 OSX)。您可能想查看:http://python-packaging-user-guide.readthedocs.org/en/latest/distributing/。取决于您编写代码的方式;您也许可以将您的要求直接放入您的文件中setup.py,而不是将它们放入自制配方中。
至于你正在使用的包不在 PyPI 上;问自己以下问题:
如果您正在管理一个机器场:
chef, puppet, salt, ansible, ...如果您只关心分布:
setuptools+ virtualenv+pip是一个很好的组合。pip能够从 PyPI、github、文件服务器等安装需求