0k / shyaml

YAML for command line
BSD 2-Clause "Simplified" License
767 stars 57 forks source link

Fail to install shyaml 0.5.2 on python 3.6 and pip 9.0.1 #46

Closed sanpii closed 6 years ago

sanpii commented 6 years ago

Hello,

I have an error when I try to install the lastest version:

~/sources/shyaml ((0.5.2))$ python setup.py install --root=pkg --optimize=1                                                                                 
Missing version information: running './autogen.sh'...                                                                                                                

Installed /home/sanpi/sources/shyaml/.eggs/d2to1-0.2.12.post1-py3.6.egg
error in setup command: Error parsing /home/sanpi/sources/shyaml/setup.cfg: RecursionError: maximum recursion depth exceeded while calling a Python object            
~/sources/shyaml ((0.5.2))$ python setup.py install --root=pkg --optimize=1                                                                                 
running install                                                                                                                                                       
running build                                                                                                                                                         
running build_scripts
creating build                                                                                                                                                        
creating build/scripts-3.6                                                                                                                                            
copying and adjusting shyaml -> build/scripts-3.6                                                                                                                     
changing mode of build/scripts-3.6/shyaml from 644 to 755                                                                                                             
running install_egg_info                                                                                                                                              
running egg_info                                                                                                                                                      
creating shyaml.egg-info                                                                                                                                              
writing shyaml.egg-info/PKG-INFO                                                                                                                                      
writing dependency_links to shyaml.egg-info/dependency_links.txt                                                                                                      
writing requirements to shyaml.egg-info/requires.txt                                                                                                                  
writing top-level names to shyaml.egg-info/top_level.txt                                                                                                              
writing manifest file 'shyaml.egg-info/SOURCES.txt'                                                                                                                   
[d2to1] running patched manifest_maker command with extra_files support                                                                                               
reading manifest file 'shyaml.egg-info/SOURCES.txt'                                                                                                                   
reading manifest template 'MANIFEST.in'                                                                                                                               
warning: no files found matching '*.py' under directory 'src'                                                                                                         
writing manifest file 'shyaml.egg-info/SOURCES.txt'                                                                                                                   
Copying shyaml.egg-info to pkg/usr/lib/python3.6/site-packages/shyaml-0.5.2-py3.6.egg-info                                                                            
running install_scripts                                                                                                                                               
creating pkg/usr/bin                                                                                                                                                  
copying build/scripts-3.6/shyaml -> pkg/usr/bin                                                                                                                       
changing mode of pkg/usr/bin/shyaml to 755                                                                                                                            

Running the command twice works :thinking:

szepeviktor commented 6 years ago

Try using pip. It is the much preferred way to handle Python code.

BTW shyaml is a single-file software!

But this is a Bug

sanpii commented 6 years ago

@szepeviktor In my case pip is not relevant (or I didn’t find the good option), I need the equivalent of make install to build the archlinux package.

szepeviktor commented 6 years ago

OK! I am a diehard Debian user installing python code with pip. I think OS packaging has long release cycles for python code. Try stealing ideas from the source of https://pypi.org/project/stdeb/

szepeviktor commented 6 years ago

Even pip fails:

$ pip3 install --user https://github.com/0k/shyaml/archive/master.zip
Collecting https://github.com/0k/shyaml/archive/master.zip
  Downloading https://github.com/0k/shyaml/archive/master.zip
     \ 20kB 305kB/s
    Complete output from command python setup.py egg_info:
    autogen.sh: error: Didn't find a git repository (or no tags found).  ``./autogen.sh`` uses git to create changelog and version information.
    It seems that ``./autogen.sh`` couldn't do its job as expected.
    Please try to launch ``./autogen.sh`` manualy, and send the results to the
    maintainer of this package.
    Package will not be installed !
    Missing version information: running './autogen.sh'...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-rma95y21-build/
szepeviktor commented 6 years ago

But

