omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

Installing python-social-auth as a dependecie for mailman3 with buildout fails #623

Closed ziegenberg closed 9 years ago

ziegenberg commented 9 years ago

I tried to install Mailman 3 and its companions (Hyperkitty, Postorius) on a Ubuntu 14.04.2 LTS using the mailman-bundler. I followed the docs: http://mailman-bundler.readthedocs.org/en/latest/

It fails while trying to install 'python-social-aut':

(venv)mailman@jiffy02:~/mailman-bundler$ buildout Getting distribution for 'python-social-auth>=0.2.3'. No eggs found in /tmp/easy_install-LK6bYy/python-social-auth-0.2.9/egg-dist-tmp-FzLeGP (setup script problem?) While: Installing mailman-web. Getting distribution for 'python-social-auth>=0.2.3'. Error: Couldn't install: python-social-auth 0.2.9

I checked with the folks from mailman3 and they told me to file a bug here.

abompard commented 9 years ago

You can test the install with buildout by creating a file called "buidout.cfg" in a temporary directory with the following content:

[buildout]
parts = main
[main]
recipe = zc.recipe.egg
eggs = python-social-auth

And running the "buildout" command.

ziegenberg commented 9 years ago

I created a new temporary user, build a virtual environment and tested python-social-auth with buildout in two different versions.

testing@jiffy02:~$ virtualenv venv
testing@jiffy02:~$ source venv/bin/activate
(venv) testing@jiffy02:~$ pip install zc.buildout
(venv) testing@jiffy02:~$ buildout

buildout.cfg (#1)

[buildout]
parts = main
[main]
recipe = zc.recipe.egg
eggs = python-social-auth

It fails:

(venv)testing@jiffy02:~$ buildout
Creating directory '/home/testing/bin'.
Creating directory '/home/testing/parts'.
Creating directory '/home/testing/eggs'.
Creating directory '/home/testing/develop-eggs'.
Getting distribution for 'zc.recipe.egg>=2.0.0a3'.
Got zc.recipe.egg 2.0.1.
Installing main.
Getting distribution for 'python-social-auth'.
warning: no previously-included files matching '*' found under directory '.tox'
warning: no previously-included files matching '*.pyc' found under directory 'social'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.db' found under directory 'examples'
warning: no previously-included files matching 'local_settings.py' found under directory 'examples'
warning: no previously-included files matching '*' found under directory 'examples/webpy_example/sessions'
No eggs found in /tmp/easy_install-wyDf6z/python-social-auth-0.2.9/egg-dist-tmp-7Pz6Vl (setup script problem?)
While:
  Installing main.
  Getting distribution for 'python-social-auth'.
Error: Couldn't install: python-social-auth 0.2.9

buildout.cfg (#2)

[buildout]
parts = main
[main]
recipe = zc.recipe.egg
eggs = python-social-auth<0.2.9

It succeeds:

(venv)testing@jiffy02:~$ buildout
Creating directory '/home/testing/bin'.
Creating directory '/home/testing/parts'.
Creating directory '/home/testing/eggs'.
Creating directory '/home/testing/develop-eggs'.
Getting distribution for 'zc.recipe.egg>=2.0.0a3'.
Got zc.recipe.egg 2.0.1.
Installing main.
Getting distribution for 'python-social-auth<0.2.9'.
warning: no previously-included files matching '*.pyc' found under directory 'social'
warning: no previously-included files matching '*.pyc' found under directory 'examples'
warning: no previously-included files matching '*.db' found under directory 'examples'
warning: no previously-included files matching 'local_settings.py' found under directory 'examples'
warning: no previously-included files matching '*' found under directory 'examples/webpy_example/sessions'
Got python-social-auth 0.2.7.
Getting distribution for 'PyJWT>=1.0.0'.
zip_safe flag not set; analyzing archive contents...
Got PyJWT 1.1.0.
Getting distribution for 'six>=1.2.0'.
no previously-included directories found matching 'documentation/_build'
zip_safe flag not set; analyzing archive contents...
six: module references __path__
Got six 1.9.0.
Getting distribution for 'requests-oauthlib>=0.3.1'.
Got requests-oauthlib 0.5.0.
Getting distribution for 'oauthlib>=0.3.8'.
zip_safe flag not set; analyzing archive contents...
Got oauthlib 0.7.2.
Getting distribution for 'requests>=1.1.0'.
Got requests 2.7.0.
Getting distribution for 'python-openid>=2.2'.
warning: no files found matching 'CHANGELOG'
warning: no files found matching '*.css' under directory 'doc'
warning: no files found matching '*.html' under directory 'doc'
zip_safe flag not set; analyzing archive contents...
Got python-openid 2.2.5.
wdoekes commented 9 years ago

Same problem over here. I did a manual download of python-social 0.2.9, untar, python setup.py bdist_egg, unzip of that egg, and the mailman3 buildout continued without complaints.

(No idea what I did though, I never use buildout nor eggs.)

wdoekes commented 9 years ago

Apparently this change:

--- python-social-auth-0.2.7/python_social_auth.egg-info/requires.txt   2015-04-19 09:13:58.000000000 +0200
+++ python-social-auth-0.2.9/python_social_auth.egg-info/requires.txt   2015-05-25 22:01:54.817050206 +0200
@@ -1,6 +1,6 @@
-python-openid>=2.2
+python3-openid>=3.0.1

I had to install the former to make things work. Installing the latter complained about py3-only stuff. (mailman setup scripts use py2).

abompard commented 9 years ago

OK I found the reason. In MANIFEST.in, the egg-info directory is ignored, and these files are necessary for easy_install to work. Buildout uses easy_install, thus triggers the error. This can be easily reproduced with the command:

$ easy_install -md /tmp http://pypi.python.org/packages/source/p/python-social-auth/python-social-auth-0.2.10.tar.gz

The fix is as easy as:

diff --git a/MANIFEST.in b/MANIFEST.in
index 2cf5b48..d2fef43 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -7,7 +7,6 @@ recursive-include social/tests *.txt
 graft examples

 recursive-exclude .tox *
-recursive-exclude python_social_auth.egg-info *
 recursive-exclude social *.pyc
 recursive-exclude examples *.pyc
 recursive-exclude examples *.db

I'll send you a pull request ASAP.

Cykooz commented 9 years ago

Please, apply the patch from abompard and release a new version. Until that happens, I can only use the version 0.2.7