Skip to content

Commit

Permalink
Vendor ordereddict for python2.6 only (spack#6931)
Browse files Browse the repository at this point in the history
* Vendor ordereddict for python2.6 only

This commit substitutes the custom module 'ordereddict_backport' with
the more known 'ordereddict' and vendors it only for python 2.6. Other
supported versions of python will use 'collections.OrderedDict'.

* Use absolute imports also for python 2.6

See PEP-328 for more information on the subject

* Added provenance of vendored ordereddict
  • Loading branch information
alalazo authored Jan 16, 2018
1 parent 498c522 commit 1fb38c9
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 281 deletions.
4 changes: 4 additions & 0 deletions bin/spack
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ sys.path.insert(0, spack_lib_path)

# Add external libs
spack_external_libs = os.path.join(spack_lib_path, "external")

if sys.version_info[:2] == (2, 6):
sys.path.insert(0, os.path.join(spack_external_libs, 'py26'))

sys.path.insert(0, spack_external_libs)

# Handle vendoring of YAML specially, as it has two versions.
Expand Down
7 changes: 4 additions & 3 deletions lib/spack/external/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@
orderddict
----------
* Homepage: http://code.activestate.com/recipes/576693-ordered-dictionary-for-py24/
* Usage: We include our own version to be Python 2.6 compatible.
* Version: Unversioned
* Homepage: https://pypi.org/project/ordereddict/
* Usage: A drop-in substitute for Py2.7's new collections.OrderedDict
that works in Python 2.4-2.6.
* Version: 1.1
py
--
Expand Down
268 changes: 0 additions & 268 deletions lib/spack/external/ordereddict_backport.py

This file was deleted.

Loading

0 comments on commit 1fb38c9

Please sign in to comment.