Skip to content

Make _run_setup_py magic use pkg_resources.iter_entry_points #584

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

Merged
merged 2 commits into from
Jul 2, 2012

Conversation

msabramo
Copy link
Contributor

instead of relying on egg_info.iter_entry_points, which might not be there if someone
redefines egg_info (like the setup.py in pyobjc-core does)

Fixes GH-11.

egg_info.iter_entry_points, which might not be there if someone
redefines egg_info (like the setup.py for pyobjc-core does)

Fixes pypaGH-11
@travisbot
Copy link

This pull request passes (merged ea109a0 into 4c96de6).

@jezdez
Copy link
Member

jezdez commented Jun 25, 2012

Hm, even if the tests pass, this needs a test on its own.

@msabramo
Copy link
Contributor Author

@jezdez Good point. See e089e40. Here's the result of running it without and with the fix in ea109a0:

[last: 0] marca@SCML-MarcA:~/dev/git-repos/pip$ git checkout develop
M   tests/test_basic.py
Switched to branch 'develop'
[last: 0] marca@SCML-MarcA:~/dev/git-repos/pip$ .tox/py27/bin/nosetests -s tests.test_basic:test_install_with_hacked_egg_info
Script result: pip install .
  return code: 1
-- stdout: --------------------
Unpacking /Users/marca/dev/git-repos/pip/tests/packages/HackedEggInfo
  Running setup.py egg_info for package from file:///Users/marca/dev/git-repos/pip/tests/packages/HackedEggInfo
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/tmp/pip-ciqDa5-build/setup.py", line 44, in <module>
        zip_safe = False,
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-ciqDa5-build/setup.py", line 22, in run
        orig_egg_info.egg_info.run(self)
      File "<string>", line 7, in replacement_run
    AttributeError: class egg_info has no attribute 'iter_entry_points'
    Complete output from command python setup.py egg_info:
    running egg_info

creating pip-egg-info/pyobjc_core.egg-info

Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/tmp/pip-ciqDa5-build/setup.py", line 44, in <module>

    zip_safe = False,

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup

    dist.run_commands()

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

  File "/tmp/pip-ciqDa5-build/setup.py", line 22, in run

    orig_egg_info.egg_info.run(self)

  File "<string>", line 7, in replacement_run

AttributeError: class egg_info has no attribute 'iter_entry_points'

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-ciqDa5-build
Storing complete log in /Users/marca/dev/git-repos/pip/tests/tests_cache/test_ws/pip-log.txt

-- created: -------------------
  pip-log.txt  (3415 bytes)
F
======================================================================
FAIL: test installing a package which defines its own egg_info class
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/marca/dev/git-repos/pip/.tox/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/marca/dev/git-repos/pip/tests/test_basic.py", line 385, in test_install_with_hacked_egg_info
    run_pip('install', '.', cwd=run_from)
  File "/Users/marca/dev/git-repos/pip/tests/test_pip.py", line 518, in run_pip
    result = env.run('pip', *args, **kw)
  File "/Users/marca/dev/git-repos/pip/tests/test_pip.py", line 380, in run
    return TestPipResult(super(TestPipEnvironment, self).run(cwd=cwd, *args, **kw), verbose=self.verbose)
  File "/Users/marca/dev/git-repos/pip/.tox/py27/lib/python2.7/site-packages/scripttest/__init__.py", line 255, in run
    result.assert_no_error(quiet)
  File "/Users/marca/dev/git-repos/pip/.tox/py27/lib/python2.7/site-packages/scripttest/__init__.py", line 402, in assert_no_error
    "Script returned code: %s" % self.returncode)
AssertionError: Script returned code: 1

----------------------------------------------------------------------
Ran 1 test in 4.194s

FAILED (failures=1)
[last: 5] marca@SCML-MarcA:~/dev/git-repos/pip$ git checkout issue-11
M   tests/test_basic.py
Switched to branch 'issue-11'
[last: 0] marca@SCML-MarcA:~/dev/git-repos/pip$ .tox/py27/bin/nosetests -s tests.test_basic:test_install_with_hacked_egg_info
.
----------------------------------------------------------------------
Ran 1 test in 4.104s

OK

@travisbot
Copy link

This pull request passes (merged e089e40f into 4c96de6).

@travisbot
Copy link

This pull request passes (merged 1f84b65 into 8b8dcea).

pnasrat added a commit that referenced this pull request Jul 2, 2012
Make _run_setup_py magic use pkg_resources.iter_entry_points
@pnasrat pnasrat merged commit 5562a6b into pypa:develop Jul 2, 2012
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants