我正在尝试使冲泡配方起作用。它安装了一个Python脚本,该脚本对包括psycopg2在内的常见库有2个依赖性。 .tar.gz包含有效的setup.py
。
我的.rb公式如下:
class Asdf < Formula
include Language::Python::Virtualenv
homepage "https://my-homepage"
url "https://github.com/asdf/asdf/raw/master/asdf-1.0.tar.gz"
sha256 "a working sha"
version "1.0"
depends_on "python@2"
depends_on "postgresql"
bottle :unneeded
resource "redacted"
(etc)
resource "psycopg2" do
url "https://files.pythonhosted.org/packages/c0/07/93573b97ed61b6fb907c8439bf58f09957564cf7c39612cef36c547e68c6/psycopg2-2.7.6.1.tar.gz"
sha256 "27959abe64ca1fc6d8cd11a71a1f421d8287831a3262bd4cacd43bbf43cc3c82"
end
def install
virtualenv_install_with_resources
end
test do
system bin/"asdf", "--help"
end
end
我得到日志输出:
==> Installing asdf from asdf/asdf
==> Downloading https://github.com/asdf/asdf/raw/master/asdf-1.tar.gz
Already downloaded: /Users/asdf/Library/Caches/Homebrew/downloads/sha--asdf-1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/37/db/sha/virtualenv-16.4.3.tar.gz
Already downloaded: /Users/asdf/Library/Caches/Homebrew/downloads/sha--virtualenv-16.4.3.tar.gz
==> python2 -c import setuptools... --no-user-cfg install --prefix=/private/tmp/asdf--homebrew-virtualenv-20190327-8864-er08i7/target --install-scripts=/private/tmp/asdf--homebrew-vi
==> python2 -s /private/tmp/asdf--homebrew-virtualenv-20190327-8864-er08i7/target/bin/virtualenv -p python2 /usr/local/Cellar/asdf/1.0.0/libexec
==> Downloading https://files.pythonhosted.org/packages/c0/07/93573b97ed61b6fb907c8439bf58f09957564cf7c39612cef36c547e68c6/psycopg2-2.7.6.1.tar.gz
Already downloaded: /Users/asdf/Library/Caches/Homebrew/downloads/2e85a2e4c99e7531cc7b15f878ebfe254082386c495a470b63a9711a8bbdafec--psycopg2-2.7.6.1.tar.gz
==> /usr/local/Cellar/asdf/1.0.0/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/asdf--psycopg2-20190327-8864-hnm0au/psycopg2-2.7.6.1
==> /usr/local/Cellar/asdf/1.0.0/libexec/bin/pip install -v --no-deps --no-binary :all: --ignore-installed /private/tmp/asdf-20190327-1234-1abce
Last 15 lines from /Users/asdf/Library/Logs/Homebrew/asdf/05.pip:
Created temporary directory: /private/tmp/pip-install-PAhyP8
Cleaning up...
Removed build tracker '/private/tmp/pip-req-tracker-JFqLxc'
Directory '/private/tmp/asdf-20190327-1234-1abcde' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
Exception information:
Traceback (most recent call last):
File "/usr/local/Cellar/asdf/1.0/libexec/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 179, in main
status = self.run(options, args)
File "/usr/local/Cellar/asdf/1.0/libexec/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 289, in run
self.name, wheel_cache
File "/usr/local/Cellar/asdf/1.0/libexec/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 269, in populate_requirement_set
wheel_cache=wheel_cache
File "/usr/local/Cellar/asdf/1.0/libexec/lib/python2.7/site-packages/pip/_internal/req/constructors.py", line 248, in install_req_from_line
"nor 'pyproject.toml' found." % name
InstallationError: Directory '/private/tmp/asdf-20190327-1234-1abcde' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/asdf/asdf/issues
软件包中显然包含一个有效的setup.py
文件。我可以检查一下。
$ wget https://github.com/asdf/asdf/raw/master/asdf-1.0.tar.gz
(etc etc)
$ tar -ztvf asdf-1.0.tar.gz
-rwxr-xr-x 0 asdf staff 5527 Mar 27 15:01 asdf.py
-rw-r--r-- 0 asdf staff 1825 Mar 27 14:07 README.md
-rw-r--r-- 0 asdf staff 505 Mar 27 15:07 setup.py
我找不到与此错误有关的其他参考。我可能做错了什么?
答案 0 :(得分:0)
错误是因为自制软件期望包括setup.py
在内的所有文件都位于.tar.gz内名为asdf-1/
的子文件夹中