Skip to content

Commit

Permalink
Merge branch 'master' into python3
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Mar 18, 2011
2 parents eea3305 + 93940e4 commit df231bb
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 64 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Expand Up @@ -5,3 +5,5 @@ recursive-exclude virtualenv_support *.py
recursive-exclude docs/_templates *.*
include virtualenv_support/__init__.py
include *.py
include AUTHORS.txt
include LICENSE.txt
19 changes: 2 additions & 17 deletions docs/conf.py
Expand Up @@ -42,23 +42,8 @@
#
# The short X.Y version.

## Figure out the version from virtualenv.py:
import re, os
version_re = re.compile(
r'virtualenv_version = "(.*?)"')
fp = open(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
'virtualenv.py'))
version = None
for line in fp:
match = version_re.search(line)
if match:
release = match.group(1)
break
else:
raise Exception("Cannot find version in virtualenv.py")
fp.close()
del re, os, line, fp, version_re
version = '.'.join(release.split('.')[:2])
release = "1.5.2.post1"
version = ".".join(release.split(".")[:2])

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
46 changes: 24 additions & 22 deletions docs/index.txt
Expand Up @@ -64,32 +64,34 @@ The basic usage is::

If you install it you can also just do ``virtualenv ENV``.

This creates ``ENV/lib/python2.4/site-packages`` (or
``ENV/lib/python2.5/site-packages`` on Python 2.5, etc), where any
libraries you install will go. It also creates ``ENV/bin/python``,
which is a Python interpreter that uses this environment. Anytime you
use that interpreter (including when a script has
``#!/path/to/ENV/bin/python`` in it) the libraries in that environment
will be used. (**Note for Windows:** scripts and executables on
Windows go in ``ENV\Scripts\``; everywhere you see ``bin/`` replace it
with ``Scripts\``)

It also installs `Setuptools
<http://peak.telecommunity.com/DevCenter/setuptools>`_ for you, and if
you use ``ENV/bin/easy_install`` the packages will be installed into
the environment.

If you use the ``--distribute`` option, it will install `distribute
<http://pypi.python.org/pypi/distribute>`_ for you, instead of setuptools,
and if you use `ENV/bin/easy_install`` the packages will be installed into the
environment.
This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
install will go. It also creates ``ENV/bin/python``, which is a Python
interpreter that uses this environment. Anytime you use that interpreter
(including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
in that environment will be used.

To use Distribute just call virtualenv like this::
It also installs either `Setuptools
<http://peak.telecommunity.com/DevCenter/setuptools>`_ or `distribute
<http://pypi.python.org/pypi/distribute>`_ into the environment. To use
Distribute instead of setuptools, just call virtualenv like this::

$ python virtualenv.py --distribute ENV

You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE (since 1.4.4)
and be a good Comrade.
You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE.

A new virtualenv also includes the `pip <http://pypy.python.org/pypi/pip>`_
installer, so you can use `ENV/bin/pip`` to install additional packages into
the environment.

Windows Notes
~~~~~~~~~~~~~

Some paths within the virtualenv are slightly different on Windows: scripts and
executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.

To create a virtualenv under a path with spaces in it on Windows, you'll need
the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.

PyPy Support
~~~~~~~~~~~~
Expand Down
14 changes: 7 additions & 7 deletions docs/news.txt
Expand Up @@ -2,13 +2,13 @@ Changes & News
--------------

tip (unreleased)
----------------
~~~~~~~~~~~~~~~~

* Fixed creation of virtualenvs on Mac OS X when standard library modules
(readline) are installed outside the standard library.

1.5.2
-----
~~~~~

* Moved main repository to Github: https://github.com/pypa/virtualenv

Expand All @@ -23,14 +23,14 @@ tip (unreleased)
* Moved virtualenv to Github at https://github.com/pypa/virtualenv

1.5.1
-----
~~~~~

* Added ``_weakrefset`` requirement for Python 2.7.1.

* Fixed Windows regression in 1.5

1.5
---
~~~

* Include pip 0.8.1.

Expand All @@ -47,12 +47,12 @@ tip (unreleased)
* Add fish and csh activate scripts.

1.4.9
-----
~~~~~

* Include pip 0.7.2

1.4.8
-----
~~~~~

* Fix for Mac OS X Framework builds that use
``--universal-archs=intel``
Expand All @@ -66,7 +66,7 @@ tip (unreleased)
* Include pip 0.7.1

1.4.7
-----
~~~~~

* Include pip 0.7

Expand Down
21 changes: 6 additions & 15 deletions setup.py
Expand Up @@ -15,28 +15,19 @@

here = os.path.dirname(os.path.abspath(__file__))

## Figure out the version from virtualenv.py:
version_re = re.compile(
r'virtualenv_version = "(.*?)"')
fp = open(os.path.join(here, 'virtualenv.py'))
version = None
for line in fp:
match = version_re.search(line)
if match:
version = match.group(1)
break
else:
raise Exception("Cannot find version in virtualenv.py")
fp.close()

## Get long_description from index.txt:
f = open(os.path.join(here, 'docs', 'index.txt'))
long_description = f.read().strip()
long_description = long_description.split('split here', 1)[1]
f.close()
f = open(os.path.join(here, 'docs', 'news.txt'))
long_description += "\n\n" + f.read()
f.close()

setup(name='virtualenv',
version=version,
# If you change the version here, change it in virtualenv.py and
# docs/conf.py as well
version="1.5.2.post1",
description="Virtual Python Environment builder",
long_description=long_description,
classifiers=[
Expand Down
8 changes: 5 additions & 3 deletions virtualenv.py
@@ -1,7 +1,9 @@
"""Create a "virtual" Python installation
"""

virtualenv_version = "1.5.2"
# If you change the version here, change it in setup.py
# and docs/conf.py as well.
virtualenv_version = "1.5.2.post1"

import base64
import sys
Expand Down Expand Up @@ -730,8 +732,8 @@ def call_subprocess(cmd, show_stdout=True,
remove_from_env=None):
cmd_parts = []
for part in cmd:
if len(part) > 40:
part = part[:30]+"..."+part[-5:]
if len(part) > 45:
part = part[:20]+"..."+part[-20:]
if ' ' in part or '\n' in part or '"' in part or "'" in part:
part = '"%s"' % part.replace('"', '\\"')
cmd_parts.append(part)
Expand Down

0 comments on commit df231bb

Please sign in to comment.