Skip to content
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

Closed
wants to merge 1 commit into from
Closed

gitless 0.8.3 initial submission #5519

wants to merge 1 commit into from

Conversation

knowsuchagency
Copy link

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, and strict.

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.

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.
Copy link
Member

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"
Copy link
Member

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"
Copy link
Member

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!

Copy link
Contributor

@bfontaine bfontaine Oct 5, 2016

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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment

@knowsuchagency
Copy link
Author

knowsuchagency commented Oct 3, 2016

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 --version flag, it seems --help will work.

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.

@mistydemeo
Copy link
Member

url "https://github.com/scottsideleau/gitless/archive/master.tar.gz"
version "0.8.3"

Instead of the master tarball, you can use the tarball for that tag: https://github.com/scottsideleau/gitless/archive/v0.8.3.tar.gz

@knowsuchagency
Copy link
Author

knowsuchagency commented Oct 4, 2016

@mistydemeo I had originally done that but with

url "https://github.com/scottsideleau/gitless/archive/v0.8.3.tar.gz"
version "0.8.3"

$brew audit --strict --online --new-formula gitless
outputs
Stable: version 0.8.3 is redundant with version scanned from URL

What's the correct way to do it?

@benjaminfrank
Copy link
Contributor

remove version "0.8.3" from your formula

@scottsideleau
Copy link

@knowsuchagency : Pull #45 of the sdg-mit Gitless repository has my build script changes accepted.

gitless-vcs/gitless#45

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.

@bfontaine bfontaine added the new formula PR adds a new formula to Homebrew/homebrew-core label Oct 4, 2016
@@ -0,0 +1,19 @@
class Gitless < Formula
desc "Gitless: a version control system"
Copy link
Contributor

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.

@knowsuchagency
Copy link
Author

@scottsideleau I'm still getting the same pip installation error even with your changes, unfortunately

Removing source in /tmp/pip-iMUdBz-build
Command "/usr/local/Cellar/gitless/0.8.3/libexec/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-iMUdBz-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-AqYhD_-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/gitless/0.8.3/libexec/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-iMUdBz-build/
Exception information:
Traceback (most recent call last):
  File "/usr/local/Cellar/gitless/0.8.3/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.3/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.3/libexec/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
    **kwargs
  File "/usr/local/Cellar/gitless/0.8.3/libexec/lib/python2.7/site-packages/pip/req/req_install.py", line 880, in install
    spinner=spinner,
  File "/usr/local/Cellar/gitless/0.8.3/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.3/libexec/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-iMUdBz-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-AqYhD_-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/Cellar/gitless/0.8.3/libexec/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-iMUdBz-build/

@kontrafiktion
Copy link
Contributor

kontrafiktion commented Oct 9, 2016

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:

class Gitless < Formula

  include Language::Python::Virtualenv

  desc "a simplified version control system on top of git"
  homepage "http://gitless.com/"
  url "https://github.com/kontrafiktion/gitless/archive/0.8.4.tar.gz"
  sha256 "66fb53c17e989b186d5f25aae6e8b04d38b1c1c5fdf43c54eb3e710482aacdb3"

  head "https://github.com/sdg-mit/gitless.git", :branch => "master"

  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

so whenever the gitless projects creates a new release, we can reference that (s.a. gitless-vcs/gitless#50).

@kontrafiktion
Copy link
Contributor

0.8.4 has been released: gitless-vcs/gitless#50 (comment)

@knowsuchagency
Copy link
Author

@kontrafiktion I tried the formula you've written but still get this error on installation:

Sierra 10.12

==> 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/

@kontrafiktion
Copy link
Contributor

kontrafiktion commented Oct 15, 2016

@knowsuchagency I have no idea. Could you please check that your versions of virtualenv, python, and pip are up to date.
Perhaps Homebrew hides some more error information. If you are using OS X's own python perhaps python/pip cannot find the "Python.h" file. What happens if you install gitless via pip?
Perhaps it is a "Sierra" thing (I am still on "El Capitan")?
One last idea: I recently had to "accept the XCode license" again after updating XCode. Perhaps that error is hidden (I assume cffi needs XCode)?

@dunn dunn added help wanted Task(s) needing PRs from the community or maintainers python Python use is a significant feature of the PR or issue labels Oct 19, 2016
@kontrafiktion
Copy link
Contributor

kontrafiktion commented Oct 20, 2016

perhaps someone else is interested in trying this out:

class Gitless < Formula

  include Language::Python::Virtualenv

  desc "a simplified version control system on top of git"
  homepage "http://gitless.com/"
  url "https://github.com/sdg-mit/gitless/archive/v0.8.4.tar.gz"
  sha256 "ecde4887eb20109a0345a1bfee420140522f981deff335d552908a00952853c8"

  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

or should I create a new PR?
@knowsuchagency I wouldn't want to do that without your permission

@kontrafiktion
Copy link
Contributor

@knowsuchagency could please post the content of ~/Library/Logs/Homebrew/gitless (as a Gist)?

@knowsuchagency
Copy link
Author

@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.

@kontrafiktion
Copy link
Contributor

kontrafiktion commented Oct 20, 2016

@knowsuchagency please try

xcode-select --install

and then try installing gitless again
(see http://stackoverflow.com/questions/27740044/pip-cffi-package-installation-failed-on-osx)

And please check whether you have installed libffi (using brew list), otherwise install it with

brew install libffi

if the latter is the problem, that has to be added as a dependency to the Formula

@scottsideleau
Copy link

scottsideleau commented Oct 21, 2016

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?

@kontrafiktion
Copy link
Contributor

@scottsideleau I do not know enough about creating Formulas, but I found this: #1450 (comment)

@MikeMcQuaid
Copy link
Member

@kontrafiktion Could you try and open a pull request? This document should help and I'm happy to walk you through anything else.

Thanks!

@kontrafiktion kontrafiktion mentioned this pull request Oct 23, 2016
4 tasks
@kontrafiktion
Copy link
Contributor

kontrafiktion commented Oct 23, 2016

@MikeMcQuaid done: see #6194
B.t.w. I like the sound of "... and I'm happy to walk you through anything else." Reduced the hurdle to contribute significantly.

@knowsuchagency
Copy link
Author

@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 :)

@knowsuchagency knowsuchagency deleted the gitless branch October 24, 2016 21:24
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Task(s) needing PRs from the community or maintainers new formula PR adds a new formula to Homebrew/homebrew-core python Python use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants