Fix bash-completion goal when run from sdist/pex. Also add tests, and beef up ci.sh & release.sh

Review Request #2403 - Created June 21, 2015 and submitted

Information
Andy Reitz
pants
db3b16c...
Reviewers
pants-reviews
benjyw, ity, jsirois, patricklaw, stuhood, zundel

When running the latest pants from a PEX inside of Twitter, I noticed that the new bash-completion goal didn't work. This sort of error is actually hard to detect, so I added the ability to test releases, and then used this to show that my fix for bash-completion is correct.

New output from release.sh:

...
[== 00:57 Installing and testing package pantsbuild.pants.contrib.spindle-0.0.33 ... ==]

You are using pip version 6.1.1, however version 7.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.hizmtZzH/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
INFO] Detected git repository at /Users/andyr/workspace/pants on branch master

Optional: If you want to poke around with the new version of pants that has been
built and installed in a temporary virtualenv, fire up another shell window and
type:

  source /var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.hizmtZzH/bin/activate
  cd /Users/andyr/workspace/pants

From there, you can run 'pants' (not './pants') to do some testing.

When you're done testing, press enter to continue.


[== 01:12 Dry run release succeeded. ==]
...

Running release.sh -t venv:

This will test pantsbuild.pants==0.0.33:

(pants.XXXXX.r6ax6tyS)[drift pants (master)]$ pants bash-completion
INFO] Detected git repository at /Users/andyr/workspace/pants on branch master


Exception caught:
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/bin/pants", line 9, in <module>
    load_entry_point('pantsbuild.pants==0.0.33', 'console_scripts', 'pants')()
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 81, in main
    _run(exiter)
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 74, in _run
    result = goal_runner.run()
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 218, in run
    result = self._do_run()
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 275, in _do_run
    return engine.execute(context, self.goals)
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/engine/engine.py", line 26, in execute
    self.attempt(context, goals)
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/engine/round_engine.py", line 212, in attempt
    goal_executor.attempt(explain)
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/engine/round_engine.py", line 45, in attempt
    task.execute()
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/backend/core/tasks/console_task.py", line 56, in execute
    for value in self.console_output(targets):
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/backend/core/tasks/bash_completion.py", line 111, in console_output
    resource_string(__name__, os.path.join('templates', 'bash_completion', 'autocomplete.sh.mustache')),
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pkg_resources.py", line 966, in resource_string
    self, resource_name
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pkg_resources.py", line 1393, in get_resource_string
    return self._get(self._fn(self.module_path, resource_name))
  File "/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pkg_resources.py", line 1514, in _get
    with open(path, 'rb') as stream:

Exception message: [Errno 2] No such file or directory: u'/var/folders/1c/zrk9_1hs2k16fkxssdx800gr0000gn/T/pants.XXXXX.r6ax6tyS/lib/python2.7/site-packages/pants/backend/core/tasks/templates/bash_completion/autocomplete.sh.mustache'

Running release.sh -n venv:

This will build new sdists off of HEAD, and install them in a virtualenv:

(pants.XXXXX.mYzg1nQq)[drift pants (master)]$ pants bash-completion
INFO] Detected git repository at /Users/andyr/workspace/pants on branch master
#!/bin/bash
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).

Issues

  • 0
  • 3
  • 0
  • 3
Description From Last Updated
John Sirois
Andy Reitz
Andy Reitz
Eric Ayers
Andy Reitz
Andy Reitz
Stu Hood
Stu Hood
Andy Reitz
Tom Dyas
Eric Ayers
Andy Reitz
Andy Reitz
Review request changed

Status: Closed (submitted)

Andy Reitz

Thanks folks, submitted @ 31c182098734ac4cb0a90e81d22d3b4704ec75e1

Loading...