Permalink
Browse files

Merge pull request #7 from mktums/master

Update to PyPy 1.9
  • Loading branch information...
2 parents 960e7d9 + 40ae64c commit 624aa54f47ffe8586b110dfe678cf21b4abaf052 Alexei Boronine committed Feb 14, 2013
Showing with 18 additions and 13 deletions.
  1. +15 −10 pypyenv.py
  2. +3 −3 setup.py
View
@@ -6,7 +6,7 @@
import stat
import platform
-__version__ = "0.1.3"
+__version__ = "0.1.4"
base = sys.prefix
srcdir = "src"
@@ -17,9 +17,11 @@
version = sys.version[:3]
yes = ("y", "yes")
+
def out(s):
print " * " + s
+
def install(download):
os.chdir(base)
# Clean up if anything was left over
@@ -42,7 +44,7 @@ def install(download):
break
archivefile.write(data)
archivefile.close()
- # Unpack archive
+ # Unpack archive
archiveobj = tarfile.open(archive, mode="r:bz2")
unpacked = os.path.join(srcdir, archiveobj.next().name)
if os.path.exists(unpacked):
@@ -65,9 +67,10 @@ def install(download):
shutil.rmtree(pypysite)
os.symlink(pythonsite, pypysite)
+
def uninstall():
os.chdir(base)
- if os.path.exists(binpypy):
+ if os.path.exists(binpypy):
if confirm_deletion(binpypy):
os.remove(binpypy)
else:
@@ -78,18 +81,21 @@ def uninstall():
else:
sys.exit(1)
+
def confirm_deletion(tree):
return raw_input("Delete ENV/%s? [y/N] " % tree) in yes
+
help_message = """ pypyenv install - installs PyPy in this virtualenv
pypyenv uninstall - uninstalls PyPy from this virtualenv"""
+
def main():
args = sys.argv[1:]
if version != "2.7":
- if not raw_input("PyPy implements Python 2.7, you are using a " \
+ if not raw_input("PyPy implements Python 2.7, you are using a "
"different version, continue? [y/N] ") in yes:
- sys.exit(1)
+ sys.exit(1)
if len(args) != 1:
print help_message
@@ -107,16 +113,15 @@ def main():
sys.exit(2)
if linux and x86:
- download = "https://bitbucket.org/pypy/pypy/downloads/pypy-1.7-linux.tar.bz2"
+ download = "https://bitbucket.org/pypy/pypy/downloads/pypy-1.9-linux.tar.bz2"
elif linux and x86_64:
- download = "https://bitbucket.org/pypy/pypy/downloads/pypy-1.7-linux64.tar.bz2"
+ download = "https://bitbucket.org/pypy/pypy/downloads/pypy-1.9-linux64.tar.bz2"
elif osx:
- download = "https://bitbucket.org/pypy/pypy/downloads/pypy-1.7-osx64.tar.bz2"
+ download = "https://bitbucket.org/pypy/pypy/downloads/pypy-1.9-osx64.tar.bz2"
if args[0] == "install":
install(download)
elif args[0] == "uninstall":
uninstall()
else:
- print help_message
-
+ print help_message
View
@@ -11,8 +11,8 @@
name='pypyenv',
version=__version__,
description='Install PyPy in virtualenv',
- long_description="Install PyPy as an optional Python interpretor "\
- "in a virtualenv on Linux and OS X systems.",
+ long_description="Install latest stable PyPy as an optional Python interpretor "
+ "in a virtualenv on Linux and OS X systems.",
author="Alexei Boronine",
license="MIT",
author_email="alexei.boronine@gmail.com",
@@ -28,7 +28,7 @@
"Topic :: Software Development"
],
py_modules=["pypyenv"],
- entry_points = {
+ entry_points={
'console_scripts': [
'pypyenv = pypyenv:main'
]

0 comments on commit 624aa54

Please sign in to comment.