Solution for upgrading to the new setuptools #992

Merged
merged 6 commits into from Jun 20, 2013

Projects

None yet

2 participants

@qwcode
Contributor
qwcode commented Jun 13, 2013

this pull contains a pip-only solution for upgrading to the new setuptools
(i.e. no more changes required to distribute-0.7 or setuptools-0.7.2)

If Jason releases setuptools-0.8 (that's 2&3 compat), then part of these changes could be removed. Additionally, if Jason decided to proceed with the setuptools-import hack he mentioned in #986, then I think none of this would be required.

posting this as a draft for now, because I'm too tired to look at it or refine it anymore more at the moment, but I think it's working.

I tried a few different solutions (none pretty). This is where I ended up.

these scenarios work (i.e. they result in setuptools-0.7.2 installed):

  • with distribute installed (in py2 or py3)
    • pip install -U distribute (I was using --find-links locally to find a local sdist of distribute-0.7)
  • with setuptools intalled (in py2)
    • pip install -U setuptools

the change, in brief (read #986 or the code comments if you need more backstory)

  • forces the "setuptools" dependency to distribute-0.7 to be processed before distribute itself.
  • forces pip to perceive "distribute" as a conflict to setuptools (thereby forcing an uninstall of distribute first)
  • uses "python setup.py" directly when working with setuptools (to get around 2to3 problems in py3)
  • it also includes a revert of the distribute-skip logic I had put in with #937

this pull is against develop. if we wanted it in a patch, then I could rework against 1.3.X.

@dstufft dstufft and 1 other commented on an outdated diff Jun 14, 2013
tests/functional/test_install.py
+def test_pip_second_command_line_interface_works():
+ """
+ Check if ``pip-<PYVERSION>`` commands behaves equally
+ """
+ e = reset_env()
+
+ args = ['pip-%s' % pyversion]
+ args.extend(['install', 'INITools==0.2'])
+ result = e.run(*args)
+ egg_info_folder = e.site_packages / 'INITools-0.2-py%s.egg-info' % pyversion
+ initools_folder = e.site_packages / 'initools'
+ assert egg_info_folder in result.files_created, str(result)
+ assert initools_folder in result.files_created, str(result)
+
+
+#def test_distutils_configuration_setting():
@dstufft
dstufft Jun 14, 2013 Member

Did you mean to comment all of this out?

@qwcode
qwcode Jun 14, 2013 Contributor

this test has existed commented out for awhile. I don't know the history.
In the recent test refactor I did, I had removed this test, but in the conflict/merge for this pull, it crept back in somehow.

@qwcode
qwcode Jun 14, 2013 Contributor

I'll delete it back out again, before merging.

@qwcode
Contributor
qwcode commented Jun 18, 2013

setuptools-0.8 is soon to be out (and is 2&3 compatible), which allows us to remove some of the hacks in this pull.
I will make the changes and retest the upgrade scenarios using setuptools-0.8

@qwcode qwcode merged commit bfe99a9 into pypa:develop Jun 20, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment