Geoportail-Luxembourg / geoportailv3

geoportailv3 is the implementation of the v3 of the map viewer of the luxembourgish geoportal
MIT License
25 stars 16 forks source link

build derrière un proxy: Souci nosexcover #83

Closed jaykayone closed 9 years ago

jaykayone commented 9 years ago

L'installation de nosexcover par le make ne passe pas. en utilisant un pip install manuel, il n'y a pas de souci par contre

[root@workshop3-local geoportailv3]# make -f jkonnen.mk build
mkdir -p .build/
virtualenv --no-site-packages .build/venv
New python executable in .build/venv/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
touch .build/venv.timestamp
.build/venv/bin/pip install -r requirements.txt
Obtaining file:///tmp/geoportailv3 (from -r requirements.txt (line 4))
  Running setup.py egg_info for package from file:///tmp/geoportailv3
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'message_extractors'
      warnings.warn(msg)

Obtaining pyramid-closure from git+https://github.com/camptocamp/pyramid_closure#egg=pyramid_closure (from -r requirements.txt (line 3))
  Cloning https://github.com/camptocamp/pyramid_closure to ./.build/venv/src/pyramid-closure
  Running setup.py egg_info for package pyramid-closure

    warning: no files found matching '*.ini'
    warning: no files found matching '*.cfg'
    warning: no files found matching '*.rst'
    warning: no files found matching '*.ico' under directory 'pyramid_closure'
    warning: no files found matching '*.png' under directory 'pyramid_closure'
    warning: no files found matching '*.css' under directory 'pyramid_closure'
    warning: no files found matching '*.gif' under directory 'pyramid_closure'
    warning: no files found matching '*.jpg' under directory 'pyramid_closure'
    warning: no files found matching '*.pt' under directory 'pyramid_closure'
    warning: no files found matching '*.mak' under directory 'pyramid_closure'
    warning: no files found matching '*.mako' under directory 'pyramid_closure'
    warning: no files found matching '*.html' under directory 'pyramid_closure'
    warning: no files found matching '*.xml' under directory 'pyramid_closure'
Downloading/unpacking c2cgeoportal>=1.6.0dev-20141107 (from geoportailv3==1.0->-r requirements.txt (line 4))
  Downloading c2cgeoportal-1.6.0dev-20141121.tar.gz (34.2MB): 34.2MB downloaded
  Running setup.py egg_info for package c2cgeoportal
    Not found: ./c2cgeoportal/tests/testegg/dist/testegg-1.0.tar.gz
    Download error on https://pypi.python.org/simple/nosexcover/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!
   ** Couldn't find index page for 'nosexcover' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!
    No local packages or download links found for nosexcover==1.0.8 **
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/geoportailv3/.build/venv/build/c2cgeoportal/setup.py", line 145, in <module>
        'admin = c2cgeoportal.forms:fanstatic_lib',
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs
        parse_requirements(requires), installer=self.fetch_build_egg
      File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve
        dist = best[req.key] = env.best_match(req, self, installer)
      File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match
        return self.obtain(req, installer) # try and download/install
      File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain
        return installer(requirement)
      File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg
        return cmd.easy_install(req)
      File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 617, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('nosexcover==1.0.8')
    Complete output from command python setup.py egg_info:
    Not found: ./c2cgeoportal/tests/testegg/dist/testegg-1.0.tar.gz

Download error on https://pypi.python.org/simple/nosexcover/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!

Couldn't find index page for 'nosexcover' (maybe misspelled?)

Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!

No local packages or download links found for nosexcover==1.0.8

Traceback (most recent call last):

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

  File "/tmp/geoportailv3/.build/venv/build/c2cgeoportal/setup.py", line 145, in <module>

    'admin = c2cgeoportal.forms:fanstatic_lib',

  File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup

    _setup_distribution = dist = klass(attrs)

  File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs

    parse_requirements(requires), installer=self.fetch_build_egg

  File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/pkg_resources.py", line 618, in resolve

    dist = best[req.key] = env.best_match(req, self, installer)

  File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/pkg_resources.py", line 862, in best_match

    return self.obtain(req, installer) # try and download/install

  File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/pkg_resources.py", line 874, in obtain

    return installer(requirement)

  File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/dist.py", line 339, in fetch_build_egg

    return cmd.easy_install(req)

  File "/tmp/geoportailv3/.build/venv/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 617, in easy_install

    raise DistutilsError(msg)

distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('nosexcover==1.0.8')

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/geoportailv3/.build/venv/build/c2cgeoportal
Storing complete log in /root/.pip/pip.log
make: *** [/geoportailv3.egg-link] Error 1
[root@workshop3-local geoportailv3]# http://jasper.geoportal.lu:8080/service?REQUEST=GetCapabilities^C
**[root@workshop3-local geoportailv3]# source .build/venv/bin/activate**
**(venv)[root@workshop3-local geoportailv3]# pip install nosexcover==1.0.8**
Downloading/unpacking nosexcover==1.0.8
  Downloading nosexcover-1.0.8.tar.gz
  Running setup.py egg_info for package nosexcover

Downloading/unpacking nose (from nosexcover==1.0.8)
  Downloading nose-1.3.4.tar.gz (277kB): 277kB downloaded
  Running setup.py egg_info for package nose

    no previously-included directories found matching 'doc/.build'
Downloading/unpacking coverage>=3.4 (from nosexcover==1.0.8)
  Downloading coverage-3.7.1.tar.gz (284kB): 284kB downloaded
  Running setup.py egg_info for package coverage

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
Installing collected packages: nosexcover, nose, coverage
  Running setup.py install for nosexcover

  Running setup.py install for nose

    no previously-included directories found matching 'doc/.build'
    Installing nosetests script to /tmp/geoportailv3/.build/venv/bin
    Installing nosetests-2.7 script to /tmp/geoportailv3/.build/venv/bin
  Running setup.py install for coverage
    building 'coverage.tracer' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c coverage/tracer.c -o build/temp.linux-x86_64-2.7/coverage/tracer.o
    gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/coverage/tracer.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/coverage/tracer.so

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    Installing coverage2 script to /tmp/geoportailv3/.build/venv/bin
    Installing coverage-2.7 script to /tmp/geoportailv3/.build/venv/bin
    Installing coverage script to /tmp/geoportailv3/.build/venv/bin
**Successfully installed nosexcover nose coverage**
Cleaning up...
jaykayone commented 9 years ago

il y a d'ailleurs le même comportement avec setuptools-git

elemoine commented 9 years ago

Ça semble une histoire de SSL/https à nouveau. Est-ce que la commande suivante fonctionne chez vous:

pip install https://pypi.python.org/packages/source/n/nosexcover/nosexcover-1.0.8.tar.gz#md5=b1d42ccd372e048233d4be65555270b0

(Avec https donc)

geoportallux commented 9 years ago

Oui ca fonctionne sans problème.

Par contre si je télécharge le fichier depuis le site camptocamp à l’aide par exemple d’un wget , le fichier .gz n’est pas un fichier zip valide. Il semble être altéré. Si je fais la même opération depuis le site de python ca passe sans problème.

sbrunner commented 9 years ago

le fichier .gz n’est pas un fichier zip valide.

On est d'accord qu'un fichier gz et un fichier zip ne sont pas du tout identique!

rmichaelis commented 9 years ago

Oui nous sommes d'accord qu'un .gz n'est pas fichier zip valide.

Ce que je voulais dire c'est que le fichier que j'obtiens depuis le site de python je peux le "gunziper" tandis que celui que j'obtiens depuis chez camptocamp je ne peux pas.

Le 26 novembre 2014 12:38, Stéphane Brunner notifications@github.com a écrit :

le fichier .gz n’est pas un fichier zip valide.

On est d'accord qu'un fichier gz et un fichier zip ne sont pas du tout identique!

— Reply to this email directly or view it on GitHub https://github.com/Geoportail-Luxembourg/geoportailv3/issues/83#issuecomment-64580738 .

Renaud Michaëlis, 53 rue de Roloux 4347 Fexhe-Le-Haut-Clocher Tel : 04/222 43 46 GSM: 0496/294083

elemoine commented 9 years ago

@rmichaelis je ne comprends pas pourquoi tu parles du pypi Camptocamp ici (et du problème de zip), parce que dans la description initiale de cet issue le téléchargement de nosexcover posant problème est fait depuis le pypi officiel et non le pypi de Camptocamp. Voici en effet ce que je vois dans l'output de la commande collée dans la description de l'issue :

    Download error on https://pypi.python.org/simple/nosexcover/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!
   ** Couldn't find index page for 'nosexcover' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found!
    No local packages or download links found for nosexcover==1.0.8 **
rmichaelis commented 9 years ago

Oui effectivement désolé c'était plutôt en relation avec le bug #84 et le MD5 qui ne passe pas.

