Skip to content

Commit

Permalink
Encode Python implementation in binary cache filenames
Browse files Browse the repository at this point in the history
While testing the results of merging pull request #33 I noticed that
when I enabled the Amazon S3 cache backend and ran the test suite using
Tox (which runs the test suite under CPython 2.6, CPython 2.7, CPython
3.4 and PyPy 2.7) either the CPython 2.7 or the PyPy 2.7 tests would
fail. It turns out that the two don't go well together (who would have
thought? ;-). This change set permanently fixes the problem by encoding
the Python implementation in the filenames used to store binary
distribution archives in the binary cache.

See also pull request #33 on GitHub:
  #33
  • Loading branch information
xolox committed Nov 9, 2014
1 parent 8ff50a9 commit d43e260
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pip_accel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""

# Semi-standard module versioning.
__version__ = '0.14'
__version__ = '0.14.1'

# Standard library modules.
import logging
Expand Down Expand Up @@ -75,7 +75,7 @@
# The version number of the binary distribution cache format in use. When we
# break backwards compatibility we bump this number so that pip-accel knows it
# should clear the cache before proceeding.
CACHE_FORMAT_REVISION = 5
CACHE_FORMAT_REVISION = 6

def main():
"""
Expand Down
22 changes: 18 additions & 4 deletions pip_accel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Standard library modules.
import os
import pipes
import platform
import pwd
import re
import sys
Expand Down Expand Up @@ -49,12 +50,25 @@ def expand_user(pathname):

def get_python_version():
"""
Return a string identifying the currently running Python version.
Get a string identifying the currently running Python version.
:returns: A string like "py2.6" or "py2.7" containing a short mnemonic
prefix followed by the major and minor version numbers.
This function generates a string that uniquely identifies the currently
running Python implementation and version. The Python implementation is
discovered using :py:func:`platform.python_implementation()` and the major
and minor version numbers are extracted from :py:data:`sys.version_info`.
:returns: A string containing the name of the Python implementation
and the major and minor version numbers.
Example:
>>> from pip_accel.utils import get_python_version
>>> get_python_version()
'CPython-2.7'
"""
return "py%i.%i" % (sys.version_info[0], sys.version_info[1])
return '%s-%i.%i' % (platform.python_implementation(),
sys.version_info[0],
sys.version_info[1])

def run(command, **params):
"""
Expand Down

0 comments on commit d43e260

Please sign in to comment.