$ pip3 install --user git+https://github.com/0k/shyaml.git
Collecting git+https://github.com/0k/shyaml.git
  Cloning https://github.com/0k/shyaml.git to /tmp/pip-9fhldnat-build
Collecting pyyaml (from shyaml==0.5.2.dev201804250410)
  Downloading https://files.pythonhosted.org/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz (253kB)
    100% |████████████████████████████████| 256kB 4.1MB/s
Building wheels for collected packages: pyyaml
  Running setup.py bdist_wheel for pyyaml ... done
  Stored in directory: /home/viktor/.cache/pip/wheels/03/05/65/bdc14f2c6e09e82ae3e0f13d021e1b6b2481437ea2f207df3f
Successfully built pyyaml
Installing collected packages: pyyaml, shyaml
  Running setup.py install for shyaml ... done
Successfully installed pyyaml-3.12 shyaml-0.5.2.dev201804250410

produces

$ find /home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/SOURCES.txt
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/dependency_links.txt
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/requires.txt
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/not-zip-safe
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/top_level.txt
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/PKG-INFO
/home/viktor/.local/lib/python3.4/site-packages/shyaml-0.5.2.dev201804250410-py3.4.egg-info/installed-files.txt

and one file in ~/.local/bin/

sanpii commented 6 years ago

I have the same error with pip:

$ pip3 install --user git+https://github.com/0k/shyaml.git                                                                        
Collecting git+https://github.com/0k/shyaml.git                                                                                                                       
  Cloning https://github.com/0k/shyaml.git to /tmp/pip-tmhdfq3n-build                                                                                                 
    Complete output from command python setup.py egg_info:                                                                                                            

    Installed /tmp/pip-tmhdfq3n-build/.eggs/d2to1-0.2.12.post1-py3.6.egg
    error in setup command: Error parsing /tmp/pip-tmhdfq3n-build/setup.cfg: RecursionError: maximum recursion depth exceeded while calling a Python object
    Missing version information: running './autogen.sh'...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-tmhdfq3n-build/                                                                               
You are using pip version 9.0.1, however version 10.0.1 is available.                                                                                                 
You should consider upgrading via the 'pip install --upgrade pip' command.
szepeviktor commented 6 years ago

archlinux is uncharted territory for me.

sanpii commented 6 years ago

It’s just another linux distribution :smiley:

$ python3 --version                                                    
Python 3.6.5                                                                      
$ pip3 --version                                                       
pip 9.0.1 from /usr/lib/python3.6/site-packages (python 3.6)                      
vaab commented 6 years ago

Thanks for both your help, I have a pretty extensive installation test matrix, and I'm looking actively for all corner cases like that. There is a well known issue already identified when combining Python 3.6 and old libraries like setuptools 9.0.1 ... This seems to be your issue.

BTW, can you confirm me actually that you can't install also older version of shyaml (0.5.1, 0.5.0) with your current toolset ?

A solution is to upgrade your installation tools::

pip install pip --upgrade
pip install setuptools --upgrade

Is that something you can do ?

vaab commented 6 years ago

BTW, for now, you should avoid using the zip releases provided by github. They are not functional, and I would be glad to remove them if possible. You can still use direct installation of master branch via:

pip install git+https://github.com/0k/shyaml@master

As a note, I'd like to leverage the release mecanism of github in a hopefully not so distant future to provide safe zips that are effectively usable for installation. This is tracked in #27

sanpii commented 6 years ago

BTW, can you confirm me actually that you can't install also older version of shyaml (0.5.1, 0.5.0) with your current toolset ?

Yes I have the same error with shyaml 0.5.0 (I don’t found the 0.5.1 release).

There is a well known issue already identified when combining Python 3.6 and old libraries like setuptools 9.0.1 ... This seems to be your issue.

Ok, we will wait the update of python-pip package.

Is that something you can do ?

I used a virtual env to build the package and that works fine.

Thank you.

vaab commented 6 years ago

Thanks for your confirmation and your feedback.