prezi / snakebasket

A smarter, recursive pip.
84 stars 4 forks source link

Fix two issues with dealing with git editable packages #13

Closed stanhu closed 10 years ago

stanhu commented 10 years ago

1) Fix issue #12 by doing a comparison of unique packages

2) Ignore untracked files when deciding whether there are uncommitted git changes

stanhu commented 10 years ago

Ok, so fb35baf breaks test_no_upgrade_editable_if_uncommitted_new_file().

I'm curious to hear thoughts on this. There are two cases I see when looking at a git repository that has untracked files:

1) Uncommitted new files 2) Built files that aren't in the .gitignore

It seems that it's more likely that case number 2, which is why I disabled looking at untracked files.

stanhu commented 10 years ago

pip v1.5.4 changes are more complex than I thought; pip 1.5 adds support for wheels, which need to be handled in snakebasket properly.

dtorok commented 10 years ago

Sorry for reverting the merge, but the pull request broke a few tests.

stanhu commented 10 years ago

Which tests are broken? I found that the ones that were broken were due to the pypi mirrors going away, which was fixed by going to pip 1.4+.

neumark commented 10 years ago

This is how we run the tests (after you active a virtualenv which has the packages in requirements-tests.txt installed):

cd snakebasket/tests python runtests.py --verbose

This is the output we get from jenkins:

FAIL: Test installing a package from the PyPI mirrors.

Traceback (most recent call last): File "/var/lib/jenkins/workspace/snakebasket/test-venv/lib/python2.6/site-packages/nose/case.py", line 197, in runTest self.test(_self.arg) File "/var/lib/jenkins/workspace/snakebasket/tests/test_basic.py", line 96, in test_install_from_mirrors result = run_pip('install', '-vvv', '--use-mirrors', '--no-index', 'INITools==0.2') File "/var/lib/jenkins/workspace/snakebasket/tests/test_pip.py", line 546, in run_pip result = env.run('sb', args, _kw) File "/var/lib/jenkins/workspace/snakebasket/tests/test_pip.py", line 395, in run return TestPipResult(super(TestPipEnvironment, self).run(cwd=cwd, _args, *_kw), verbose=self.verbose) File "/var/lib/jenkins/workspace/snakebasket/test-venv/lib/python2.6/site-packages/scripttest/init.py", line 255, in run result.assert_no_error(quiet) File "/var/lib/jenkins/workspace/snakebasket/test-venv/lib/python2.6/site-packages/scripttest/init.py", line 402, in assert_no_error "Script returned code: %s" % self.returncode) AssertionError: Script returned code: 1 -------------------- >> begin captured stdout << --------------------- Script result: sb install -vvv --use-mirrors --no-index INITools==0.2 return code: 1 -- stdout: -------------------- Ignoring indexes: https://pypi.python.org/simple/ Using PyPI mirrors: Downloading/unpacking INITools==0.2 URLs to search for versions for INITools==0.2: Could not find any downloads that satisfy the requirement INITools==0.2 No distributions at all found for INITools==0.2 Exception information: Traceback (most recent call last): File "/var/lib/jenkins/workspace/snakebasket/tests/tests_cache/test_ws/.virtualenv/lib/python2.6/site-packages/pip-1.3.1-py2.6.egg/pip/basecommand.py", line 139, in main status = self.run(options, args) File "/var/lib/jenkins/workspace/snakebasket/tests/tests_cache/test_ws/.virtualenv/lib/python2.6/site-packages/snakebasket-2.0.0-py2.6.egg/snakebasket/commands/install.py", line 375, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/var/lib/jenkins/workspace/snakebasket/tests/tests_cache/test_ws/.virtualenv/lib/python2.6/site-packages/snakebasket-2.0.0-py2.6.egg/snakebasket/commands/install.py", line 149, in prepare_files url = finder.find_requirement(req_to_install, upgrade=self.upgrade) File "/var/lib/jenkins/workspace/snakebasket/tests/tests_cache/test_ws/.virtualenv/lib/python2.6/site-packages/pip-1.3.1-py2.6.egg/pip/index.py", line 171, in find_requirement raise DistributionNotFound('No distributions at all found for %s' % req) DistributionNotFound: No distributions at all found for INITools==0.2

Storing complete log in /var/lib/jenkins/workspace/snakebasket/tests/tests_cache/test_ws/pip-log.txt

-- created: ------------------- .virtualenv/build pip-delete-this-directory.txt (185 bytes) pip-log.txt (1438 bytes) -- updated: ------------------- .virtualenv

--------------------- >> end captured stdout << ----------------------

FAIL: Test installing a package from a specific PyPI mirror.

Traceback (most recent call last): File "/var/lib/jenkins/workspace/snakebasket/test-venv/lib/python2.6/site-packages/nose/case.py", line 197, in runTest self.test(_self.arg) File "/var/lib/jenkins/workspace/snakebasket/tests/test_sb_basic.py", line 21, in test_sb_install_from_mirrors_with_specific_mirrors result = run_pip('install', '-vvv', '--use-mirrors', '--mirrors', "http://b.pypi.python.org/", '--no-index', 'INITools==0.2') File "/var/lib/jenkins/workspace/snakebasket/tests/test_pip.py", line 546, in run_pip result = env.run('sb', args, _kw) File "/var/lib/jenkins/workspace/snakebasket/tests/test_pip.py", line 395, in run return TestPipResult(super(TestPipEnvironment, self).run(cwd=cwd, _args, *_kw), verbose=self.verbose) File "/var/lib/jenkins/workspace/snakebasket/test-venv/lib/python2.6/site-packages/scripttest/init.py", line 255, in run result.assert_no_error(quiet) File "/var/lib/jenkins/workspace/snakebasket/test-venv/lib/python2.6/site-packages/scripttest/init.py", line 402, in assert_no_error "Script returned code: %s" % self.returncode) AssertionError: Script returned code: 1 -------------------- >> begin captured stdout << --------------------- Script result: sb install -vvv --use-mirrors --mirrors http://b.pypi.python.org/ --no-index INITools==0.2 return code: 1 -- stdout: -------------------- Ignoring indexes: https://pypi.python.org/simple/ Using PyPI mirrors: http://b.pypi.python.org/simple/ Downloading/unpacking INITools==0.2 URLs to search for versions for INITools==0.2:

Storing complete log in /var/lib/jenkins/workspace/snakebasket/tests/tests_cache/test_ws/pip-log.txt

-- created: ------------------- .virtualenv/build pip-delete-this-directory.txt (185 bytes) pip-log.txt (1803 bytes) -- updated: ------------------- .virtualenv

--------------------- >> end captured stdout << ----------------------


Ran 247 tests in 264.258s

FAILED (SKIP=6, failures=2)

On Fri, Apr 18, 2014 at 3:48 PM, stanhu notifications@github.com wrote:

Which tests are broken? I found that the ones that were broken were due to the pypi mirrors going away, which was fixed by going to pip 1.4+.

— Reply to this email directly or view it on GitHubhttps://github.com/prezi/snakebasket/pull/13#issuecomment-40809609 .

Peter Neumark DevOps guy @Prezi http://prezi.com

stanhu commented 10 years ago

Right, these tests failed for me too before I made my changes. Again, these are pip tests that broke because the PyPI mirrors went away. Upgrading to pip 1.4+ fixes the problem, but you have to support Python Wheels to do that.