elemoine commented 9 years ago

@rmichaelis merci pour la confirmation.

C'est étrange qu'on n'arrive pas à télécharger nosexcover quand on installe le projet avec pip install -r requirements (ce que fait le Makefile) alors qu'un pip install nosexcover en HTTPS fonctionne.

@sbrunner, c'est peut-être lié au fait que nosexcover est une dépendance de type setup ?

@jaykayone @rmichaelis vous pouvez essayer de forcer l'installation de nosexcover avant celle du projet pour voir ce que ça donne. Avec ce contenu pour requirements.txt :

--index-url http://pypi.camptocamp.net/pypi
--find-links http://pypi.camptocamp.net/internal-pypi/index/c2cgeoportal
nosexcover==1.0.8
-e git+https://github.com/camptocamp/pyramid_closure#egg=pyramid_closure
-e .
rmichaelis commented 9 years ago

Non toujours le même problème

sbrunner commented 9 years ago

en voyant l'erreur Download error on https://pypi.python.org/simple/: [Errno 1] _ssl.c:504: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol -- Some packages may not be found! on dirais que l'on a perdu les informations du proxy ...

sbrunner commented 9 years ago

et si on ajoute dans le fichier requirements.txt?: --proxy=http://username:password@server:port http://stackoverflow.com/questions/23980593/pypi-cannot-install-behind-proxy

elemoine commented 9 years ago

@sbrunner, à noter que

pip install https://pypi.python.org/packages/source/n/nosexcover/nosexcover-1.0.8.tar.gz#md5=b1d42ccd372e048233d4be65555270b0

fonctionne pour eux (derrière le proxy) !

sbrunner commented 9 years ago

On est bien d'accord mais je n'arrive pas cerner ou est le problème ...

sbrunner commented 9 years ago

Je suis aussi tomber sur ce poste: http://stackoverflow.com/questions/21135637/error140770fcssl-routinesssl23-get-server-hellounknown-protocol on est d'accord que la commande openssl s_client -connect pypi.python.org:443 retourne bien des information de certificat?

rmichaelis commented 9 years ago

"pip install -r requirements.txt --proxy=http://proxy:3128" ne change rien

rmichaelis commented 9 years ago

Malheureusement Il semble que openssl n'est pas prévu pour tourner derrière un proxy.

jaykayone commented 9 years ago

le fait que ce soit un dépendance d'un autre type me paraît une bonne piste. Peut-être que le proxy n'est pas correctement utilisé pour ce type de dépendances?

On Wed, Nov 26, 2014 at 3:33 PM, rmichaelis notifications@github.com wrote:

Malheureusement Il semble que openssl n'est pas prévu pour tourner derrière un proxy.

— Reply to this email directly or view it on GitHub https://github.com/Geoportail-Luxembourg/geoportailv3/issues/83#issuecomment-64653545 .

Jeff Konnen

elemoine commented 9 years ago

le fait que ce soit un dépendance d'un autre type me paraît une bonne piste. Peut-être que le proxy n'est pas correctement utilisé pour ce type de dépendances?

Oui, c'est ce que je me disais aussi. C'est aussi pour ça que j'ai suggérer de forcer l'installation de nosexcover avant celle du projet (en ajoutant nosexcover dans requirements.txt) mais ça ne règle pas le problème.

jaykayone commented 9 years ago

Non en effet ça ne règle pas le problème. La seule chose qui fonctionne c'est de les installer de manière explicite (nosexcover==1.0.8 et setuptools-git) avant de faire le pip install -r requirements.txt A ce moment, ça passe... Dans le setup.py de c2cgeoportal on voit en effet que nosexcover est défini comme setup_requires setuptools-git doit être une dépendance dans un autre package qui est définie de la même manière

elemoine commented 9 years ago

Non en effet ça ne règle pas le problème. La seule chose qui fonctionne c'est de les installer de manière explicite (nosexcover==1.0.8 et setuptools-git) avant de faire le pip install -r requirements.txt A ce moment, ça passe...

Le package nosexcover est utilisé pour l'exécution des tests de c2cgeoportal. Il est inutile dans un projet. Je me demande donc si on ne devrait pas avoir un autre moyen de l'installer dans c2cgeoportal pour éviter ce problème.

sbrunner commented 9 years ago

C'est une bonne question, mais avec buildout c'est pas facile à le résoudre, je pense que le mieux c'est d'attaque le problème quand on va passé à make.