Instructions for installing Voluptuous in a Python 2.5 environment.
Moved to JSON validation using Voluptuous in Python.
I can't install it on Python 2.5.
# tar xvf voluptuous-0.8.8.tar.gz
voluptuous-0.8.8/
voluptuous-0.8.8/.gitignore
voluptuous-0.8.8/.travis.yml
voluptuous-0.8.8/COPYING
voluptuous-0.8.8/MANIFEST.in
voluptuous-0.8.8/README.md
voluptuous-0.8.8/setup.cfg
voluptuous-0.8.8/setup.py
voluptuous-0.8.8/tests.md
voluptuous-0.8.8/tests.py
voluptuous-0.8.8/tox.ini
voluptuous-0.8.8/voluptuous.py
# cd voluptuous-0.8.8
voluptuous-0.8.8# python setup.py install
setup.py:15: Warning: 'with' will become a reserved keyword in Python 2.6
File "setup.py", line 15
with open('README.rst', 'w') as f:
^
SyntaxError: invalid syntax
voluptuous-0.8.8#
It can't be helped because it is not originally supported.
It was bad. At the moment (2016/1), the latest version of voluptuous-0.8.8 does not support Python 2.5, I thought that it was supported in the past version, but it was not compatible with Python 2.5 at the time of the first commit.
I've created a patch that makes voluptuous work with Python 2.5. https://gist.github.com/thombashi/5be8a602df933851d2fd1af73cb1bb0e
Apply this patch
# patch -p1 < voluptuous_python25.patch
patching file voluptuous-0.8.8/setup.py
patching file voluptuous-0.8.8/voluptuous.py
#
Installation
# cd voluptuous-0.8.8
voluptuous-0.8.8# python setup.py install
WARNING: Could not locate pandoc, using Markdown long_description.
running install
running bdist_egg
running egg_info
writing requirements to voluptuous.egg-info/requires.txt
writing voluptuous.egg-info/PKG-INFO
writing top-level names to voluptuous.egg-info/top_level.txt
writing dependency_links to voluptuous.egg-info/dependency_links.txt
reading manifest file 'voluptuous.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'voluptuous.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
copying voluptuous.py -> build/lib
creating build/bdist.linux-i686/egg
copying build/lib/voluptuous.py -> build/bdist.linux-i686/egg
byte-compiling build/bdist.linux-i686/egg/voluptuous.py to voluptuous.pyc
creating build/bdist.linux-i686/egg/EGG-INFO
copying voluptuous.egg-info/PKG-INFO -> build/bdist.linux-i686/egg/EGG-INFO
copying voluptuous.egg-info/SOURCES.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying voluptuous.egg-info/dependency_links.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying voluptuous.egg-info/requires.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying voluptuous.egg-info/top_level.txt -> build/bdist.linux-i686/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/voluptuous-0.8.8-py2.5.egg' and adding 'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)
Processing voluptuous-0.8.8-py2.5.egg
Removing /usr/lib/python2.5/site-packages/voluptuous-0.8.8-py2.5.egg
Copying voluptuous-0.8.8-py2.5.egg to /usr/lib/python2.5/site-packages
voluptuous 0.8.8 is already the active version in easy-install.pth
Installed /usr/lib/python2.5/site-packages/voluptuous-0.8.8-py2.5.egg
Processing dependencies for voluptuous==0.8.8
Searching for setuptools==0.6c8
Best match: setuptools 0.6c8
setuptools 0.6c8 is already the active version in easy-install.pth
Installing easy_install script to /usr/bin
Installing easy_install-2.5 script to /usr/bin
Installing easy_install-2.4 script to /usr/bin
Using /usr/lib/python2.5/site-packages
Finished processing dependencies for voluptuous==0.8.8
voluptuous-0.8.8#
I was able to install it.
Well, I want to graduate from Python 2.5.
Recommended Posts