-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitless 0.8.3 initial submission #5519
Conversation
gitless is a CLI that wraps git and provides an alternative workflow without the concept of a staging area. This formula downloads an already compiled binary and simply moves it to the bin directory.
|
||
def install | ||
# The tarball is already compiled. | ||
# No need to do anything but move it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove these comments.
class Gitless < Formula | ||
desc "Gitless: a version control system" | ||
homepage "http://gitless.com/" | ||
url "https://github.com/sdg-mit/gitless/releases/download/v0.8.3/gl-v0.8.3-darwin-x86_64.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use a source tarball and build from source.
test do | ||
# The output of `gl init` has non-ascii characters and will | ||
# cause the test to fail, so we revert to `gl version`. | ||
system "#{bin}/gl" " --version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this test be modified to do something more substantial than e.g. --version
or --help
? See cmake.rb
for an example of an application formula with a good test and tinyxml2.rb
for an example of a library formula with a good test. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please write it as two arguments: system "foo", "bar"
instead of system "foo" " bar"
.
|
||
test do | ||
# The output of `gl init` has non-ascii characters and will | ||
# cause the test to fail, so we revert to `gl version`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this comment
Thanks for the feedback, Mike. I went ahead and read the Python Formula Cookbook to try and learn how to properly write the formula. In particular, I found the poet library especially useful. After modifying the output of the poet, this is formula I came up with for gitless: class Gitless < Formula
include Language::Python::Virtualenv
desc "Gitless: a version control system"
homepage "http://gitless.com/"
url "https://github.com/scottsideleau/gitless/archive/master.tar.gz"
version "0.8.3"
sha256 "df212d6a3d377f90c46d03fd4216ecbbeb40055b62c0fe73b9c3aa165ea8f0af"
depends_on :python if MacOS.version <= :snow_leopard
depends_on "libgit2"
resource "args" do
url "https://files.pythonhosted.org/packages/e5/1c/b701b3f4bd8d3667df8342f311b3efaeab86078a840fb826bd204118cc6b/args-0.1.0.tar.gz"
sha256 "a785b8d837625e9b61c39108532d95b85274acd679693b71ebb5156848fcf814"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/0a/f3/686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a/cffi-1.8.3.tar.gz"
sha256 "c321bd46faa7847261b89c0469569530cad5a41976bb6dba8202c0159f476568"
end
resource "clint" do
url "https://files.pythonhosted.org/packages/3d/b4/41ecb1516f1ba728f39ee7062b9dac1352d39823f513bb6f9e8aeb86e26d/clint-0.5.1.tar.gz"
sha256 "05224c32b1075563d0b16d0015faaf9da43aa214e4a2140e51f08789e7a4c5aa"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/6d/31/666614af3db0acf377876d48688c5d334b6e493b96d21aa7d332169bee50/pycparser-2.14.tar.gz"
sha256 "7959b4a74abdc27b312fed1c21e6caf9309ce0b29ea86b591fd2e99ecdf27f73"
end
resource "pygit2" do
url "https://files.pythonhosted.org/packages/aa/56/84dcce942a48d4b7b970cfb7a779b8db1d904e5ec5f71e7a67a63a23a4e2/pygit2-0.24.1.tar.gz"
sha256 "4d1d0196b38d6012faf0a7c45e235c208315672b6035da504566c605ba494064"
end
resource "sh" do
url "https://files.pythonhosted.org/packages/39/ca/1db6ebefdde0a7b5fb639ebc0527d8aab1cdc6119a8e4ac7c1c0cc222ec5/sh-1.11.tar.gz"
sha256 "590fb9b84abf8b1f560df92d73d87965f1e85c6b8330f8a5f6b336b36f0559a4"
end
resource "six" do
url "https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"
sha256 "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a"
end
def install
virtualenv_install_with_resources
end
test do
system "#{bin}/gl" " --help"
end
end Sadly, I'm now getting installation errors that are beyond my current ability to debug. I read somewhere that this may be due to issues with SIP on Mac OS 10.11+ that prevents homebrew from properly installing Python packages. As far as using a more substantial test besides the There is currently a bug with the way many gitless encodes its output. I will be submitting a pull request with a fix in the very near future. Once that is accepted and the other issues with installation are solved, I would certainly write a better test. |
Instead of the master tarball, you can use the tarball for that tag: https://github.com/scottsideleau/gitless/archive/v0.8.3.tar.gz |
@mistydemeo I had originally done that but with
$ What's the correct way to do it? |
remove |
@knowsuchagency : Pull #45 of the sdg-mit Gitless repository has my build script changes accepted. I would suggest trying to reference that version or see if @spderosso will push a new tag, based on the flurry of recently accepted pulls. |
@@ -0,0 +1,19 @@ | |||
class Gitless < Formula | |||
desc "Gitless: a version control system" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don’t include the formula name in its description.
@scottsideleau I'm still getting the same pip installation error even with your changes, unfortunately
|
I created an experimental 0.8.4 release of gitless (at https://github.com/kontrafiktion/gitless/releases/tag/0.8.4) and the following Formula works for me:
so whenever the gitless projects creates a new release, we can reference that (s.a. gitless-vcs/gitless#50). |
0.8.4 has been released: gitless-vcs/gitless#50 (comment) |
@kontrafiktion I tried the formula you've written but still get this error on installation:
==> Downloading https://files.pythonhosted.org/packages/0a/f3/686af8873b70028f
Already downloaded: /Users/me/Library/Caches/Homebrew/gitless--cffi-1.8.3.tar.gz
==> /usr/local/Cellar/gitless/0.8.4/libexec/bin/pip install -v --no-deps --no-
Last 15 lines from /Users/me/Library/Logs/Homebrew/gitless/04.pip:
Removing source in /tmp/pip-9xqSxG-build
Command "/usr/local/Cellar/gitless/0.8.4/libexec/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-9xqSxG-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mE4iOD-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/gitless/0.8.4/libexec/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-9xqSxG-build/
Exception information:
Traceback (most recent call last):
File "/usr/local/Cellar/gitless/0.8.4/libexec/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/Cellar/gitless/0.8.4/libexec/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/usr/local/Cellar/gitless/0.8.4/libexec/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/usr/local/Cellar/gitless/0.8.4/libexec/lib/python2.7/site-packages/pip/req/req_install.py", line 880, in install
spinner=spinner,
File "/usr/local/Cellar/gitless/0.8.4/libexec/lib/python2.7/site-packages/pip/utils/__init__.py", line 718, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command "/usr/local/Cellar/gitless/0.8.4/libexec/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-9xqSxG-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-mE4iOD-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/gitless/0.8.4/libexec/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-9xqSxG-build/ |
@knowsuchagency I have no idea. Could you please check that your versions of |
perhaps someone else is interested in trying this out:
or should I create a new PR? |
@knowsuchagency could please post the content of ~/Library/Logs/Homebrew/gitless (as a Gist)? |
@kontrafiktion here are the logs I don't mind if you submit another pull request, I just want the formula to work for people on either sierra or el capitan. |
@knowsuchagency please try
and then try installing gitless again And please check whether you have installed libffi (using
if the latter is the problem, that has to be added as a dependency to the Formula |
Following the gitless v0.8.4 release, I can install via Homebrew's pip3.5 for Homebrew's python3.5 on MacOS 10.11 (El Capitan) without error. I've updated the bottle that I was working on to use the new release. https://github.com/scottsideleau/homebrew-sideleau/blob/master/gitless.rb It appears to work, but I get an "Error: Empty installation" message. Interestingly, the installation was completed successfully (i.e. I can do "gl --version" and gitless is there report v0.8.4, as expected). I verified that gitless was uninstalled ("pip3.5 uninstall gitless") in-between trial runs with my bottle. Any thoughts on pruning the error message? |
@scottsideleau I do not know enough about creating Formulas, but I found this: #1450 (comment) |
@kontrafiktion Could you try and open a pull request? This document should help and I'm happy to walk you through anything else. Thanks! |
@MikeMcQuaid done: see #6194 |
@kontrafiktion Thanks for submitting the new pull request. I just tried installing gitless on my machine from the new formula and it worked like a charm. You da best :) |
I have read the submission guidelines and tried to ensure the pull request follows code style guidelines and passes tests.
I have checked to see that no one else has submitted a pull request for gitless.
The formula seems to install properly and passes tests.
The formula has passed audits using the flags
new-formula
,online
, andstrict
.Please let me know if there is anything else I can do to help get this merged.
Thanks!
gitless is a CLI that wraps git and provides an alternative
workflow without the concept of a staging area.
This formula downloads an already compiled binary and simply moves it
to the bin directory.